SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2201.04850 · CVPR · 2022

Bridging Video-text Retrieval with Multiple Choice Questions

Yixiao Ge, Ping Luo, Ying Shan, Dian Li, Xiaohu Qie, Xihui Liu, Yuying Ge

arXiv · PDF · Open in the Atlas

Code that ran

13 of 24 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (8 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 4 failures of our instrument; 11 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/2201.04850.json · badge: /api/ran/2201.04850.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
towhee-io/towhee community
Papers with Code archive
11 ran · 7 no recorded run
tencentarc/mcq marked official in Papers with Code
Papers with Code archive
2 ran · 4 no recorded run
FunctionStatusWhere it lives
Conv2d Ran
ran on a synthesized input · constructed an object; no result was computed
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("cf6f823dcb3ac547")
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, Conv2d: 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
from torch import nn

torch.manual_seed(0)

# Conv2d inherits from nn.Conv2d and RelProp
# nn.Conv2d parameters: in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias, padding_mode, device, dtype
# The relprop method uses: self.weight, self.stride, self.padding, self.kernel_size, self.x, self.y
# The gradprop2 method uses conv_transpose2d which needs output_padding calculation

# Minimal valid Conv2d construction:
in_channels = 3
out_channels = 4
kernel_size = 3
stride = 1
padding = 1
dilation = 1
groups = 1
bias = True
padding_mode = 'zeros'

ARGS = {
    'in_channels': in_channels,
    'out_channels': out_channels,
    'kernel_size': kernel_size,
    'stride': stride,
    'padding': padding,
    'dilation': dilation,
    'groups': groups,
    'bias': bias,
    'padding_mode': padding_mode,
}
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 Conv2d — 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 Conv2d 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
CrossAttention Ran
ran on a synthesized input · constructed an object; no result was computed
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("697a1de2168a5a59")
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, CrossAttention: 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
from einops import rearrange, repeat

torch.manual_seed(0)

# Define ARGS dict with all CrossAttention parameters
ARGS = {
    "dim": 8,
    "num_heads": 2,
    "qkv_bias": False,
    "qk_scale": None,
    "attn_drop": 0.1,
    "proj_drop": 0.1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CrossAttention — 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 CrossAttention 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
Dropout Ran
ran on a synthesized input · constructed an object; no result was computed
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("7a61100315c44e2c")
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, Dropout: 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
from torch import nn

torch.manual_seed(0)

# Dropout inherits from nn.Dropout and RelProp
# nn.Dropout.__init__ takes: p (float), inplace (bool)
# RelProp.__init__ takes: nothing (just calls super().__init__())

# Create a simple input tensor for testing
input_tensor = torch.randn(2, 4)

ARGS = {
    'p': 0.5,
    'inplace': False
}
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 Dropout — 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 Dropout 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
Linear Ran
ran on a synthesized input · constructed an object; no result was computed
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("128875f3ef96bf3c")
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, Linear: 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
from torch import nn
import torch.nn.functional as F

torch.manual_seed(0)

# The Linear class inherits from nn.Linear and RelProp
# nn.Linear.__init__ takes: in_features, out_features, bias (optional)
# We need to construct valid arguments for instantiating and using Linear

# Create a Linear layer instance
in_features = 4
out_features = 3
bias = True

linear_layer = nn.Linear(in_features=in_features, out_features=out_features, bias=bias)

# Create input tensor for forward pass (batch_size=2, in_features=4)
x = torch.randn(2, 4, requires_grad=True)

# Create relevance tensor r (same shape as output: batch_size=2, out_features=3)
r = torch.randn(2, 3)

# Alpha parameter for relprop
alpha = 2.0

ARGS = {
    'in_features': in_features,
    'out_features': out_features,
    'bias': bias,
}
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 Linear — 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 Linear 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
Mlp Ran
ran on a synthesized input · constructed an object; no result was computed
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("cbf3c6f7dca35838")
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, Mlp: 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
from torch import nn
import torch.nn.functional as F

torch.manual_seed(0)

class RelProp(nn.Module):
    """
    Rel prop basic class
    """

    def __init__(self):
        super().__init__()
        self.register_forward_hook(forward_hook)

    def gradprop(self, z, x, s):
        c = torch.autograd.grad(z, x, s, retain_graph=True)
        return c

    def relprop(self, r, alpha):
        _ = alpha
        return r

def forward_hook(self, inp, output):
    if type(inp[0]) in (list, tuple):
        self.x = []
        for i in inp[0]:
            x = i.detach()
            x.requires_grad = True
            self.x.append(x)
    else:
        self.x = inp[0].detach()
        self.x.requires_grad = True
    self.y = output

def safe_divide(a, b):
    den = b.clamp(min=1e-09) + b.clamp(max=1e-09)
    den = den + den.eq(0).type(den.type()) * 1e-09
    return a / den * b.ne(0).type(b.type())

class Dropout(nn.Dropout, RelProp):
    pass

class GELU(nn.GELU, RelProp):
    pass

class Linear(nn.Linear, RelProp):
    """
    Linear with rel prop
    """

    def relprop(self, r, alpha):
        beta = alpha - 1
        pw = torch.clamp(self.weight, min=0)
        nw = torch.clamp(self.weight, max=0)
        px = torch.clamp(self.x, min=0)
        nx = torch.clamp(self.x, max=0)

        def f(w1, w2, x1, x2):
            z1 = F.linear(x1, w1)
            z2 = F.linear(x2, w2)
            s1 = safe_divide(r, z1 + z2)
            s2 = safe_divide(r, z1 + z2)
            c1 = x1 * torch.autograd.grad(z1, x1, s1)[0]
            c2 = x2 * torch.autograd.grad(z2, x2, s2)[0]
            return c1 + c2
        activator_relevances = f(pw, nw, px, nx)
        inhibitor_relevances = f(nw, pw, px, nx)
        r = alpha * activator_relevances - beta * inhibitor_relevances
        return r

class Mlp(nn.Module):
    """
    MLP module w/ dropout and configurable activation layer,
    as used in Vision Transformer, MLP-Mixer and related networks.

    Args:
        - in_features (`int`):
            Number of input features.
        - hidden_features (`int`):
            Number of hidden features.
        - out_features (`int`):
            Number of output features.
        - act_layer (`nn.Module`):
            Activation layer.
        - drop (`float`):
            Dropout rate.

    Example:
        >>> import torch
        >>> from towhee.models.layers.mlp import Mlp
        >>>
        >>> fake_input = torch.rand(1, 4)
        >>> layer = Mlp(in_features=4, hidden_features=6, out_features=8)
        >>> output = layer(fake_input)
        >>> print(output.shape)
        torch.Size([1, 8])
    """

    def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=GELU, drop=0.0):
        super().__init__()
        out_features = out_features or in_features
        hidden_features = hidden_features or in_features
        self.fc1 = Linear(in_features=in_features, out_features=hidden_features)
        self.act = act_layer()
        self.fc2 = Linear(in_features=hidden_features, out_features=out_features)
        self.drop = Dropout(p=drop)

    def forward(self, x):
        x = self.fc1(x)
        x = self.act(x)
        x = self.drop(x)
        x = self.fc2(x)
        x = self.drop(x)
        return x

    def relprop(self, cam, **kwargs):
        cam = self.drop.relprop(cam, **kwargs)
        cam = self.fc2.relprop(cam, **kwargs)
        cam = self.act.relprop(cam, **kwargs)
        cam = self.fc1.relprop(cam, **kwargs)
        return cam

ARGS = {
    "in_features": 4,
    "hidden_features": 8,
    "out_features": 3,
    "act_layer": GELU,
    "drop": 0.1,
}
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 Mlp — 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 Mlp 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
RelProp Ran
ran on a synthesized input · constructed an object; no result was computed
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("ec2435de7b9ac8aa")
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, RelProp: 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
from torch import nn

torch.manual_seed(0)

class DummyModel(nn.Module):
    """Minimal model to test RelProp"""
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal RelProp instance
model = DummyModel()

# The __init__ method takes no arguments (besides self)
# So ARGS should be an empty dict since RelProp() takes no parameters
ARGS = {}
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 RelProp — 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 RelProp 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
SpatialTemporalClsPositionalEncoding Ran
ran on a synthesized input · constructed an object; no result was computed
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("42c5469c00c98d39")
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, SpatialTemporalClsPositionalEncoding: 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)

