SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.03776 · IJCAI · 2022

SparseTT: Visual Tracking with Sparse Transformers

Zehua Fu, Qingjie Liu, Yunhong Wang, Wenrui Cai, Zhihong Fu

arXiv · PDF · Open in the Atlas

Code that ran

3 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 0 have no contract verdict; 3 failures of our instrument; 2 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/2205.03776.json · badge: /api/ran/2205.03776.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
fzh0917/SparseTT community
Papers with Code archive
3 ran · 2 no recorded run
FunctionStatusWhere it lives
_in_projection Ran
ran; our contract draft was wrong, not the code
fzh0917/SparseTT/videoanalyst/model/utils/multi_head_attention_topk.py
code served (permissive licence) · get_code("46a5c304f9496352")
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, ndim 3, 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 torch.nn as nn

torch.manual_seed(0)

# Define dimensions
Eq = 4  # query embedding dimension
Ek = 3  # key embedding dimension
Ev = 5  # value embedding dimension

# Create query, key, value tensors with batch dimension
q = torch.randn(2, Eq)  # shape (batch=2, Eq=4)
k = torch.randn(2, Ek)  # shape (batch=2, Ek=3)
v = torch.randn(2, Ev)  # shape (batch=2, Ev=5)

# Create weight matrices according to the function's shape requirements
w_q = torch.randn(Eq, Eq)  # shape (Eq=4, Eq=4)
w_k = torch.randn(Eq, Ek)  # shape (Eq=4, Ek=3)
w_v = torch.randn(Eq, Ev)  # shape (Eq=4, Ev=5)

# Create optional bias tensors
b_q = torch.randn(Eq)  # shape (Eq=4,)
b_k = torch.randn(Eq)  # shape (Eq=4,)
b_v = torch.randn(Eq)  # shape (Eq=4,)

ARGS = {
    'q': q,
    'k': k,
    'v': v,
    'w_q': w_q,
    'w_k': w_k,
    'w_v': w_v,
    'b_q': b_q,
    'b_k': b_k,
    'b_v': b_v,
}
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, ndim 3, dtype family float — a tuple 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
_in_projection_packed Ran
ran; our contract draft was wrong, not the code
fzh0917/SparseTT/videoanalyst/model/utils/multi_head_attention_topk.py
code served (permissive licence) · get_code("3b431f1271f7e934")
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, ndim 3, 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 torch.nn as nn

torch.manual_seed(0)

# Define tensor dimensions
E = 4  # embedding dimension
batch_size = 2

# Create query, key, value tensors
# Shape: (batch_size, E)
q = torch.randn(batch_size, E)
k = torch.randn(batch_size, E)
v = torch.randn(batch_size, E)

# Create packed weight tensor
# Shape: (E * 3, E) = (12, 4)
w = torch.randn(E * 3, E)

# Create packed bias tensor
# Shape: (E * 3,) = (12,)
b = torch.randn(E * 3)

ARGS = {
    "q": q,
    "k": k,
    "v": v,
    "w": w,
    "b": b,
}
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, ndim 3, dtype family float — a tuple 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
_scaled_dot_product_attention_topk Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
fzh0917/SparseTT/videoanalyst/model/utils/multi_head_attention_topk.py
code served (permissive licence) · get_code("28b1767f6122dd8b")
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 math
import torch
import torch.nn.functional as F
from torch import Tensor
from typing import Optional, Tuple, List

torch.manual_seed(0)

# Set up small tensors for testing
# q: (B, Nt, E) where B=2 (batch), Nt=3 (target seq len), E=4 (embedding dim)
q = torch.randn(2, 3, 4)

# k: (B, Ns, E) where B=2 (batch), Ns=5 (source seq len), E=4 (embedding dim)
k = torch.randn(2, 5, 4)

# v: (B, Ns, E) where B=2 (batch), Ns=5 (source seq len), E=4 (embedding dim)
v = torch.randn(2, 5, 4)

# attn_mask: (B, Nt, Ns) = (2, 3, 5)
attn_mask = torch.zeros(2, 3, 5)

# top_k parameter
top_k = 3

# dropout probability
dropout_p = 0.1

ARGS = {
    "q": q,
    "k": k,
    "v": v,
    "top_k": top_k,
    "attn_mask": attn_mask,
    "dropout_p": dropout_p
}
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
MultiHeadAttentionTopK Not yet run
unverified (harvested, no recorded run)
fzh0917/SparseTT/videoanalyst/model/utils/multi_head_attention_topk.py
code served (permissive licence) · get_code("d396a79efde4c6a4")
How it ran

no invocation recorded.

multi_head_attention_forward_topk Not yet run
unverified (harvested, no recorded run)
fzh0917/SparseTT/videoanalyst/model/utils/multi_head_attention_topk.py
code served (permissive licence) · get_code("4c32f65341cfff95")
How it ran

no invocation recorded.

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, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 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
_in_projection_packed
brick of this paper's assembly: helper
1 other paper
1 later
2207.02206 (2022-07)
Segmenting Moving Objects via an Object-Centric Layered Representation

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

Transformers have been successfully applied to the visual tracking task and significantly promote tracking performance. The self-attention mechanism designed to model long-range dependencies is the key to the success of Transformers. However, self-attention lacks focusing on the most relevant information in the search regions, making it easy to be distracted by background. In this paper, we relieve this issue with a sparse attention mechanism by focusing the most relevant information in the search regions, which enables a much accurate tracking. Furthermore, we introduce a doublehead predictor to boost the accuracy of foregroundbackground classification and regression of target bounding boxes, which further improve the tracking performance. Extensive experiments show that, without bells and whistles, our method significantly outperforms the state-of-the-art approaches on La-SOT, GOT-10k, TrackingNet, and UAV123, while running at 40 FPS. Notably, the training time of our method is reduced by 75% compared to that of TransT. The source code and models are available at https://github.com/fzh0917/SparseTT.

For agents

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

get_harvested_code_for_paper("2205.03776")
get_code_for_paper("2205.03776")
have("2205.03776")

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

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

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

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

Connect an agent — have() is free.