SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2207.13325 · ECCV · 2022

SiRi: A Simple Selective Retraining Mechanism for Transformer-based Visual Grounding

Yu Wu, Yunchao Wei, Yao Zhao, Xiaodan Liang, Olga Russakovsky, Mengxue Qu, Wu Liu, Qiqi Gong

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 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, 2 violated it and 2 have no contract verdict; 2 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2207.13325.json · badge: /api/ran/2207.13325.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
qumengxue/siri-vg canonical (classifier label)
classifier basis not recorded on the link
6 ran · 2 no recorded run
FunctionStatusWhere it lives
build_position_encoding Ran
ran; our contract draft was wrong, not the code
qumengxue/siri-vg/models/position_encoding.py
code served (permissive licence) · get_code("cea3f92defccfb9c")
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 PositionEmbeddingSine. 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 torch
import torch.nn as nn
import math

torch.manual_seed(0)

class TensorList:
    """Mock tensor list object used by the position embedding functions."""
    def __init__(self, tensors, mask):
        self.tensors = tensors
        self.mask = mask

class Args:
    """Mock arguments object for build_position_encoding."""
    def __init__(self, hidden_dim=128, position_embedding='sine'):
        self.hidden_dim = hidden_dim
        self.position_embedding = position_embedding

# Create a small batch of tensors
batch_size = 2
height = 4
width = 3
channels = 16

# Create input tensor
tensors = torch.randn(batch_size, channels, height, width)

# Create mask (False means valid, True means padding)
mask = torch.zeros(batch_size, height, width, dtype=torch.bool)

# Create tensor_list object
tensor_list = TensorList(tensors=tensors, mask=mask)

# Create args for sine position embedding
args_sine = Args(hidden_dim=128, position_embedding='sine')

# Create args for learned position embedding
args_learned = Args(hidden_dim=128, position_embedding='learned')