# Define arguments for SpatialTemporalClsPositionalEncoding
embed_dim = 4
patch_embed_shape = (2, 3, 5)  # (T, H, W) - distinct sizes for clarity
sep_pos_embed = False
has_cls = True

ARGS = {
    "embed_dim": embed_dim,
    "patch_embed_shape": patch_embed_shape,
    "sep_pos_embed": sep_pos_embed,
    "has_cls": has_cls,
}
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 SpatialTemporalClsPositionalEncoding — 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 SpatialTemporalClsPositionalEncoding 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
VarAttention Ran
ran on a synthesized input · constructed an object; no result was computed
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("99880b32f1ae367a")
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, VarAttention: 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
from einops import rearrange, repeat

torch.manual_seed(0)

# Create test tensors for the forward pass
batch_size = 2
seq_len = 5
dim = 8
num_heads = 2

# Create input tensor: (batch, seq_len, dim)
x = torch.randn(batch_size, seq_len, dim)

# Create mask tensor: (batch, seq_len)
mask = torch.ones(batch_size, seq_len)

# whether parameter - boolean flag
whether = True

# einops_from and einops_to - strings describing tensor rearrangement
einops_from = '(b h) (f n) d'
einops_to = 'b f n (h d)'

# einops_dims - dict with dimension parameters for einops rearrangement
einops_dims = {
    'b': batch_size,
    'h': num_heads,
    'f': 2,
    'n': 2,
    'd': dim // num_heads
}

