SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.13911 · NeurIPS · 2024

TOPA: Extending Large Language Models for Video Understanding via Text-Only Pre-Alignment

Yi Yang, Mohan Kankanhalli, Wei Li, Yongkang Wong, Hehe Fan

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 (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 3 have no contract verdict; 2 failures of our instrument; 3 no recorded run), measured 2026-11-24; 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/2405.13911.json · badge: /api/ran/2405.13911.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
dhg-wei/topa marked official in Papers with Code
Papers with Code archive
3 ran · 3 no recorded run
copy not recorded community
not in the paper's declared repositories
3 ran · 0 no recorded run
FunctionStatusWhere it lives
FeedForward Ran
ran on a synthesized input · constructed an object; no result was computed
dhg-wei/topa/llama/model.py
code served (permissive licence) · get_code("24ac4d693325d0c3")
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, FeedForward: 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)

# The FeedForward class takes three parameters: dim, hidden_dim, and multiple_of
# These are all integers used to configure the linear layers

ARGS = {
    "dim": 64,
    "hidden_dim": 128,
    "multiple_of": 8,
}
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 FeedForward — 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 FeedForward 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
ModelArgs Ran
ran on a synthesized input · constructed an object; no result was computed
dhg-wei/topa/llama/model.py
code served (permissive licence) · get_code("6494643accfe49c7")
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, ModelArgs: 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 dataclasses import dataclass

torch.manual_seed(0)

@dataclass
class ModelArgs:
    dim: int = 512
    n_layers: int = 8
    n_heads: int = 8
    vocab_size: int = -1
    multiple_of: int = 256
    norm_eps: float = 1e-05
    n_kv_heads: int = 1
    max_batch_size: int = 32
    max_seq_len: int = 2048
    adapter_len: int = 10
    adapter_layer: int = 30

ARGS = {
    "dim": 512,
    "n_layers": 8,
    "n_heads": 8,
    "vocab_size": 1000,
    "multiple_of": 256,
    "norm_eps": 1e-05,
    "n_kv_heads": 1,
    "max_batch_size": 32,
    "max_seq_len": 2048,
    "adapter_len": 10,
    "adapter_layer": 30,
}
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 ModelArgs — 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 ModelArgs 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
RMSNorm Ran
ran on a synthesized input · constructed an object; no result was computed
dhg-wei/topa/llama/model.py
code served (permissive licence) · get_code("df852b6b3526e46e")
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, RMSNorm: 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)

# RMSNorm takes two parameters: dim (int) and eps (float)
# From the forward pass, we can see:
# - x is a tensor that gets normalized
# - self.weight is a parameter of shape (dim,) that multiplies the output
# We need to construct valid inputs

dim = 4
eps = 1e-06

# Create a small input tensor for testing
# Shape: (batch_size, sequence_length, dim) - typical transformer shape
x = torch.randn(2, 3, dim)

ARGS = {
    "dim": dim,
    "eps": eps,
}
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 RMSNorm — 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 RMSNorm 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
apply_rotary_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from meituan-automl/visionllama
pointer only; the stored copy get_code serves, from meituan-automl/visionllama, is pointer only (licence: NONE) · get_code("b47d48e431b34acd")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

precompute_freqs_cis Ran
ran, violated the contract we drafted
this paper's copy was not recorded; identical code first harvested from meituan-automl/visionllama
pointer only; the stored copy get_code serves, from meituan-automl/visionllama, is pointer only (licence: NONE) · get_code("14a84c2cbfebc413")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

reshape_for_broadcast Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from alpha-vllm/llama2-accessory
pointer only; the stored copy get_code serves, from alpha-vllm/llama2-accessory, is pointer only (licence: NOASSERTION) · get_code("70bf6ebaafd266c4")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

Attention Not yet run
unverified (harvested, no recorded run)
dhg-wei/topa/llama/model.py
code served (permissive licence) · get_code("e4aee67fbc499c70")
How it ran

no invocation recorded.

Transformer Not yet run
unverified (harvested, no recorded run)
dhg-wei/topa/llama/model.py
code served (permissive licence) · get_code("530c00f584968555")
How it ran

no invocation recorded.

