SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.15894 · ICML · 2025

RIFLEx: A Free Lunch for Length Extrapolation in Video Diffusion Transformers

Jun Zhu, Chongxuan Li, Guande He, Min Zhao, Hongzhou Zhu, Yixiao Chen

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 1 violated it and 1 has no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2502.15894.json · badge: /api/ran/2502.15894.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
Tencent/HunyuanVideo community
Papers with Code archive
3 ran · 1 no recorded run
hao-ai-lab/FastVideo community
Papers with Code archive
3 ran · 0 no recorded run
FunctionStatusWhere it lives
RotaryPositionalEmbedding3D Ran
ran on a synthesized input · constructed an object; no result was computed
hao-ai-lab/FastVideo/fastvideo/layers/rotary_embedding_3d.py
code served (permissive licence) · get_code("45c3997748d4f45f")
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, RotaryPositionalEmbedding3D: 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 function RotaryPositionalEmbedding3D is a nn.Module that:
# - Takes head_dim and base as __init__ parameters
# - Uses head_dim to compute frequency dimensions
# - Uses base for exponential frequency calculations
# - Stores frequencies in self.freqs_dict
# - In forward, applies rotary embeddings to q and k tensors

# Build minimal valid arguments
head_dim = 16  # Must be multiple of 8
base = 10000.0

# Create an instance of RotaryPositionalEmbedding3D
rope_3d = nn.Module.__new__(type('RotaryPositionalEmbedding3D', (nn.Module,), {}))
rope_3d.head_dim = head_dim
rope_3d.base = base
rope_3d.freqs_dict = {}

ARGS = {
    'head_dim': head_dim,
    'base': base,
}
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 RotaryPositionalEmbedding3D — 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 RotaryPositionalEmbedding3D 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
_to_tuple Ran
ran, honoured the contract we drafted
Tencent/HunyuanVideo/hyvideo/modules/posemb_layers.py
pointer only (licence: NOASSERTION) · get_code("3f82cc898d2962e9")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, Tencent/HunyuanVideo (NOASSERTION). 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.

broadcast Ran
ran, honoured the contract we drafted
hao-ai-lab/FastVideo/fastvideo/layers/rotary_embedding_3d.py
code served (permissive licence) · get_code("dfd8b529d1956695")
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, 9, 4) 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 list of tensors with compatible shapes for broadcasting
# The function broadcasts tensors along a specified dimension
# Let's create tensors that can be broadcast together

tensor1 = torch.randn(2, 1, 4)  # shape: (2, 1, 4)
tensor2 = torch.randn(2, 3, 4)  # shape: (2, 3, 4)
tensor3 = torch.randn(2, 5, 4)  # shape: (2, 5, 4)

# These tensors have:
# - Same number of dimensions (3)
# - Same size along dim 0 (2) and dim 2 (4)
# - Different sizes along dim 1 (1, 3, 5) which are broadcastable (1 can expand to 3 and 5)
# - When concatenating along dim=1, they will be broadcast to (2, 3, 4), (2, 3, 4), (2, 5, 4)
#   and then concatenated to form (2, 9, 4)

tensors = [tensor1, tensor2, tensor3]
dim = 1

ARGS = {
    'tensors': tensors,
    'dim': dim,
}
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, 9, 4) — shape (2, 9, 4) 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_1d_rotary_pos_embed Ran
ran, violated the contract we drafted
Tencent/HunyuanVideo/hyvideo/modules/posemb_layers.py
pointer only (licence: NOASSERTION) · get_code("d248bc86ea44210d")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, Tencent/HunyuanVideo (NOASSERTION). 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_nd_rotary_pos_embed Ran
ran; our contract draft was wrong, not the code
Tencent/HunyuanVideo/hyvideo/modules/posemb_layers.py
pointer only (licence: NOASSERTION) · get_code("3c2aa07ddf1014f0")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, Tencent/HunyuanVideo (NOASSERTION). 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.

rotate_half Ran
ran; our contract draft was wrong, not the code
hao-ai-lab/FastVideo/fastvideo/layers/rotary_embedding_3d.py
code served (permissive licence) · get_code("d727d58b7f752099")
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, 4) 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)

# The function rotate_half takes a single parameter: a torch.Tensor
# It uses einops rearrange to reshape, unbind, stack, and rearrange again
# The tensor needs to have an even number of elements in the last dimension
# to allow rearranging with r=2

# Create a tensor with shape (batch, seq_len, hidden_dim)
# where hidden_dim is even (e.g., 4) so it can be split in half
x = torch.randn(2, 3, 4)

ARGS = {
    'x': x
}
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, 4) — shape (2, 3, 4) 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_meshgrid_nd Not yet run
unverified (harvested, no recorded run)
Tencent/HunyuanVideo/hyvideo/modules/posemb_layers.py
pointer only (licence: NOASSERTION) · get_code("8ba917bc43560851")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, Tencent/HunyuanVideo (NOASSERTION). 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.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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 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.

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

Recent advancements in video generation have enabled models to synthesize high-quality, minutelong videos. However, generating even longer videos with temporal coherence remains a major challenge and existing length extrapolation methods lead to temporal repetition or motion deceleration. In this work, we systematically analyze the role of frequency components in positional embeddings and identify an intrinsic frequency that primarily governs extrapolation behavior. Based on this insight, we propose RIFLEx, a minimal yet effective approach that reduces the intrinsic frequency to suppress repetition while preserving motion consistency, without requiring any additional modifications. RIFLEx offers a true free lunch-achieving high-quality 2× extrapolation on state-of-the-art video diffusion transformers in a completely training-free manner. Moreover, it enhances quality and enables 3× extrapolation by minimal fine-tuning without long videos. Project page and codes: https://riflex-video.github.io/.

For agents

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

get_harvested_code_for_paper("2502.15894")
get_code_for_paper("2502.15894")
have("2502.15894")

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

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

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

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

Connect an agent — have() is free.