SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.11681 · CVPR · 2021

Transformer Meets Tracker: Exploiting Temporal Context for Robust Visual Tracking

Wengang Zhou, Houqiang Li, Jie Wang, Ning Wang

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 1 failure of our instrument; 3 no recorded run), 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/2103.11681.json · badge: /api/ran/2103.11681.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
594422814/TransformerTrack marked official in Papers with Code
Papers with Code archive
6 ran · 3 no recorded run
FunctionStatusWhere it lives
InstanceL2Norm Ran
ran on a synthesized input · constructed an object; no result was computed
594422814/TransformerTrack/ltr/models/target_classifier/transformer.py
code served (permissive licence) · get_code("c39d16d0426c394c")
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 an instance of its own class, InstanceL2Norm: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# Construct arguments for InstanceL2Norm
# The forward method expects input with shape [batch, channels, height, width]
# Looking at the code: input.shape[0] = batch, input.shape[1] = channels, 
# input.shape[2] = height, input.shape[3] = width

ARGS = {
    'size_average': True,
    'eps': 1e-05,
    'scale': 1.0,
}
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 InstanceL2Norm — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a InstanceL2Norm 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
MultiheadAttention Ran
ran on a synthesized input · constructed an object; no result was computed
594422814/TransformerTrack/ltr/models/target_classifier/transformer.py
code served (permissive licence) · get_code("1b733e1fccc5d345")
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 an instance of its own class, MultiheadAttention: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# Create small tensors for query, key, value
# Shape: (batch_size, seq_len, feature_dim)
batch_size = 2
seq_len_query = 3
seq_len_key = 4
feature_dim = 512

query = torch.randn(batch_size, seq_len_query, feature_dim)
key = torch.randn(batch_size, seq_len_key, feature_dim)
value = torch.randn(batch_size, seq_len_key, feature_dim)

ARGS = {
    'feature_dim': 512,
    'n_head': 8,
    'key_feature_dim': 64,
}
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 MultiheadAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MultiheadAttention 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
TransformerDecoderLayer Ran
ran on a synthesized input · constructed an object; no result was computed
594422814/TransformerTrack/ltr/models/target_classifier/transformer.py
code served (permissive licence) · get_code("81552d44911a524a")
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 an instance of its own class, TransformerDecoderLayer: the run constructed the object and did not call it, so no result was computed. 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)

# Build a simple FFN module
class SimpleFFN(nn.Module):
    def __init__(self, d_model):
        super().__init__()
        self.linear1 = nn.Linear(d_model, d_model * 4)
        self.linear2 = nn.Linear(d_model * 4, d_model)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

# Build MultiheadAttention with correct parameters
d_model = 4
n_head = 2
key_feature_dim = 64

multihead_attn = nn.ModuleList()
for _ in range(n_head):
    from torch import nn as nn_module
    class RelationUnit(nn_module.Module):
        def __init__(self, feature_dim=512, key_feature_dim=64):
            super(RelationUnit, self).__init__()
            self.temp = 30
            self.WK = nn_module.Linear(feature_dim, key_feature_dim)
            self.WV = nn_module.Linear(feature_dim, feature_dim)
            for m in self.WK.modules():
                m.weight.data.normal_(0, math.sqrt(2.0 / m.out_features))
                if m.bias is not None:
                    m.bias.data.zero_()
            for m in self.WV.modules():
                m.weight.data.normal_(0, math.sqrt(2.0 / m.out_features))
                if m.bias is not None:
                    m.bias.data.zero_()

        def forward(self, query=None, key=None, value=None):
            import torch.nn.functional as F
            w_k = self.WK(key)
            w_k = F.normalize(w_k, p=2, dim=-1)
            w_k = w_k.permute(1, 2, 0)
            w_q = self.WK(query)
            w_q = F.normalize(w_q, p=2, dim=-1)
            w_q = w_q.permute(1, 0, 2)
            dot_prod = torch.bmm(w_q, w_k)
            affinity = F.softmax(dot_prod * self.temp, dim=-1)
            w_v = value.permute(1, 0, 2)
            output = torch.bmm(affinity, w_v)
            output = output.permute(1, 0, 2)
            return output
    
    multihead_attn.append(RelationUnit(feature_dim=d_model, key_feature_dim=key_feature_dim))

class MultiheadAttentionWrapper(nn.Module):
    def __init__(self, heads):
        super().__init__()
        self.head = heads
        self.Nh = len(heads)
    
    def forward(self, query=None, key=None, value=None):
        isFirst = True
        for N in range(self.Nh):
            if isFirst:
                concat = self.head[N](query, key, value)
                isFirst = False
            else:
                concat = torch.cat((concat, self.head[N](query, key, value)), -1)
        return concat

multihead_attn_instance = MultiheadAttentionWrapper(multihead_attn)

# Create FFN
ffn = SimpleFFN(d_model)

# Create test tensors
# tgt shape: (seq_len, batch, d_model)
tgt = torch.randn(5, 2, d_model)

# memory shape: (seq_len, batch, d_model)
memory = torch.randn(7, 2, d_model)

# input_shape: (num_imgs, batch, d_model, h, w)
input_shape = (1, 2, d_model, 3, 4)

# pos: optional positional encoding tensor
pos = torch.ones(5, 2, d_model)

# query_pos: optional query positional encoding tensor
query_pos = torch.ones(5, 2, d_model)

