SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.18215 · 2026

Memorize When Needed: Decoupled Memory Control for Spatially Consistent Long-Horizon Video Generation

Lei Zhang, Pengfei Wang, Zhiyuan Ma, Zhengqiang Zhang, Xinyue Liang, Yanjun Guo

arXiv · PDF · Open in the Atlas

Code that ran

17 of 19 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; 4 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 12 failures of our instrument; 2 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/2604.18215.json · badge: /api/ran/2604.18215.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
iguoyanjun/Memorize-When-Needed canonical (classifier label)
classifier basis: census
17 ran · 2 no recorded run
FunctionStatusWhere it lives
build_controlnet_token_mask Ran
ran; our contract draft was wrong, not the code
iguoyanjun/Memorize-When-Needed/pipeline.py
pointer only (licence: NONE) · get_code("8b0ccead2e4ce95f")
How it ran

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

build_reference_frames Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
iguoyanjun/Memorize-When-Needed/infer.py
pointer only (licence: NONE) · get_code("798aecf07ae276dd")
How it ran

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

color_transfer Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
iguoyanjun/Memorize-When-Needed/models/utils/utils.py
pointer only (licence: NONE) · get_code("06338ab44c6754a4")
How it ran

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

filter_kwargs Ran
ran; our contract draft was wrong, not the code
iguoyanjun/Memorize-When-Needed/infer.py
pointer only (licence: NONE) · get_code("92f121bb438f3774")
How it ran

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

