SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2304.03307 · CVPR · 2023

Vita-CLIP: Video and text adaptive CLIP via Multimodal Prompting

Mubarak Shah, Muzammal Naseer, Salman Khan, Shahbaz Fahad, Khan, Syed Wasim

arXiv · PDF · Open in the Atlas

Code that ran

5 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; 0 failures of our instrument; 4 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/2304.03307.json · badge: /api/ran/2304.03307.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
TalalWasim/Vita-CLIP community
Papers with Code archive
5 ran · 4 no recorded run
FunctionStatusWhere it lives
Attention Ran
ran on a synthesized input · constructed an object; no result was computed
TalalWasim/Vita-CLIP/training/VitaCLIP_model.py
code served (permissive licence) · get_code("a56eadb4eb339fa4")
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, Attention: 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)

ARGS = {
    "q_in_dim": 8,
    "k_in_dim": 10,
    "v_in_dim": 12,
    "qk_proj_dim": 16,
    "v_proj_dim": 12,
    "num_heads": 4,
    "out_dim": 6,
}
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 Attention — 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 Attention 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
CLIPTextEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
TalalWasim/Vita-CLIP/training/VitaCLIP_model.py
code served (permissive licence) · get_code("f3a723388670dcd6")
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, CLIPTextEncoder: 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)

# For CLIPTextEncoder forward pass, we need:
# 1. prompts: tensor of shape (batch_size, context_length, transformer_width) with token embeddings
# 2. tokenized_prompts: tensor of shape (batch_size, context_length) with argmax indices
# 3. maple_prompts: optional list of tensors for maple prompt injection

batch_size = 2
context_length = 77
embed_dim = 512
transformer_width = 512
transformer_heads = 8
transformer_layers = 12
vocab_size = 49408

# Create prompts: token embeddings of shape (batch_size, context_length, transformer_width)
prompts = torch.randn(batch_size, context_length, transformer_width)

# Create tokenized_prompts: indices for argmax operation, shape (batch_size, context_length)
# We need argmax to point to valid indices in the sequence
tokenized_prompts = torch.zeros(batch_size, context_length, dtype=torch.long)
tokenized_prompts[:, -1] = torch.arange(batch_size)  # Make sure argmax returns valid indices

# Create maple_prompts: optional list of prompts for transformer layers
# maple_prompts is used in transformer.forward when provided
# It's indexed as maple_prompts[i-1] for layers i > 0
# Each should have shape compatible with expansion and permutation
maple_prompts = [
    torch.randn(3, transformer_width) for _ in range(transformer_layers - 1)
]

ARGS = {
    'embed_dim': embed_dim,
    'context_length': context_length,
    'vocab_size': vocab_size,
    'transformer_width': transformer_width,
    'transformer_heads': transformer_heads,
    'transformer_layers': transformer_layers,
}
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 CLIPTextEncoder — 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 CLIPTextEncoder 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
ImagePatchEmbed2D Ran
ran on a synthesized input · constructed an object; no result was computed
TalalWasim/Vita-CLIP/training/VitaCLIP_model.py
code served (permissive licence) · get_code("1a832e4c6c8b2f46")
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, ImagePatchEmbed2D: 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)

ARGS = {
    "img_size": 224,
    "patch_size": 16,
    "in_chans": 3,
    "embed_dim": 768,
}
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 ImagePatchEmbed2D — 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 ImagePatchEmbed2D 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
Transformer Ran
ran on a synthesized input · constructed an object; no result was computed
TalalWasim/Vita-CLIP/training/VitaCLIP_model.py
code served (permissive licence) · get_code("00dbc8b2c1c18083")
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, Transformer: 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 collections import OrderedDict

torch.manual_seed(0)

class LayerNorm(nn.LayerNorm):
    """Subclass torch's LayerNorm to handle fp16."""

    def forward(self, x: torch.Tensor):
        orig_type = x.dtype
        ret = super().forward(x.type(torch.float32))
        return ret.type(orig_type)

class QuickGELU(nn.Module):

    def forward(self, x: torch.Tensor):
        return x * torch.sigmoid(1.702 * x)

class ResidualAttentionBlock(nn.Module):

    def __init__(self, d_model: int, n_head: int, attn_mask: torch.Tensor=None):
        super().__init__()
        self.attn = nn.MultiheadAttention(d_model, n_head)
        self.ln_1 = LayerNorm(d_model)
        self.mlp = nn.Sequential(OrderedDict([('c_fc', nn.Linear(d_model, d_model * 4)), ('gelu', QuickGELU()), ('c_proj', nn.Linear(d_model * 4, d_model))]))
        self.ln_2 = LayerNorm(d_model)
        self.attn_mask = attn_mask

    def attention(self, x: torch.Tensor):
        self.attn_mask = self.attn_mask.to(dtype=x.dtype, device=x.device) if self.attn_mask is not None else None
        return self.attn(x, x, x, need_weights=False, attn_mask=self.attn_mask)[0]

    def forward(self, x: torch.Tensor):
        x = x + self.attention(self.ln_1(x))
        x = x + self.mlp(self.ln_2(x))
        return x

