SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.21264 · ICLR · 2024

LARP: Tokenizing Videos with a Learned Autoregressive Generative Prior

Hao Chen, Hanyu Wang, Yixuan Ren, Abhinav Shrivastava, Saksham Suri, Larp Decoder

arXiv · PDF · Open in the Atlas

Code that ran

11 of 13 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; 2 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2410.21264.json · badge: /api/ran/2410.21264.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
hywang66/LARP community (classifier label)
classifier basis not recorded on the link
11 ran · 2 no recorded run
FunctionStatusWhere it lives
drop_path Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hywang66/LARP/models/larp_ar.py
code served (permissive licence) · get_code("87577b3ff9d32712")
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) and returned Tensor, ndim 4, dtype family float, shape (2, 3, 4, 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

torch.manual_seed(0)

# Create a small tensor with batch size 2 and 4 dimensions
x = torch.randn(2, 3, 4, 5)

# Define all parameters for drop_path
ARGS = {
    "x": x,
    "drop_prob": 0.5,
    "training": True,
    "scale_by_keep": True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 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
entropy_loss Ran
ran on a synthesized input
hywang66/LARP/models/bottleneck.py
code served (permissive licence) · get_code("b4701e8bb46ce4c9")
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 1, 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.functional as F

torch.manual_seed(0)

# Create a small affinity tensor
# Shape: (batch_size, num_classes) where batch=2, num_classes=4
affinity = torch.randn(2, 4)

# Define ARGS dict with all parameters
ARGS = {
    'affinity': affinity,
    'loss_type': 'softmax',
    'temperature': 0.01
}
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 1, 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
find_multiple Ran
ran, honoured the contract we drafted
hywang66/LARP/models/larp_ar.py
code served (permissive licence) · get_code("f6ff7671338c9c92")
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 int, ndim 0, dtype family int, shape () 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
import numpy as np

torch.manual_seed(0)

# Analyze the function: find_multiple(n: int, k: int)
# The function takes two integers and returns an integer
# It checks if n is divisible by k, and if not, rounds n up to the next multiple of k

ARGS = {
    "n": 10,
    "k": 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () 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
get_2d_sincos_pos_embed Ran
ran, honoured the contract we drafted
hywang66/LARP/models/embed.py
code served (permissive licence) · get_code("17acd1617dd8a808")
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 ndarray, ndim 2, dtype family float, shape (18, 8) 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 numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Define arguments for get_2d_sincos_pos_embed
ARGS = {
    "embed_dim": 8,
    "grid_size": 4,
    "cls_token": True,
    "extra_tokens": 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (18, 8) — shape (18, 8) 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
get_3d_sincos_pos_embed Ran
ran on a synthesized input
hywang66/LARP/models/embed.py
code served (permissive licence) · get_code("e8364ecd23bce54d")
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 ndarray, ndim 2, dtype family float, shape (48, 8) 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 numpy as np

ARGS = {
    "embed_dim": 8,
    "grid_size": 4,
    "frame_num": 3,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (48, 8) — shape (48, 8) 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
get_optimizer_parameter_set Ran
ran on a synthesized input
hywang66/LARP/trainers/larp_tokenizer_trainer.py
code served (permissive licence) · get_code("f158589f38e59deb")
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 set. 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 torch.optim import SGD

torch.manual_seed(0)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        return self.linear2(self.linear1(x))

# Instantiate model
model = SimpleModel()

# Create an optimizer with the model parameters
optimizer = SGD(model.parameters(), lr=0.01)

ARGS = {
    'optimizer': optimizer
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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_orig_module Ran
ran on a synthesized input
hywang66/LARP/models/larp_tokenizer.py
code served (permissive licence) · get_code("1bc068182cddc396")
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 InnerModule. 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)

# Test case 1: Module with 'module' attribute (e.g., DataParallel wrapper)
class InnerModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

class WrappedModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.module = InnerModule()
    
    def forward(self, x):
        return self.module(x)

# Test case 2: Module with '_orig_mod' attribute (e.g., compiled module)
class CompiledModule(nn.Module):
    def __init__(self):
        super().__init__()
        self._orig_mod = InnerModule()
    
    def forward(self, x):
        return self._orig_mod(x)

# Test case 3: Plain module with no wrapping
plain_module = InnerModule()

# Test case 4: Module with both attributes (module takes precedence)
class BothWrapped(nn.Module):
    def __init__(self):
        super().__init__()
        self.module = InnerModule()
        self._orig_mod = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.module(x)

ARGS = {
    'module': WrappedModule()
}
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 InnerModule — a InnerModule output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a InnerModule 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
hinge_d_loss Ran
ran; our contract draft was wrong, not the code
hywang66/LARP/models/loss.py
pointer only (licence: MIT); the stored copy get_code serves, from joanrod/ocr-vqgan, is pointer only (licence: NONE) · get_code("22a83df891d750c6")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from joanrod/ocr-vqgan, and GitHub detected no licence in that repository 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.

lecam_reg Ran
ran on a synthesized input
hywang66/LARP/models/loss.py
code served (permissive licence) · get_code("9260cf8e6d12812c")
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 0, dtype family float, shape () 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)

# Based on the function signature and body, all parameters should be scalar tensors
# The function checks that real_pred and ema_fake_pred have ndim == 0 (scalars)
# and performs relu and pow operations on them, then takes means

real_pred = torch.tensor(0.5)
fake_pred = torch.tensor(0.3)
ema_real_pred = torch.tensor(0.4)
ema_fake_pred = torch.tensor(0.2)

ARGS = {
    "real_pred": real_pred,
    "fake_pred": fake_pred,
    "ema_real_pred": ema_real_pred,
    "ema_fake_pred": ema_fake_pred,
}
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 0, dtype family float, shape () — shape () 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
r1_gradient_penalty Ran
ran on a synthesized input
hywang66/LARP/models/loss.py
code served (permissive licence) · get_code("4ba231e52b8114c1")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.autograd as autograd

torch.manual_seed(0)

# Create a simple discriminator that takes video input and outputs a scalar
class SimpleDiscriminator(nn.Module):
    def __init__(self, input_dim):
        super().__init__()
        self.linear1 = nn.Linear(input_dim, 16)
        self.linear2 = nn.Linear(16, 1)
    
    def forward(self, x):
        # x shape: (batch_size, channels, height, width) or similar
        batch_size = x.size(0)
        x_flat = x.view(batch_size, -1)
        x = torch.relu(self.linear1(x_flat))
        out = self.linear2(x)
        return out

# Create real video tensor: batch_size=2, channels=3, height=4, width=4
batch_size = 2
channels = 3
height = 4
width = 4
real_video = torch.randn(batch_size, channels, height, width)

# Create discriminator
input_dim = channels * height * width
discriminator = SimpleDiscriminator(input_dim)

# Set to eval mode to ensure consistent behavior
discriminator.eval()

ARGS = {
    "discriminator": discriminator,
    "real_video": real_video,
    "penalty_cost": 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 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
register Ran
ran; our contract draft was wrong, not the code
hywang66/LARP/models/models.py
pointer only (licence: MIT); the stored copy get_code serves, from liyuantsao/flowsr-lp, is pointer only (licence: NONE) · get_code("44c3aa4c610ea3f7")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from liyuantsao/flowsr-lp, and GitHub detected no licence in that repository 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.

get_2d_sincos_pos_embed_from_grid Not yet run
unverified (harvested, no recorded run)
hywang66/LARP/models/embed.py
code served (permissive licence) · get_code("fd6ac2b105d8a7b5")
How it ran

no invocation recorded.

make Not yet run
unverified (harvested, no recorded run)
hywang66/LARP/models/models.py
code served (permissive licence) · get_code("8003b350e3563bc9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 4 the same month, 6 later) and 7 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
get_2d_sincos_pos_embed_from_grid 190 other papers
120 dated earlier, 6 the same month, 63 later, 1 same year, order not determinable · 65 only as an assembly brick
1807.10221 (2018-07)
Unified Perceptual Parsing for Scene Understanding
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
2111.06377 (2021-11)
Masked Autoencoders Are Scalable Vision Learners
and 187 more not named here
get_2d_sincos_pos_embed 69 other papers
34 dated earlier, 5 the same month, 30 later · 12 only as an assembly brick
2203.10897 (2022-03)
Unified Multivariate Gaussian Mixture for Efficient Neural Image Compression
2212.09748 (2022-12)
Scalable Diffusion Models with Transformers
2303.14389 (2023-03)
Masked Diffusion Transformer is a Strong Image Synthesizer
and 66 more not named here
drop_path 66 other papers
38 dated earlier, 2 the same month, 23 later, 1 same year, order not determinable, 2 undated · 15 only as an assembly brick
1906.01502 (2019-06)
How multilingual is Multilingual BERT?
2011.10566 (2020-11)
Exploring Simple Siamese Representation Learning
2103.03230 (2021-03)
Barlow Twins: Self-Supervised Learning via Redundancy Reduction
and 63 more not named here
register 24 other papers
17 dated earlier, 6 later, 1 same year, order not determinable · 9 only as an assembly brick
2003.04390 (2020-03)
Meta-Baseline: Exploring Simple Meta-Learning for Few-Shot Learning
2010.00763 (2020-10)
BONGARD-LOGO: A New Benchmark for Human-Level Concept Learning and Reasoning
2111.00195 (2021-11)
Learning Continuous Representation of Audio for Arbitrary Scale Super Resolution
and 21 more not named here
hinge_d_loss 15 other papers
10 dated earlier, 5 later
2012.09841 (2020-12)
Taming Transformers for High-Resolution Image Synthesis
2112.00384 (2021-12)
Exploration into Translation-Equivariant Image Quantization
2211.13221 (2022-11)
Latent Video Diffusion Models for High-Fidelity Long Video Generation
and 12 more not named here
find_multiple 13 other papers
2 dated earlier, 1 the same month, 9 later, 1 undated · 2 only as an assembly brick
2406.06525 (2024-06)
Autoregressive Model Beats Diffusion: Llama for Scalable Image Generation
2409.13689 (2024-09)
Temporally Aligned Audio for Video with Autoregression
2410.02705 (2024-10)
ControlAR: Controllable Image Generation with Autoregressive Models
and 10 more not named here

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

Repositories linked to this paper

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

Abstract

We present LARP, a novel video tokenizer designed to overcome limitations in current video tokenization methods for autoregressive (AR) generative models. Unlike traditional patchwise tokenizers that directly encode local visual patches into discrete tokens, LARP introduces a holistic tokenization scheme that gathers information from the visual content using a set of learned holistic queries. This design allows LARP to capture more global and semantic representations, rather than being limited to local patch-level information. Furthermore, it offers flexibility by supporting an arbitrary number of discrete tokens, enabling adaptive and efficient tokenization based on the specific requirements of the task. To align the discrete token space with downstream AR generation tasks, LARP integrates a lightweight AR transformer as a training-time prior model that predicts the next token on its discrete latent space. By incorporating the prior model during training, LARP learns a latent space that is not only optimized for video reconstruction but is also structured in a way that is more conducive to autoregressive generation. Moreover, this process defines a sequential order for the discrete tokens, progressively pushing them toward an optimal configuration during training, ensuring smoother and more accurate AR generation at inference time. Comprehensive experiments demonstrate LARP's strong performance, achieving state-of-the-art FVD on the UCF101 class-conditional video generation benchmark. LARP enhances the compatibility of AR models with videos and opens up the potential to build unified high-fidelity multimodal large language models (MLLMs).

For agents

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

get_harvested_code_for_paper("2410.21264")
get_code_for_paper("2410.21264")
have("2410.21264")

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

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

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

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

Connect an agent — have() is free.