ARGS = {
    'args': args_sine
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PositionEmbeddingSine — a PositionEmbeddingSine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PositionEmbeddingSine 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
create_positive_map Ran
ran on a synthesized input
qumengxue/siri-vg/datasets/coco.py
code served (permissive licence) · get_code("7ab3fd5b2e774fce")
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 Tensor, ndim 2, dtype family float, shape (3, 2) 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

torch.manual_seed(0)

# tokenized: appears to be used with len() in the function, so it needs to be a sequence
# Looking at the function body, tokenized is not actually used in the computation,
# but we need to provide it as a parameter
tokenized = ["token1", "token2", "token3"]

# tokens_positive: used with len() to determine the first dimension of positive_map
# Should be a list or sequence of positive token associations
tokens_positive = [
    [(0, 1)],           # box 0 associates with token 1
    [(1, 2)],           # box 1 associates with token 2
    [(0, 2), (1, 3)],   # box 2 associates with tokens 2 and 3
]

ARGS = {
    "tokenized": tokenized,
    "tokens_positive": tokens_positive,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 2, dtype family float, shape (3, 2) — shape (3, 2) 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
dice_loss Ran
ran, violated the contract we drafted
qumengxue/siri-vg/models/segmentation.py
code served (permissive licence) · get_code("ac8fe530cdad4d8c")
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 Tensor, ndim 0, dtype family float, shape () 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)

# Create sample inputs and targets tensors
# The function expects tensors that can be flattened and have sigmoid applied
# Shape: batch_size=2, spatial_dims flattened to create predictions
batch_size = 2
num_spatial = 4

# inputs: predictions before sigmoid, shape (batch_size, num_spatial)
inputs = torch.randn(batch_size, num_spatial)

# targets: binary labels matching inputs shape, values 0 or 1
targets = torch.randint(0, 2, (batch_size, num_spatial), dtype=torch.float32)

# num_boxes: number of boxes for normalization
num_boxes = 2

ARGS = {
    "inputs": inputs,
    "targets": targets,
    "num_boxes": num_boxes,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 0, dtype family float, shape () — shape () 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
make_gaussian Ran
ran on a synthesized input
qumengxue/siri-vg/models/gauss_map.py
code served (permissive licence) · get_code("27b7ba6150ab74d3")
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 Tensor, ndim 2, dtype family float, shape (4, 5) 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 numpy as np
import torch

torch.manual_seed(0)

ARGS = {
    "size": (4, 5),
    "sigma": 10,
    "center": None,
    "d_type": np.float64
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 5) — shape (4, 5) 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
normalization Ran
ran, violated the contract we drafted
qumengxue/siri-vg/models/gauss_map.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from thuml/dare, is pointer only (licence: NONE) · get_code("86c7147edb17dd5d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from thuml/dare, 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.

sigmoid_focal_loss Ran
ran; our contract draft was wrong, not the code
qumengxue/siri-vg/models/segmentation.py
code served (permissive licence) · get_code("5c0711aada67957e")
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 0, dtype family float, shape () 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.functional as F

torch.manual_seed(0)

# Create small tensors for inputs and targets
# inputs: predictions (logits) - shape (2, 4) for batch_size=2, num_predictions=4
inputs = torch.randn(2, 4, requires_grad=True)

# targets: binary labels - shape (2, 4) matching inputs
targets = torch.randint(0, 2, (2, 4), dtype=torch.float32)

# num_boxes: number of boxes for normalization
num_boxes = 2

# alpha and gamma are already float parameters with defaults
alpha = 0.25
gamma = 2.0

ARGS = {
    "inputs": inputs,
    "targets": targets,
    "num_boxes": num_boxes,
    "alpha": alpha,
    "gamma": gamma,
}
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 0, dtype family float, shape () — shape () 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
build_transformer Not yet run
unverified (harvested, no recorded run)
qumengxue/siri-vg/models/transformer.py
code served (permissive licence) · get_code("f8cea2a98b3268dd")
How it ran

no invocation recorded.

get_proposal_pos_embed Not yet run
unverified (harvested, no recorded run)
qumengxue/siri-vg/models/gauss_map.py
code served (permissive licence) · get_code("c00698a63ab2ede9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 2 the same month, 4 later) and 4 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
sigmoid_focal_loss 56 other papers
17 dated earlier, 1 the same month, 35 later, 3 same year, order not determinable · 1 only as an assembly brick
2005.12872 (2020-05)
End-to-End Object Detection with Transformers
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection
2103.11731 (2021-03)
Meta-DETR: Image-Level Few-Shot Object Detection with Inter-Class Correlation Exploitation
and 53 more not named here
dice_loss 40 other papers
13 dated earlier, 1 the same month, 23 later, 3 same year, order not determinable · 1 only as an assembly brick
2005.12872 (2020-05)
End-to-End Object Detection with Transformers
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection
2103.12115 (2021-03)
End-to-End Trainable Multi-Instance Pose Estimation with Transformers
and 37 more not named here
build_position_encoding 8 other papers
3 dated earlier, 5 later
2104.12763 (2021-04)
MDETR -Modulated Detection for End-to-End Multi-Modal Understanding
2108.11084 (2021-08)
Transformer for Single Image Super-Resolution
2111.12085 (2021-11)
UniTAB: Unifying Text and Box Outputs for Grounded Vision-Language Modeling
and 5 more not named here
normalization 4 other papers
4 later
2306.09104 (2023-06)
On Strengthening and Defending Graph Reconstruction Attack with Markov Chain Approximation
2407.11633 (2024-07)
Scaling Diffusion Transformers to 16 Billion Parameters
2410.02604 (2024-10)
Long-Sequence Recommendation Models Need Decoupled Embeddings
and 1 more not named here

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-23.

Repositories linked to this paper

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

Abstract

In this paper, we investigate how to achieve better visual grounding with modern vision-language transformers, and propose a simple yet powerful Selective Retraining (SiRi) mechanism for this challenging task. Particularly, SiRi conveys a significant principle to the research of visual grounding, i.e., a better initialized vision-language encoder would help the model converge to a better local minimum, advancing the performance accordingly. In specific, we continually update the parameters of the encoder as the training goes on, while periodically re-initialize rest of the parameters to compel the model to be better optimized based on an enhanced encoder. SiRi can significantly outperform previous approaches on three popular benchmarks. Specifically, our method achieves 83.04% Top1 accuracy on RefCOCO+ testA, outperforming the state-ofthe-art approaches (training from scratch) by more than 10.21%. Additionally, we reveal that SiRi performs surprisingly superior even with limited training data. We also extend it to transformer-based visual grounding models and other vision-language tasks to verify the validity. Code is available at https://github.com/qumengxue/siri-vg.git.

For agents

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

get_harvested_code_for_paper("2207.13325")
get_code_for_paper("2207.13325")
have("2207.13325")

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

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

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

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

Connect an agent — have() is free.