SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.13653 · IJCAI · 2023

RaSa: Relation and Sensitivity Aware Representation Learning for Text-based Person Search

Chen Chen, Min Zhang, Yang Bai, Liqiang Nie, Ziqiang Cao, Min Cao, Zhenfeng Fan, Daming Gao

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 2 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2305.13653.json · badge: /api/ran/2305.13653.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
Flame-Chasers/RaSa canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
FunctionStatusWhere it lives
whitespace_tokenize Ran
ran; our contract draft was wrong, not the code
Flame-Chasers/RaSa/models/tokenization_bert.py
code served (permissive licence) · get_code("cf9ffa02a42184af")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-05T02:55:57Z). If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

def whitespace_tokenize(text):
    """Runs basic whitespace cleaning and splitting on a piece of text."""
    text = text.strip()
    if not text:
        return []
    tokens = text.split()
    return tokens

# Setup code
torch.manual_seed(0)

# The function takes a single parameter: text (a string)
# It performs basic whitespace cleaning and splitting
# We need to provide a valid string argument

ARGS = {
    "text": "  hello world  this is a test  "
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
interpolate_pos_embed Ran
ran; our contract draft was wrong, not the code
Flame-Chasers/RaSa/models/vit.py
code served (permissive licence) · get_code("c6ec173f19f5c34d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 3, dtype family float, shape (1, 17, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class PatchEmbed(nn.Module):
    def __init__(self, num_patches):
        super().__init__()
        self.num_patches = num_patches

class VisualEncoder(nn.Module):
    def __init__(self, num_patches, pos_embed_shape):
        super().__init__()
        self.patch_embed = PatchEmbed(num_patches)
        self.pos_embed = torch.randn(pos_embed_shape)

# Create a visual encoder with 16 patches (4x4 grid)
# pos_embed shape: (1, num_patches + num_extra_tokens, embedding_dim)
num_patches = 16
num_extra_tokens = 1
embedding_size = 4
visual_encoder = VisualEncoder(
    num_patches=num_patches,
    pos_embed_shape=(1, num_patches + num_extra_tokens, embedding_size)
)

# Create pos_embed_checkpoint with original size 2x2 (4 patches) + 1 extra token
# This will trigger interpolation from 2x2 to 4x4
orig_size = 2
orig_num_patches = orig_size * orig_size
pos_embed_checkpoint = torch.randn(1, orig_num_patches + num_extra_tokens, embedding_size)

ARGS = {
    "pos_embed_checkpoint": pos_embed_checkpoint,
    "visual_encoder": visual_encoder,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (1, 17, 4) — shape (1, 17, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
itm_eval Ran
ran; our contract draft was wrong, not the code
Flame-Chasers/RaSa/Retrieval.py
pointer only (licence: MIT); the stored copy get_code serves, from Flame-Chasers/GTR, is pointer only (licence: NONE) · get_code("c6527ef1dd35e7f1")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Flame-Chasers/GTR, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

load_vocab Ran
ran; our contract draft was wrong, not the code
Flame-Chasers/RaSa/models/tokenization_bert.py
code served (permissive licence) · get_code("e7fbc7a74a3457c7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned OrderedDict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import collections
import tempfile
import os

# Create a temporary vocabulary file
temp_dir = tempfile.mkdtemp()
vocab_file = os.path.join(temp_dir, 'vocab.txt')

# Write some sample tokens to the vocab file
sample_tokens = ['[PAD]', '[UNK]', '[CLS]', '[SEP]', 'the', 'quick', 'brown', 'fox']
with open(vocab_file, 'w', encoding='utf-8') as f:
    for token in sample_tokens:
        f.write(token + '\n')

ARGS = {
    'vocab_file': vocab_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
pre_caption Ran
ran; our contract draft was wrong, not the code
Flame-Chasers/RaSa/dataset/utils.py
code served (permissive licence) · get_code("8a57c3e7d1cf36c7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def pre_caption(caption, max_words):
    caption = re.sub('([,.\'!?\\"()*#:;~])', '', caption.lower()).replace('-', ' ').replace('/', ' ').replace('<person>', 'person')
    caption = re.sub('\\s{2,}', ' ', caption)
    caption = caption.rstrip('\n')
    caption = caption.strip(' ')
    caption_words = caption.split(' ')
    if len(caption_words) > max_words:
        caption = ' '.join(caption_words[:max_words])
    return caption

# Setup code to construct valid arguments
ARGS = {
    'caption': 'Hello, world! This is a <person> testing the pre_caption function with many words to potentially exceed the maximum.',
    'max_words': 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
concat_all_gather Not yet run
unverified (harvested, no recorded run)
Flame-Chasers/RaSa/models/model_person_search.py
code served (permissive licence) · get_code("73cecca9f3575f09")
How it ran

no invocation recorded.

load_tf_weights_in_bert Not yet run
unverified (harvested, no recorded run)
Flame-Chasers/RaSa/models/xbert.py
code served (permissive licence) · get_code("26be70dca3249c0b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 7 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 3 the same month, 7 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
concat_all_gather 138 other papers
73 dated earlier, 2 the same month, 62 later, 1 same year, order not determinable · 33 only as an assembly brick
1710.09412 (2017-10)
mixup: BEYOND EMPIRICAL RISK MINIMIZATION
1905.04899 (2019-05)
CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
and 135 more not named here
interpolate_pos_embed 52 other papers
11 dated earlier, 41 later
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
2111.09452 (2021-11)
Open Vocabulary Object Detection with Pseudo Bounding-Box Labels
2205.11169 (2022-05)
PEVL: Position-enhanced Pre-training and Prompt Tuning for Vision-language Models
and 49 more not named here
whitespace_tokenize 43 other papers
27 dated earlier, 1 the same month, 15 later
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1906.01698 (2019-06)
Open Sesame: Getting Inside BERT's Linguistic Knowledge
and 40 more not named here
load_vocab 29 other papers
15 dated earlier, 14 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1909.11942 (2019-09)
ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
2004.09297 (2020-04)
MPNet: Masked and Permuted Pre-training for Language Understanding
and 26 more not named here
load_tf_weights_in_bert 28 other papers
13 dated earlier, 1 the same month, 13 later, 1 same year, order not determinable
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
2021.emnlp-main.154 (2021 (year only))
Reconstruction Attack on Instance Encoding for Language Understanding
2104.06599 (2021-04)
Learning How to Ask: Querying LMs with Mixtures of Soft Prompts
and 25 more not named here
pre_caption 8 other papers
1 dated earlier, 7 later
2207.05333 (2022-07)
IDEA: Increasing Text Diversity via Online Multi-Label Recognition for Vision-Language Pre-training
2307.14061 (2023-07)
Set-level Guidance Attack: Boosting Adversarial Transferability of Vision-Language Pre-training Models
2308.04380 (2023-08)
Your Negative May not Be True Negative: Boosting Image-Text Matching with False Negative Elimination
and 5 more not named here
itm_eval 1 other paper
1 later
2609.12965 (2026-09)
Generative Retrieval for Unsupervised Text-Based Person Search

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Text-based person search aims to retrieve the specified person images given a textual description. The key to tackling such a challenging task is to learn powerful multi-modal representations. Towards this, we propose a Relation and Sensitivity aware representation learning method (RaSa), including two novel tasks: Relation-Aware learning (RA) and Sensitivity-Aware learning (SA). For one thing, existing methods cluster representations of all positive pairs without distinction and overlook the noise problem caused by the weak positive pairs where the text and the paired image have noise correspondences, thus leading to overfitting learning. RA offsets the overfitting risk by introducing a novel positive relation detection task (i.e., learning to distinguish strong and weak positive pairs). For another thing, learning invariant representation under data augmentation (i.e., being insensitive to some transformations) is a general practice for improving representation's robustness in existing methods. Beyond that, we encourage the representation to perceive the sensitive transformation by SA (i.e., learning to detect the replaced words), thus promoting the representation's robustness. Experiments demonstrate that RaSa outperforms existing state-of-the-art methods by 6.94%, 4.45% and 15.35% in terms of Rank@1 on CUHK-PEDES, ICFG-PEDES and RSTPReid datasets, respectively. Code is available at: https://github.com/Flame-Chasers/RaSa.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2305.13653")
get_code_for_paper("2305.13653")
have("2305.13653")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2305.13653.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2305.13653.svg)](https://syntology.ai/paper/2305.13653)

Connect an agent — have() is free.