ARGS = {
    'dim': dim,
    'num_heads': num_heads,
    'qkv_bias': False,
    'qk_scale': None,
    'attn_drop': 0.0,
    'proj_drop': 0.0,
    'initialize': 'random'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type VarAttention — 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 VarAttention 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
VideoPatchEmbed Ran
ran on a synthesized input
tencentarc/mcq/model/video_bridge_former.py
pointer only (licence: NONE) · get_code("60f628ac6897aacf")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, tencentarc/mcq 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.

_ntuple Ran
ran; our contract draft was wrong, not the code
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("0ef9a056059a14d9")
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 function. 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 numpy as np
from einops import rearrange, repeat
from typing import Callable
import collections.abc

torch.manual_seed(0)

ARGS = {
    "n": 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
attn Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("19f4493dcaecc931")
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 3, dtype family float, shape (2, 4, 6) 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)

# The function attn expects q, k, v to be tensors
# From the einsum operations:
# - q: shape (b, i, d) - batch, sequence length, dimension
# - k: shape (b, j, d) - batch, sequence length, dimension
# - v: shape (b, j, d) - batch, sequence length, dimension
# where i and j are sequence positions (can be different)

batch_size = 2
seq_len_q = 4
seq_len_kv = 5
d_model = 6

q = torch.randn(batch_size, seq_len_q, d_model)
k = torch.randn(batch_size, seq_len_kv, d_model)
v = torch.randn(batch_size, seq_len_kv, d_model)

ARGS = {
    'q': q,
    'k': k,
    'v': 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 Tensor, ndim 3, dtype family float, shape (2, 4, 6) — shape (2, 4, 6) 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
attn_mask Ran
ran; our contract draft was wrong, not the code
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("caf8d3ee2ad34af5")
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 3, dtype family float, shape (2, 3, 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 torch
from einops import rearrange, repeat

torch.manual_seed(0)

# Analyze the function:
# - q: used in einsum 'b i d', so shape (batch, seq_len_q, dim)
# - k: used in einsum 'b j d', so shape (batch, seq_len_k, dim)
# - v: used in einsum 'b j d', so shape (batch, seq_len_v, dim)
# - mask: used as (1.0 - mask) and repeat with 'b d -> b r d', so shape (batch, dim)
#   where dim should match seq_len_k (the j dimension)

batch_size = 2
seq_len_q = 3
seq_len_k = 4
dim = 5

q = torch.randn(batch_size, seq_len_q, dim)
k = torch.randn(batch_size, seq_len_k, dim)
v = torch.randn(batch_size, seq_len_k, dim)
# mask shape (b, d) where d matches seq_len_k for the repeat operation
mask = torch.randint(0, 2, (batch_size, seq_len_k)).float()

ARGS = {
    'q': q,
    'k': k,
    'v': v,
    'mask': mask
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, 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 (2, 3, 5) — shape (2, 3, 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
attn_mask Ran
ran; our contract draft was wrong, not the code
tencentarc/mcq/model/video_bridge_former.py
pointer only (licence: NONE) · get_code("a3bdf83b03800368")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, tencentarc/mcq 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.

CrossAttention Not yet run
unverified (harvested, no recorded run)
tencentarc/mcq/model/video_bridge_former.py
pointer only (licence: NONE) · get_code("fe726d5b3aa825e3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, tencentarc/mcq 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. No invocation recorded.

GELU Not yet run
unverified (harvested, no recorded run)
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("44c7199b24a33141")
How it ran

no invocation recorded.

PatchEmbed2D Not yet run
unverified (harvested, no recorded run)
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("830af90036b9557c")
How it ran

no invocation recorded.

VarAttention Not yet run
unverified (harvested, no recorded run)
tencentarc/mcq/model/video_bridge_former.py
pointer only (licence: NONE) · get_code("e89ee5db86ca051f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, tencentarc/mcq 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. No invocation recorded.

VideoBridgeBlock Not yet run
unverified (harvested, no recorded run)
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("aff6dc9eb36e5314")
How it ran

no invocation recorded.

VideoBridgeFormer Not yet run
unverified (harvested, no recorded run)
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("395f0de4af2bbeea")
How it ran

no invocation recorded.

Video_Bridge_Block Not yet run
unverified (harvested, no recorded run)
tencentarc/mcq/model/video_bridge_former.py
pointer only (licence: NONE) · get_code("b10786c62626a38c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, tencentarc/mcq 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. No invocation recorded.

Video_Bridge_Former Not yet run
unverified (harvested, no recorded run)
tencentarc/mcq/model/video_bridge_former.py
pointer only (licence: NONE) · get_code("7e4f19b9162746fd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, tencentarc/mcq 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. No invocation recorded.

init_vit_weights Not yet run
unverified (harvested, no recorded run)
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("5fc693caf332e5ae")
How it ran

no invocation recorded.

lecun_normal_ Not yet run
unverified (harvested, no recorded run)
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("d90854b3e1f1b595")
How it ran

no invocation recorded.

variance_scaling_ Not yet run
unverified (harvested, no recorded run)
towhee-io/towhee/towhee/models/bridgeformer/bridge_former_training_block.py
code served (permissive licence) · get_code("f654a0a29887209b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 24 samples lifted from this paper's linked repositories, 24 carry a function identity and 0 do not. Of the 24 distinct functions with an identity, 12 are also present in other papers whose code we hold (11 with at least one paper dated earlier, 6 the same month, 2 later) and 12 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
lecun_normal_
brick of this paper's assembly: helper
4 other papers
1 dated earlier, 3 later
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2204.03645 (2022-04)
DaViT: Dual Attention Vision Transformers
2204.07683 (2022-04)
Safe Self-Refinement for Transformer-based Domain Adaptation
and 1 more not named here
RelProp
brick of this paper's assembly: helper
3 other papers
2 dated earlier, 1 the same month · 2 only as an assembly brick
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2104.11227 (2021-04)
Multiscale Vision Transformers
2201.04676 (2022-01)
UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning
variance_scaling_
brick of this paper's assembly: helper
3 other papers
1 dated earlier, 2 later
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2204.03645 (2022-04)
DaViT: Dual Attention Vision Transformers
2204.07683 (2022-04)
Safe Self-Refinement for Transformer-based Domain Adaptation
Conv2d
brick of this paper's assembly: helper
2 other papers
2 dated earlier · 1 only as an assembly brick
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2104.11227 (2021-04)
Multiscale Vision Transformers
Dropout
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 the same month · 1 only as an assembly brick
2104.11227 (2021-04)
Multiscale Vision Transformers
2201.04676 (2022-01)
UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning
GELU
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 the same month · 1 only as an assembly brick
2104.11227 (2021-04)
Multiscale Vision Transformers
2201.04676 (2022-01)
UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning
Linear
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 the same month · 1 only as an assembly brick
2104.11227 (2021-04)
Multiscale Vision Transformers
2201.04676 (2022-01)
UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning
_ntuple
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 the same month · 1 only as an assembly brick
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2201.04676 (2022-01)
UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning
Mlp
brick of this paper's assembly: helper
1 other paper
1 the same month
2201.04676 (2022-01)
UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning
PatchEmbed2D
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
SpatialTemporalClsPositionalEncoding
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
init_vit_weights
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows

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

VideoFormer "A girl in shorts and a hat is [?] on the [?]" TextFormer "dancing" "laying"  "talking"  "green grass"  "stage"  "beach"  BridgeFormer 𝐾, 𝑉 𝐹 𝑀 𝑄 𝐹 2 𝐹 1 Noun question Verb question Verb answer Noun answer MCQ Remove for retrieval 𝑄 Figure 1. Overview of our novel pretext task, Multiple Choice Questions (MCQ), for video-text pre-training. MCQ is performed using a newly-proposed parametric module BridgeFormer, which associates all-level local features (intermediate tokens) from VideoFormer and TextFormer to answer multiple choice questions in the form of contrastive learning. Given that nouns and verbs carry informative local objects and object motions, we construct a noun question (in yellow) and a verb question (in red) by erasing the corresponding phrase from the sentence. The BridgeFormer is trained to select the correct erased phrase via visual reasoning with intermediate tokens from VideoFormer, given the questions' intermediate tokens from TextFormer. The noun and verb questions promote VideoFormer to capture detailed spatial content and temporal information. The semantic associations between video-text intermediate tokens are also enhanced via the proxy task of questions and answers. Note that BridgeFormer is removed for downstream retrieval.

For agents

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

get_harvested_code_for_paper("2201.04850")
get_code_for_paper("2201.04850")
have("2201.04850")

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

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

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

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

Connect an agent — have() is free.