class Transformer(nn.Module):

    def __init__(self, width: int, layers: int, heads: int, attn_mask: torch.Tensor=None):
        super().__init__()
        self.width = width
        self.layers = layers
        self.resblocks = nn.ModuleList([ResidualAttentionBlock(width, heads, attn_mask) for _ in range(layers)])

    def forward(self, x: torch.Tensor, maple_prompts=None):
        if maple_prompts:
            num_prompts = maple_prompts[0].shape[0]
            for i, blk in enumerate(self.resblocks):
                if i == 0:
                    x = blk(x)
                else:
                    prefix = x[:1, :, :]
                    suffix = x[1 + num_prompts:, :, :]
                    textual_context = maple_prompts[i - 1]
                    textual_context = textual_context.expand(x.shape[1], -1, -1).permute(1, 0, 2)
                    x = torch.cat([prefix, textual_context, suffix], dim=0)
                    x = blk(x)
        else:
            for blk in self.resblocks:
                x = blk(x)
        return x

width = 4
layers = 2
heads = 2
attn_mask = None

ARGS = {
    'width': width,
    'layers': layers,
    'heads': heads,
    'attn_mask': attn_mask
}
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 Transformer — 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 Transformer 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
TalalWasim/Vita-CLIP/training/VitaCLIP_model.py
code served (permissive licence) · get_code("efd12a8a6dd436d0")
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
from typing import Tuple

torch.manual_seed(0)

# Define the required classes that are used in TransformerEncoderLayer
class QuickGELU(nn.Module):
    def forward(self, x: torch.Tensor):
        return x * torch.sigmoid(1.702 * x)

# Create ARGS dict with all parameters for TransformerEncoderLayer
ARGS = {
    'in_feature_dim': 64,
    'qkv_dim': 64,
    'num_heads': 4,
    'mlp_factor': 4.0,
    'mlp_dropout': 0.1,
    'act': QuickGELU,
    'use_summary_token': False,
    'use_local_prompts': False,
    'num_frames': 8,
    'patch_size': (16, 16),
}
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
CLIPVisionEncoder Not yet run
unverified (harvested, no recorded run)
TalalWasim/Vita-CLIP/training/VitaCLIP_model.py
code served (permissive licence) · get_code("361eae115fda48da")
How it ran

no invocation recorded.

TextPromptLearner Not yet run
unverified (harvested, no recorded run)
TalalWasim/Vita-CLIP/training/VitaCLIP_model.py
code served (permissive licence) · get_code("e44ed626654a81f6")
How it ran

no invocation recorded.

VitaCLIP Not yet run
unverified (harvested, no recorded run)
TalalWasim/Vita-CLIP/training/VitaCLIP_model.py
code served (permissive licence) · get_code("fece7e5714da3475")
How it ran

no invocation recorded.

tokenize Not yet run
unverified (harvested, no recorded run)
TalalWasim/Vita-CLIP/training/VitaCLIP_model.py
code served (permissive licence) · get_code("65edded4bd70a9ab")
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

Adopting contrastive image-text pretrained models like CLIP towards video classification has gained attention due to its cost-effectiveness and competitive performance. However, recent works in this area face a trade-off. Finetuning the pretrained model to achieve strong supervised performance results in low zero-shot generalization. Similarly, freezing the backbone to retain zero-shot capability causes significant drop in supervised accuracy. Because of this, recent works in literature typically train separate models for supervised and zero-shot action recognition. In this work, we propose a multimodal prompt learning scheme that works to balance the supervised and zero-shot performance under a single unified training. Our prompting approach on the vision side caters for three aspects: 1) Global video-level prompts to model the data distribution; 2) Local frame-level prompts to provide per-frame discriminative conditioning; and 3) a summary prompt to extract a condensed video representation. Additionally, we define a prompting scheme on the text side to augment the textual context. Through this prompting scheme, we can achieve state-of-the-art zero-shot performance on Kinetics-600, HMDB51 and UCF101 while remaining competitive in the supervised setting. By keeping the pretrained backbone frozen, we optimize a much lower number of parameters and retain the existing general representation which helps achieve the strong zeroshot performance. Our codes/models will be released at https://github.com/TalalWasim/Vita-CLIP..

For agents

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

get_harvested_code_for_paper("2304.03307")
get_code_for_paper("2304.03307")
have("2304.03307")

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

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

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

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

Connect an agent — have() is free.