ARGS = {
    'multihead_attn': multihead_attn_instance,
    'FFN': ffn,
    'd_model': d_model,
}
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 TransformerDecoderLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TransformerDecoderLayer 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
TransformerEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
594422814/TransformerTrack/ltr/models/target_classifier/transformer.py
code served (permissive licence) · get_code("f9081530a58aa58c")
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 an instance of its own class, TransformerEncoder: the run constructed the object and did not call it, so no result was computed. 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)

# Create a minimal multihead attention module
class MinimalMultiheadAttention(nn.Module):
    def __init__(self, embed_dim, num_heads=1):
        super().__init__()
        self.embed_dim = embed_dim
        self.num_heads = num_heads
        self.attn = nn.MultiheadAttention(embed_dim, num_heads, batch_first=False)
    
    def forward(self, query, key, value):
        # query, key, value shape: (seq_len, batch, embed_dim)
        attn_output, _ = self.attn(query, key, value)
        return attn_output

# Create a minimal FFN module
class MinimalFFN(nn.Module):
    def __init__(self, d_model):
        super().__init__()
        self.linear1 = nn.Linear(d_model, d_model * 4)
        self.linear2 = nn.Linear(d_model * 4, d_model)
    
    def forward(self, x):
        x = self.linear1(x)
        x = torch.relu(x)
        x = self.linear2(x)
        return x

# Parameters
d_model = 4
num_encoder_layers = 2
num_heads = 1
embed_dim = 4

# Instantiate multihead attention and FFN
multihead_attn = MinimalMultiheadAttention(embed_dim=embed_dim, num_heads=num_heads)
FFN = MinimalFFN(d_model=d_model)

ARGS = {
    'multihead_attn': multihead_attn,
    'FFN': FFN,
    'd_model': d_model,
    'num_encoder_layers': num_encoder_layers,
    'activation': 'relu'
}
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 TransformerEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TransformerEncoder 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
TransformerEncoderLayer Ran
ran on a synthesized input · constructed an object; no result was computed
594422814/TransformerTrack/ltr/models/target_classifier/transformer.py
code served (permissive licence) · get_code("81d1975ee00caff6")
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 an instance of its own class, TransformerEncoderLayer: the run constructed the object and did not call it, so no result was computed. 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
from typing import Optional

torch.manual_seed(0)

# Create a minimal multihead attention module that satisfies the usage in forward()
class MinimalMultiheadAttention(nn.Module):
    def __init__(self, d_model):
        super().__init__()
        self.d_model = d_model
    
    def forward(self, query, key, value):
        # Return tensor of same shape as input
        return torch.zeros_like(query)

# Create a minimal FFN module (not used in forward but required in __init__)
class MinimalFFN(nn.Module):
    def __init__(self, d_model):
        super().__init__()
        self.d_model = d_model
    
    def forward(self, x):
        return x

# Parameters
d_model = 4
num_imgs = 2
batch = 3
h = 2
w = 2

# Create multihead attention and FFN
multihead_attn = MinimalMultiheadAttention(d_model)
FFN = MinimalFFN(d_model)

# Create input tensor for forward pass
# src should have shape (seq_len, batch, d_model)
seq_len = num_imgs * h * w
src = torch.randn(seq_len, batch, d_model)

# input_shape tuple: (num_imgs, batch, dim, h, w)
input_shape = (num_imgs, batch, d_model, h, w)

ARGS = {
    'multihead_attn': multihead_attn,
    'FFN': FFN,
    'd_model': d_model
}
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 TransformerEncoderLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TransformerEncoderLayer 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
_get_clones Ran
ran; our contract draft was wrong, not the code
594422814/TransformerTrack/ltr/models/target_classifier/transformer.py
code served (permissive licence) · get_code("18c99336939119a2")
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 ModuleList. 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

torch.manual_seed(0)

# Build a minimal nn.Module to clone
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create an instance of the module
module = SimpleModule()

# The function takes a module and N (number of clones)
N = 5

ARGS = {
    "module": module,
    "N": N
}
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 ModuleList — a ModuleList output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModuleList 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
RelationUnit Not yet run
unverified (harvested, no recorded run)
594422814/TransformerTrack/ltr/models/target_classifier/transformer.py
code served (permissive licence) · get_code("aad0f1f277edccd0")
How it ran

no invocation recorded.

Transformer Not yet run
unverified (harvested, no recorded run)
594422814/TransformerTrack/ltr/models/target_classifier/transformer.py
code served (permissive licence) · get_code("c072f3a3619491c0")
How it ran

no invocation recorded.

TransformerDecoder Not yet run
unverified (harvested, no recorded run)
594422814/TransformerTrack/ltr/models/target_classifier/transformer.py
code served (permissive licence) · get_code("b5c213461ba61b6f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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.

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

In video object tracking, there exist rich temporal contexts among successive frames, which have been largely overlooked in existing trackers. In this work, we bridge the individual video frames and explore the temporal contexts across them via a transformer architecture for robust object tracking. Different from classic usage of the transformer in natural language processing tasks, we separate its encoder and decoder into two parallel branches and carefully design them within the Siamese-like tracking pipelines. The transformer encoder promotes the target templates via attentionbased feature reinforcement, which benefits the high-quality tracking model generation. The transformer decoder propagates the tracking cues from previous templates to the current frame, which facilitates the object searching process. Our transformer-assisted tracking framework is neat and trained in an end-to-end manner. With the proposed transformer, a simple Siamese matching approach is able to outperform the current top-performing trackers. By combining our transformer with the recent discriminative tracking pipeline, our method sets several new state-of-the-art records on prevalent tracking benchmarks.

For agents

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

get_harvested_code_for_paper("2103.11681")
get_code_for_paper("2103.11681")
have("2103.11681")

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

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

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

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

Connect an agent — have() is free.