filter_kwargs Ran
ran; our contract draft was wrong, not the code
iguoyanjun/Memorize-When-Needed/models/utils/utils.py
pointer only (licence: NONE) · get_code("fbc3e873361f20d5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, iguoyanjun/Memorize-When-Needed 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_sampling_sigmas Ran
ran, honoured the contract we drafted
iguoyanjun/Memorize-When-Needed/models/utils/fm_solvers.py
pointer only (licence: NONE) · get_code("1532dbb1d28a2c99")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, iguoyanjun/Memorize-When-Needed 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_width_and_height_from_image_and_base_resolution Ran
ran, honoured the contract we drafted
iguoyanjun/Memorize-When-Needed/models/utils/utils.py
pointer only (licence: NONE) · get_code("406364af353a424a")
How it ran

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

mat3_to_quat_wxyz Ran
ran, honoured the contract we drafted
iguoyanjun/Memorize-When-Needed/dataload/utils.py
pointer only (licence: NONE) · get_code("5485127438111d03")
How it ran

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

orthonormalize_R Ran
ran, honoured the contract we drafted
iguoyanjun/Memorize-When-Needed/dataload/utils.py
pointer only (licence: NONE) · get_code("3493f2b0b7ba5d3b")
How it ran

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

quat_wxyz_to_mat3 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
iguoyanjun/Memorize-When-Needed/dataload/utils.py
pointer only (licence: NONE) · get_code("2001736e8a6a9441")
How it ran

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

ray_condition Ran
ran; our contract draft was wrong, not the code
iguoyanjun/Memorize-When-Needed/models/controlnets/wan_controlnet_camera.py
pointer only (licence: NONE) · get_code("6e301fe216cd0f77")
How it ran

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

resize_mask Ran
ran; our contract draft was wrong, not the code
iguoyanjun/Memorize-When-Needed/pipeline.py
pointer only (licence: NONE) · get_code("ddf3a7a391972394")
How it ran

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

retrieve_timesteps Ran
ran; our contract draft was wrong, not the code
iguoyanjun/Memorize-When-Needed/pipeline.py
pointer only (licence: NONE) · get_code("22b1f260da28f6a5")
How it ran

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

retrieve_timesteps Ran
ran; our contract draft was wrong, not the code
iguoyanjun/Memorize-When-Needed/models/utils/fm_solvers.py
pointer only (licence: NONE) · get_code("3eeae6ab9b822c6c")
How it ran

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

rope_params Ran
ran, violated the contract we drafted
iguoyanjun/Memorize-When-Needed/models/controlnets/wan_transformer_dual.py
pointer only (licence: NONE) · get_code("dc160d63c5846f4a")
How it ran

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

sinusoidal_embedding_1d Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
iguoyanjun/Memorize-When-Needed/models/controlnets/wan_transformer_dual.py
pointer only (licence: NONE) · get_code("e34a97853e924d88")
How it ran

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

zero_module Ran
ran; our contract draft was wrong, not the code
iguoyanjun/Memorize-When-Needed/models/controlnets/wan_controlnet_camera.py
pointer only (licence: NONE) · get_code("d81381b327c76edd")
How it ran

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

attention Not yet run
unverified (harvested, no recorded run)
iguoyanjun/Memorize-When-Needed/models/wan_modules/attention_utils.py
pointer only (licence: NONE) · get_code("c0487d5566533bde")
How it ran

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

flash_attention Not yet run
unverified (harvested, no recorded run)
iguoyanjun/Memorize-When-Needed/models/wan_modules/attention_utils.py
pointer only (licence: NONE) · get_code("7ea44a4680b76539")
How it ran

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

Also present in other papers' code

Of 19 samples lifted from this paper's linked repositories, 19 carry a function identity and 0 do not. Of the 19 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 2 later) and 14 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
retrieve_timesteps 46 other papers
39 dated earlier, 5 later, 2 undated
2312.04461 (2023-12)
PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding
2402.10491 (2024-02)
Make a Cheap Scaling: A Self-Cascade Diffusion Model for Higher-Resolution Adaptation
2405.18991 (2024-05)
EasyAnimate: High-Performance Video Generation Framework with Hybrid Windows Attention and Reward Backpropagation
and 43 more not named here
zero_module 40 other papers
39 dated earlier, 1 later
2305.13077 (2023-05)
ControlVideo: Training-free Controllable Text-to-Video Generation
2305.17098 (2023-05)
ControlVideo: Conditional Control for One-shot Text-driven Video Editing and Beyond
2308.03448 (2023-08)
Make Explicit Calibration Implicit: Calibrate Denoiser Instead of the Noise Model
and 37 more not named here
sinusoidal_embedding_1d 4 other papers
4 dated earlier
2502.11079 (2025-02)
Phantom: Subject-Consistent Video Generation via Cross-Modal Alignment
2503.07598 (2025-03)
VACE: All-in-One Video Creation and Editing
2505.23742 (2025-05)
MAGREF: Masked Guidance for Any-Reference Video Generation with Subject Disentanglement
and 1 more not named here
flash_attention 3 other papers
3 dated earlier
2502.11079 (2025-02)
Phantom: Subject-Consistent Video Generation via Cross-Modal Alignment
2503.07598 (2025-03)
VACE: All-in-One Video Creation and Editing
2505.23742 (2025-05)
MAGREF: Masked Guidance for Any-Reference Video Generation with Subject Disentanglement
rope_params 2 other papers
2 dated earlier
2503.07598 (2025-03)
VACE: All-in-One Video Creation and Editing
2505.23742 (2025-05)
MAGREF: Masked Guidance for Any-Reference Video Generation with Subject Disentanglement

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

Spatially consistent long-horizon video generation aims to maintain temporal and spatial consistency along predefined camera trajectories. Existing methods mostly entangle memory modeling with video generation, leading to inconsistent content during scene revisits and diminished generative capacity when exploring novel regions, even trained on extensive annotated data. To address these limitations, we propose a decoupled framework that separates memory conditioning from generation. Our approach significantly reduces training costs while simultaneously enhancing spatial consistency and preserving the generative capacity for novel scene exploration. Specifically, we employ a lightweight, independent memory branch to learn precise spatial consistency from historical observation. We first introduce a hybrid memory representation to capture complementary temporal and spatial cues from generated frames, then leverage a per-frame cross-attention mechanism to ensure each frame is conditioned exclusively on the most spatially relevant historical information, which is injected into the generative model to ensure spatial consistency. When generating new scenes, a cameraaware gating mechanism is proposed to mediate the interaction between memory and generation modules, enabling memory conditioning only when meaningful historical references exist. Compared with the existing method, our method is highly data-efficient, yet the experiments demonstrate that our approach achieves state-of-the-art performance in terms of both visual quality and spatial consistency. The code is available at https://github.com/iguoyanjun/Memorize-When-Needed.

For agents

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

get_harvested_code_for_paper("2604.18215")
get_code_for_paper("2604.18215")
have("2604.18215")

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

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

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

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

Connect an agent — have() is free.