SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.03089 · 2021

Referring Transformer: A One-step Approach to Multi-task Visual Grounding

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 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 4 have no contract verdict; 1 failure of our instrument; 0 no recorded run), measured 2026-11-21; 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/2106.03089.json · badge: /api/ran/2106.03089.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
ubc-vision/RefTR canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
FunctionStatusWhere it lives
convert_examples_to_features Ran
ran; our contract draft was wrong, not the code
ubc-vision/RefTR/datasets/lang_utils.py
code served (permissive licence) · get_code("db595e458994d7d0")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. 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

class SimpleTokenizer:
    def __init__(self):
        self.vocab = {
            '[CLS]': 101,
            '[SEP]': 102,
            '[PAD]': 0,
            'hello': 1,
            'world': 2,
            'test': 3,
            'example': 4,
            'text': 5,
        }
    
    def tokenize(self, text):
        if text is None:
            return None
        return text.lower().split()
    
    def convert_tokens_to_ids(self, tokens):
        ids = []
        for token in tokens:
            if token in self.vocab:
                ids.append(self.vocab[token])
            else:
                ids.append(1)
        return ids

class Example:
    def __init__(self, unique_id, text_a, text_b=None):
        self.unique_id = unique_id
        self.text_a = text_a
        self.text_b = text_b

examples = [
    Example(unique_id=0, text_a="hello world", text_b="test example"),
    Example(unique_id=1, text_a="example text", text_b=None),
]

tokenizer = SimpleTokenizer()
seq_length = 16

ARGS = {
    "examples": examples,
    "seq_length": seq_length,
    "tokenizer": tokenizer,
}
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 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
mlp_mapping Ran
ran on a synthesized input
ubc-vision/RefTR/models/reftr_transformer.py
code served (permissive licence) · get_code("7a5bae282fd6c7e4")
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 Sequential. 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
from torch import nn

torch.manual_seed(0)

ARGS = {
    "input_dim": 4,
    "output_dim": 3,
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
read_examples Ran
ran on a synthesized input
ubc-vision/RefTR/datasets/lang_utils.py
code served (permissive licence) · get_code("cec54f25f6a14bf4")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. 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 re

class InputExample(object):
    def __init__(self, unique_id, text_a, text_b):
        self.unique_id = unique_id
        self.text_a = text_a
        self.text_b = text_b

def read_examples(input_line, unique_id):
    """
    Note from JOJO: this is copied from bert source code
    refer to:
    https://daiwk.github.io/posts/nlp-bert-code-annotated-application.html#inputexample
    for understanding
    Read a list of `InputExample`s from an input file."""
    examples = []
    line = input_line
    line = line.strip()
    text_a = None
    text_b = None
    m = re.match('^(.*) \\|\\|\\| (.*)$', line)
    if m is None:
        text_a = line
    else:
        text_a = m.group(1)
        text_b = m.group(2)
    examples.append(InputExample(unique_id=unique_id, text_a=text_a, text_b=text_b))
    return examples

ARGS = {
    "input_line": "This is sample text A ||| This is sample text B",
    "unique_id": 42
}
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 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
to_cuda Ran
ran on a synthesized input
ubc-vision/RefTR/engine_vg.py
code served (permissive licence) · get_code("b46073da47f49206")
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 tuple. 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

torch.manual_seed(0)

# samples is a dict where values are tensors that have a .to() method
samples = {
    "image": torch.randn(2, 4),
    "text": torch.randn(2, 3),
}

# targets is a list of dicts where values are tensors that have a .to() method
targets = [
    {
        "label": torch.tensor([1, 0]),
        "bbox": torch.randn(2, 5),
    },
    {
        "label": torch.tensor([0, 1]),
        "bbox": torch.randn(2, 5),
    },
]

# device is a torch device
device = torch.device("cpu")

ARGS = {
    "samples": samples,
    "targets": targets,
    "device": device,
}
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 tuple — a tuple output has no array shape of its own; none is 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
to_cuda Ran
ran on a synthesized input
ubc-vision/RefTR/datasets/data_prefetcher.py
code served (permissive licence) · get_code("6b447c14f1b53ea9")
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 tuple. 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

torch.manual_seed(0)

# Create a small sample tensor (batch_size=2, channels=3, height=4, width=4)
samples = torch.randn(2, 3, 4, 4)

# Create targets as a list of dicts, where each dict maps strings to tensors
# This matches the unpacking pattern in the function: {k: v.to(device) for k, v in t.items()}
targets = [
    {
        "boxes": torch.randn(5, 4),
        "labels": torch.randint(0, 10, (5,)),
    },
    {
        "boxes": torch.randn(3, 4),
        "labels": torch.randint(0, 10, (3,)),
    },
]

# Device is CPU (as per rules, no CUDA)
device = "cpu"

ARGS = {
    "samples": samples,
    "targets": targets,
    "device": device,
}
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 tuple — a tuple output has no array shape of its own; none is 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

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 2 later) and 2 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
read_examples 7 other papers
3 dated earlier, 4 later
1908.06354 (2019-08)
A Fast and Accurate One-Stage Approach to Visual Grounding
2008.01059 (2020-08)
Improving One-stage Visual Grounding by Recursive Sub-query Construction
2104.08541 (2021-04)
TransVG: End-to-End Visual Grounding with Transformers
and 4 more not named here
convert_examples_to_features 6 other papers
3 dated earlier, 3 later
1908.06354 (2019-08)
A Fast and Accurate One-Stage Approach to Visual Grounding
2008.01059 (2020-08)
Improving One-stage Visual Grounding by Recursive Sub-query Construction
2104.08541 (2021-04)
TransVG: End-to-End Visual Grounding with Transformers
and 3 more not named here
to_cuda 1 other paper
1 dated earlier
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection

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

Repositories linked to this paper

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

Abstract

As an important step towards visual reasoning, visual grounding (e.g., phrase localization, referring expression comprehension/segmentation) has been widely explored Previous approaches to referring expression comprehension (REC) or segmentation (RES) either suffer from limited performance, due to a two-stage setup, or require the designing of complex task-specific one-stage architectures. In this paper, we propose a simple one-stage multi-task framework for visual grounding tasks. Specifically, we leverage a transformer architecture, where two modalities are fused in a visual-lingual encoder. In the decoder, the model learns to generate contextualized lingual queries which are then decoded and used to directly regress the bounding box and produce a segmentation mask for the corresponding referred regions. With this simple but highly contextualized model, we outperform state-of-the-arts methods by a large margin on both REC and RES tasks. We also show that a simple pre-training schedule (on an external dataset) further improves the performance. Extensive experiments and ablations illustrate that our model benefits greatly from contextualized information and multi-task training.

For agents

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

get_harvested_code_for_paper("2106.03089")
get_code_for_paper("2106.03089")
have("2106.03089")

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

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

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

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

Connect an agent — have() is free.