TransformerBlock Not yet run
unverified (harvested, no recorded run)
dhg-wei/topa/llama/model.py
code served (permissive licence) · get_code("36f60efcf15f5bc6")
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, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 3 the same month, 4 later) and 3 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
reshape_for_broadcast
brick of this paper's assembly: helper
58 other papers
29 dated earlier, 3 the same month, 26 later · 2 only as an assembly brick
2023.emnlp-main.534 (2023 (year only))
Disentangling Transformer Language Models as Superposed Topic Models
2303.09736 (2023-03)
Dynamic Structure Pruning for Compressing CNNs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 55 more not named here
apply_rotary_emb
brick of this paper's assembly: helper
55 other papers
25 dated earlier, 3 the same month, 27 later · 1 only as an assembly brick
2023.emnlp-main.534 (2023 (year only))
Disentangling Transformer Language Models as Superposed Topic Models
2303.09736 (2023-03)
Dynamic Structure Pruning for Compressing CNNs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 52 more not named here
precompute_freqs_cis
brick of this paper's assembly: helper
47 other papers
25 dated earlier, 3 the same month, 19 later · 1 only as an assembly brick
2023.emnlp-main.534 (2023 (year only))
Disentangling Transformer Language Models as Superposed Topic Models
2303.09736 (2023-03)
Dynamic Structure Pruning for Compressing CNNs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 44 more not named here
RMSNorm
brick of this paper's assembly: model
5 other papers
1 dated earlier, 4 later · 3 only as an assembly brick
2310.15747 (2023-10)
Large Language Models are Temporal and Causal Reasoners for Video Question Answering
2410.10356 (2024-10)
FasterDiT: Towards Faster Diffusion Transformers Training without Architecture Modification
2602.04680 (2026-02)
Audio ControlNet for Fine-Grained Audio Generation and Editing
and 2 more not named here
FeedForward
brick of this paper's assembly: model
1 other paper
1 dated earlier · 1 only as an assembly brick
2310.15747 (2023-10)
Large Language Models are Temporal and Causal Reasoners for Video Question Answering
TransformerBlock
brick of this paper's assembly: model
1 other paper
1 dated earlier
2310.15747 (2023-10)
Large Language Models are Temporal and Causal Reasoners for Video Question Answering

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

Repositories linked to this paper

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

Abstract

Recent advancements in image understanding have benefited from the extensive use of web image-text pairs. However, video understanding remains a challenge despite the availability of substantial web video-text data. This difficulty primarily arises from the inherent complexity of videos and the inefficient language supervision in recent web-collected video-text datasets. In this paper, we introduce Text-Only Pre-Alignment (TOPA), a novel approach to extend large language models (LLMs) for video understanding, without the need for pre-training on real video data. Specifically, we first employ an advanced LLM to automatically generate Textual Videos comprising continuous textual frames, along with corresponding annotations to simulate real video-text pairs. Then, these annotated textual videos are used to pre-align language-only LLMs with the video modality. To bridge the gap between textual and real videos, we employ the CLIP model as the feature extractor to align image and text modalities. During text-only pre-alignment, the continuous textual frames, encoded as a sequence of CLIP text features, are analogous to continuous CLIP image features, thus aligning the LLM with real video representation. Extensive experiments, including zero-shot evaluation and finetuning on various video understanding tasks, demonstrate that TOPA is an effective and efficient framework for aligning video modality with LLMs. In particular, without training on any video data, the TOPA-Llama2-13B model achieves a Top-1 accuracy of 51.0% on the challenging long-form video understanding benchmark, EgoSchema. This performance surpasses previous video-text pre-training approaches and is competitive with recent GPT-3.5-based video agents. Vision-language alignment. CLIP [48] aligns the vision and language modalities in a common feature space via contrastive learning with large-scale web image-text data. MLLMs [1,27,34,89] align the visual model with LLM via training on image-caption pairs and interleaved image-text data. 23,32,83] explore modeling video sequences within LLM spaces, leveraging LLM for video-language understanding. In this paper, we focus on video-LLM alignment. Rather than using multimodal data for vision-language alignment, we introduce a novel text-only pre-alignment framework to extend LLMs for video understanding without pre-training on real video-text data. LLMs for multimodal data augmentation. Recent research explores the use of LLMs to enhance the multimodal data. A line of work [5,12,34] use LLMs for refining captions or extending the image caption pairs to diverse visual tasks like visual conversation and image editing. Another line of work [28,37,38,47] further employ advanced LLM to enrich web video supervision for video instruction tuning. In this paper, rather than enhancing multimodal datasets, we propose generating text-only data consisting of "textual videos" and diverse language supervision, which aims to simulate real videos and their corresponding annotations. Long-form video understanding. 61,71] presents significant challenges due to the intricate spatial and temporal dynamics. Conventional video-text pretraining approaches [4,45,65,66,77,90] utilize extensive web video-caption data for video-language alignment.

For agents

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

get_harvested_code_for_paper("2405.13911")
get_code_for_paper("2405.13911")
have("2405.13911")

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

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

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

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

Connect an agent — have() is free.