Introduction
Autoregressive video generation builds each new segment from historical key-value (KV) states. Retaining the full history makes the cache grow with the rollout, increasing GPU allocation and computation. Streaming generation therefore needs a bounded active cache that still preserves subject identity, appearance, scene layout, and motion continuity.
The history naturally divides into an initial sink, a recent window, and middle KV between them. The sink provides a persistent anchor, and recent KV supports local continuity. Middle KV spans most of a long rollout, yet its contribution is less understood. Sink-plus-recent layouts discard it; other policies retain selected states using attention or similarity. Choosing a retention rule first requires understanding what this middle history does.
Our study follows that question from intervention to policy design. We establish the causal value of middle KV, examine whether attention identifies especially valuable frames, and test how stored content influences later generation. The resulting evidence supports two principles: preserve broad historical coverage and favor earlier visual references with less accumulated drift. SedimentKV implements both in a bounded online cache.
Establishing the contribution of middle KV
We study four representative autoregressive systems: a causal streaming adaptation of daVinci-MagiHuman, Wan2.1, Wan2.2 with LongLive-2.0, and HY-World 1.5. Interventions operate on latent-frame KV slots. The main mechanism suites use single-human VBench-I2V cases with a clear target face, so ArcFace similarity to the target identity provides a sensitive readout of accumulated visual drift. Both fixed-prompt and prompt-switch suites are included; in the latter, action instructions change over time.
The first intervention isolates middle KV from the two cache boundaries. We hold sink and recent states fixed and compare rollouts with middle KV masked or visible under matched prompts and generation seeds. Restoring middle KV increases identity similarity over the first 60 seconds across all four backbones and both suites. Across 39 cases, every backbone–suite pair has a paired-bootstrap 95% confidence interval above zero for the mean 0–60-second difference. Middle KV therefore contributes to consistency beyond the sink and recent window.
Middle-KV visibility intervention · original Figure 2
This establishes why middle history should participate in retention. The next question is how its contribution is distributed: can attention identify a small set of historical frames that deserves priority?
Attention is broadly distributed and largely follows temporal position
Concentrated attention to a few historical frames would appear as persistent bright vertical lines at fixed history indices. Figure 1 instead shows broad temporal bands in both suites, including at prompt-switch boundaries. Single-case, layer-level, and head-level readouts show the same broad distribution, so the pattern also appears before averaging across cases and model components.
Figure 1. Attention to middle KV spans broad temporal regions. Four backbones on the no-switch (a) and prompt-switch (b) suites. Each heatmap row is normalized by its maximum attention mass; cyan lines mark prompt switches. Axis labels retain the original frame and time-bin definitions.
The participation and turnover statistics reinforce this picture. On the fixed-prompt suite, the effective participating fraction of middle frames is 58.6–89.4%. Frames in the high-attention set remain there continuously for only 1.22–2.23 seconds on average, and the set’s Jaccard overlap falls to 0.20–0.25 after two seconds. A frame’s current attention rank changes rapidly during generation.
We then separate temporal position from video-specific content. For each video, a content-blind template predicts its attention using the other 38 videos at matched layer, query, and key positions. After normalization over middle KV, this leave-one-video-out template explains R² = 0.77–0.93 of frame-level attention variance. At matched layer, query time, candidates, and budget, top-k selection using the video’s own attention captures only 0.2–3.6 percentage points more future attention than the shared template. Much of the apparent predictive value of attention ranking is therefore already supplied by shared temporal position.
Predicting future attention and preserving useful visual references are separate tests. To measure retention value directly, we branch from clean prefixes near 20 seconds and generate the next chunk. High-attention selection is scored over the last three completed chunks. It and random selection retain 25%, 50%, or 75% of scored middle frames, with equal quotas in each of four temporal bins. Matching these quotas controls coarse temporal position while testing the ranking within each interval.
Across four backbones with ten cases each, high-attention retention gives no clear next-chunk identity gain over random selection at any tested quota. Paired 95% intervals span zero except at 25% retention on HY-World 1.5, where random retention performs better. Together, the trajectory readouts and the matched-prefix intervention support broad historical coverage: attention is distributed, its rankings turn over quickly, and preferentially retaining its current high-scoring frames offers no clear immediate identity benefit under the controlled test.
How stored middle KV shapes later generation
The attention analysis describes how middle history is read. To understand which references to preserve, we next test what its content supplies to subsequent generation. The study examines both access to a specific earlier action and the influence of cached visual appearance.
Repeating an action and accessing its earlier KV
The action probe starts from an identical three-part prefix: for example, a person stands still, bows their head, and returns to standing still. From that exact history, generation branches into four prompts: name the same action again; say “repeat the earlier action” without naming it; describe a different action; or request no action. The paired analysis includes all 56 histories where native Full KV completes the target action when it is named. These probes use separate action-sequence inputs, including native Self-Forcing DMD T2V, alongside the main I2V mechanism suites.
Naming the repeated action produces no large increase in attention to its source segment, and masking that segment’s video KV still preserves completion in 56/56 histories. With the vague “same as before” prompt, Full KV completes the target action in 0/56 histories and again shows no large attention increase. Under this protocol, direct access to the earlier action KV is unnecessary for named-action repetition, while retaining it is insufficient for repetition from the vague reference alone. This motivates testing the visual information carried by middle KV directly.
Action-sequence probe · original Table 1
Cached identity and spatial errors propagate forward
We inject controlled visual corruption into retained middle KV while keeping the sink, recent window, current block, and unselected states clean. Face-swap replay perturbs identity; horizontal-strip replay perturbs spatial structure. Nested fractions of eligible middle slots are corrupted under matched generation settings, allowing the subsequent output to reveal the influence of the altered history.
Both changes propagate into later generated frames. Figure 2 shows the output at 48 seconds, and the supplementary dose-response analyses show identity similarity decreasing monotonically as the corrupted fraction increases. These interventions establish middle KV as a persistent visual reference for identity, appearance, and scene structure. They also show why reference quality matters: cached visual errors can be carried into subsequent generation.
Figure 2. Corruption in middle KV propagates to later frames. Generated frames at 48 seconds after face-swap (a) or horizontal-strip (b) replay. Columns show the reference and 0–100% corruption of eligible middle states. Sink, recent, current, and unselected states remain clean.
Similarity to the latest generated frame can recycle drift
As autoregressive errors accumulate, the latest generated frame increasingly carries drift. Using that frame as the retrieval query can then favor similarly degraded recent history over cleaner earlier references. We test this selection effect on common candidate trajectories: historical frames sampled at 1 FPS from drifted sink-plus-recent rollouts are ranked by DINO cosine similarity to the latest frame under matched budgets. Across all four backbones, similarity selection chooses more recent, more redundant, and lower-identity references than uniform random sampling.
Actual Wan2.1 LongLive-RAG retrieval logs show the same direction of change during online generation. Across 39 cases, from 30–60 seconds to 120–200 seconds, mean retriever cosine similarity rises from 0.836 to 0.890. Meanwhile, normalized reference age falls from 0.302 to 0.105, ArcFace identity from 0.238 to 0.063 with missing faces assigned zero, face-detection coverage from 100.0% to 72.6%, and MUSIQ quality from 0.697 to 0.512. Greater similarity to the evolving query thus accompanies deteriorating retained references.
The fixed-trajectory probe isolates selection on a common candidate set; the online logs track the cache as retrieval and generation evolve together. Their agreement connects the corruption experiment to retention design: middle KV influences future visual content, so repeatedly selecting references similar to an already drifted output risks reinforcing that drift.
From the mechanism evidence to SedimentKV
The two policy principles follow from different parts of the evidence. Broadly distributed attention, rapid rank turnover, and the matched-prefix retention test motivate coverage across middle history. The corruption experiment and similarity probes motivate favoring earlier visual references with less accumulated drift. SedimentKV combines these principles using an online middle reservoir and time-weighted random priorities, without content-dependent scoring or additional training.
Earlier-reference preference must also accommodate evolving content. MemRoPE notes that static sinks cannot reflect scene evolution; Deep Forcing reports repetition when oversized sinks over-preserve early frames; Reward Forcing identifies initial-frame copying and reduced motion under static frame sinks. SedimentKV therefore biases retention toward earlier candidates while giving later history a nonzero probability of admission. The original paper’s method section and reference list provide the attribution for these observations.
Figure 3. SedimentKV. (a) Comparison of KV retention policies. (b) SedimentKV preserves sink and recent states and maintains a bounded middle reservoir using temporally weighted random priorities, covering history while favoring earlier states.
A bounded reservoir keeps middle history eligible over an unknown-length stream
A fixed latent-frame KV budget B is divided into S sink slots, M middle-reservoir slots, and R recent slots, with M = B − S − R. New states enter the recent window in chronological order. Whenever it exceeds R, the oldest state becomes a middle candidate. If one model call adds several frames, candidates are processed chronologically with one random draw each. Retained middle states are sorted by frame index before cache readout.
[sink | sorted middle reservoir | recent]. (1)
Uniform Reservoir applies Algorithm R to the same layout and candidate stream. Once n eligible candidates have arrived and n ≥ M, each has marginal retention probability M/n. This gives an equal-weight coverage baseline without deterministic temporal blind spots. Sharing the layout, candidates, retention seeds, and chronological writeback with SedimentKV makes temporal weighting the controlled difference.
Temporal weighting favors earlier references without freezing the cache
For each eligible middle candidate at zero-indexed absolute latent-frame index f, SedimentKV assigns the weight w(f) below. Sink frames f < S never enter this stream; f − S + 1 is the one-based index after the sink. A draw u_f ∈ (0, 1] gives the Efraimidis–Spirakis priority k_f. For α > 0, earlier candidates have larger weights and are more likely to obtain high priorities.
The first M candidates fill the reservoir. Once full, its smallest resident priority is τ. A candidate replaces that resident when k_f > τ, so the reservoir always contains the M largest priorities observed so far. Given τ, its admission probability is one minus τ to the power w(f). Every later eligible candidate retains a nonzero chance of entry, and an admitted state can itself be replaced later. The preference for earlier references is probabilistic throughout the evolving stream.
Implementation: stable priorities and bounded policy storage
The equivalent log-domain score below avoids numerical instability. A linear scan costs O(M) time per middle candidate and O(M) policy storage, independent of the stream’s history length. The policy uses only frame indices, random draws, and resident scores; the retained KV itself remains bounded by the configured cache layout.
Reference-quality diagnostics connect the rule back to the mechanism
On shared candidate trajectories across all four backbones, temporal weighting with α = 1 selects earlier, less redundant, and higher-identity references than both latest-frame similarity and uniform sampling. Latest-frame similarity remains inferior even on cleaner trajectories generated by SedimentKV. This tests whether the retention rule selects the kind of visual reference motivated by the mechanism study, in addition to its effect on final video scores.
In the online Wan2.1 diagnostic over 120–200 seconds, mean retained-reference identity increases from 0.063 with LongLive-RAG to 0.291 with SedimentKV. Each policy follows its own rollout in this comparison. Together with the shared-trajectory probes, this links early-time weighting to higher-quality retained references before the broader policy evaluations.
Testing the policy across scenes, backbones, and cache budgets
Text-to-video generation on 128 prompts
To test generalization beyond the identity-focused mechanism suites, we evaluate 240-second text-to-video generation on a fixed 128-prompt MovieGenBench subset with diverse scenes. Methods share the pretrained Self-Forcing DMD checkpoint based on Wan2.1-T2V-1.3B, prompts, generation seed, and generation and evaluation protocols. Each baseline retains the KV configuration specified in its paper or official implementation. SedimentKV uses α = 1, retention seed 0, S/M/R = 1/11/4, and a physical capacity of 21 latent-frame KV slots.
At 240 seconds, SedimentKV improves cross-clip subject/background consistency by 2.84/2.14 points over the strongest respective baselines, with instruction following of 2.84/3 and mean peak GPU allocation of 9.72 GiB. Tables 1–2 reproduce all methods and metrics from original Tables 2–3. The raw cross-clip scores use DINOv2 and DreamSim functions on frames sampled every two seconds; the official subject/background consistency scores use VBench-Long slow–fast fusion.
| Method | Subject consistency ↑×100 | Background consistency ↑×100 | Aesthetic quality ↑×100 | Imaging quality ↑×100 | Motion smoothness ↑×100 | Dynamic degree×100 | Subject c2c ↑×100 | Background c2c ↑×100 |
|---|---|---|---|---|---|---|---|---|
| Deep Forcing | 96.83 | 96.39 | 61.75 | 69.65 | 97.85 | 63.03 | 78.00 | 82.34 |
| MemRoPE | 96.91 | 96.28 | 57.65 | 69.24 | 97.99 | 54.48 | 74.42 | 79.78 |
| Relax Forcing | 96.80 | 96.22 | 61.28 | 70.02 | 97.64 | 61.43 | 77.26 | 81.64 |
| LongLive-RAG | 97.00 | 96.29 | 58.43 | 70.16 | 98.01 | 53.24 | 73.32 | 78.48 |
| TetherCache | 96.34 | 96.03 | 60.15 | 69.43 | 97.65 | 66.69 | 74.30 | 80.00 |
| SedimentKV | 97.27 | 96.57 | 62.39 | 70.35 | 98.19 | 56.26 | 80.83 | 84.48 |
All six methods and all eight metrics from original Table 2. 128 MovieGenBench prompts; 240-second videos; shared Self-Forcing DMD weights and generation protocol, with native cache settings. Subject/background consistency use official VBench-Long slow–fast fusion; c2c columns are raw DINOv2/DreamSim cross-clip scores, sampled every 2s without mapping or fusion. Scores are ×100. Bold: best; underline: second-best. Dynamic Degree is unranked.
| Method | Overall consistency ↑×100 | Instruction following ↑0–3 | Peak allocated GPU ↓GiB |
|---|---|---|---|
| Deep Forcing | 23.52 | 2.80 | 10.36 |
| MemRoPE | 22.80 | 2.69 | 12.89 |
| Relax Forcing | 23.96 | 2.85 | 35.88 |
| LongLive-RAG | 22.01 | 2.68 | 7.89 |
| TetherCache | 23.34 | 2.71 | 21.00 |
| SedimentKV | 24.19 | 2.84 | 9.72 |
All columns from original Table 3. Semantic evaluation uses the same 128 videos per method as Table 1. Overall consistency: VBench-Long ViCLIP video–text score. Instruction following: WorldModelBench. GPU allocation: mean peak across three generation runs; LongLive-RAG additionally uses a CPU history archive. Bold: best; underline: second-best.
Text-to-video comparison

The supplementary cost study measures core generation after warm-up on an H100, averaging three fixed-prompt 240-second runs. Core FPS excludes VAE decoding and video encoding. Peak allocated and reserved GPU memory are reported separately; LongLive-RAG additionally maintains a growing CPU history archive. Supplementary Table 14 provides the full cost statistics.
Image-to-video generation with matched active KV budgets
The prompt-switch evaluation tests whether the visual reference remains useful while action instructions change. We compare Sink+FIFO, Deep Forcing, Uniform Reservoir, and SedimentKV across four backbones, with LongLive-RAG additionally evaluated on Wan2.1 using its released retrieval encoder. Within each backbone, inputs, prompts, generation seeds, settings, durations, and active KV budgets are matched. Uniform Reservoir and SedimentKV average six retention seeds per case and share the layout and candidate stream, isolating temporal weighting.
Table 3 gives every baseline and metric from the original prompt-switch comparison: 39 cases per backbone, evaluated at 240 seconds, or 120 seconds for HY-World 1.5. SedimentKV has the highest FaceSim and DINO similarity and the lowest identity, scene, and quality drift on all four backbones. Instruction following matches or exceeds Uniform Reservoir, supporting visual consistency under changing actions. The accompanying Wan2.1 video illustrates a 60-second prompt-switch example.
| Backbone | Policy | FaceSim ↑×100 | ID drop ↓×100 | Face cov. ↑×100 | DINO ↑×100 | Scene drift ↓×100 | Imaging ↑×100 | Q drift ↓×100 | Smooth. ↑×100 | IF ↑0–3 |
|---|---|---|---|---|---|---|---|---|---|---|
| daVinci- | Sink+FIFO | 16.1 | 20.8 | 99.4 | 74.2 | 6.3 | 70.1 | 4.1 | 99.4 | 2.98 |
| Deep Forcing | 16.0 | 21.8 | 99.4 | 74.2 | 6.1 | 70.1 | 4.1 | 99.4 | 2.98 | |
| Uniform Reservoir | 30.7 | 16.2 | 99.7 | 82.1 | 2.7 | 69.8 | 2.6 | 99.5 | 2.98 | |
| SedimentKV | 40.4 | 5.5 | 99.9 | 85.1 | 1.1 | 69.8 | 1.6 | 99.6 | 2.98 | |
| Wan2.1 | Sink+FIFO | 10.8 | 21.9 | 81.5 | 47.8 | 29.5 | 48.6 | 32.2 | 95.8 | 1.92 |
| Deep Forcing | 14.7 | 23.6 | 39.4 | 33.4 | 36.5 | 51.1 | 23.8 | 95.2 | 1.38 | |
| Uniform Reservoir | 22.6 | 7.2 | 100.0 | 75.5 | 9.4 | 69.8 | 5.4 | 99.3 | 2.94 | |
| LongLive-RAG | 15.3 | 21.2 | 86.5 | 57.4 | 23.2 | 59.2 | 22.8 | 97.1 | 2.50 | |
| SedimentKV | 26.9 | 2.7 | 100.0 | 80.5 | 2.4 | 72.1 | 2.3 | 99.3 | 2.98 | |
| Wan2.2 | Sink+FIFO | 15.6 | 41.5 | 74.7 | 50.8 | 27.9 | 48.7 | 21.3 | 98.7 | 1.94 |
| Deep Forcing | 25.6 | 36.5 | 30.4 | 27.4 | 31.9 | 30.4 | 36.1 | 93.8 | 1.34 | |
| Uniform Reservoir | 27.9 | 33.9 | 97.4 | 76.6 | 8.8 | 56.7 | 9.4 | 99.0 | 2.72 | |
| SedimentKV | 41.8 | 25.0 | 99.6 | 84.8 | 3.5 | 60.5 | 3.9 | 99.3 | 2.82 | |
| HY-World 1.5 | Sink+FIFO | 43.6 | 65.6 | 72.6 | 58.8 | 37.3 | 66.2 | 12.3 | 99.0 | 2.08 |
| Deep Forcing | 46.3 | 68.6 | 63.2 | 54.0 | 38.1 | 65.2 | 11.9 | 98.7 | 1.96 | |
| Uniform Reservoir | 53.0 | 41.4 | 86.3 | 76.6 | 18.2 | 69.7 | 6.0 | 99.2 | 2.45 | |
| SedimentKV | 56.5 | 34.5 | 89.6 | 79.8 | 17.2 | 69.9 | 4.9 | 99.4 | 2.49 |
All baselines and all nine metrics from original Table 4. 39 prompt-switch cases per backbone; matched active KV budgets. Uniform Reservoir and SedimentKV average six retention seeds per case. Duration: 240s, except HY-World 1.5 at 120s. FaceSim: identity similarity; ID drop: identity drift; face cov.: face coverage; DINO: scene similarity; Q drift: quality drift; smooth.: motion smoothness; IF: WorldModelBench instruction following. Bold/underline: best/second-best within each backbone, including ties. All metrics except IF are ×100.
Image-to-video comparison

Reading motion scores alongside visual quality
Dynamic Degree is interpreted jointly with visual quality and face coverage because optical flow can also respond to artifacts. In the documented daVinci-MagiHuman case 17 at 100–102 seconds, Sink+FIFO generates an unexpected second person. Zeroing flow in that fixed region, while leaving RGB frames unchanged, changes the clip’s binary Dynamic Degree label from 1 to 0. The T2V table therefore leaves Dynamic Degree unranked, and the supplementary diagnostics show the associated frames and motion readouts.
Supplementary Figure 13: unexpected-person example and flow diagnostic
Separating historical coverage from early-time weighting
Across matched cache-budget grids on the fixed-prompt suite, SedimentKV reduces identity drift relative to Sink+FIFO and Deep Forcing at every evaluated budget, and relative to Uniform Reservoir at most points. Original Figure 7 reports each backbone at its longest evaluation horizon, with budgets measured in latent-frame slots. The comparison with Uniform Reservoir tests the value added by temporal weighting beyond the shared reservoir layout and candidate stream.
Cache-budget scaling · original Figure 7
A separate ten-prompt ablation holds S/M/R = 1/12/3 and the 16-frame attention budget fixed while changing the temporal preference. At 240 seconds, the official seven-dimension weighted VBench Quality Score (×100) is 84.31 with an earlier-history preference (α = 1), 82.91 without temporal bias (α = 0), and 81.77 with a later-history preference (α = −1). Earlier weighting also gives the highest score at 60 seconds. The reference-quality diagnostics, matched-layout comparisons, and direction-of-weighting ablation thus test successive links between the mechanism-derived rule and long-rollout performance.
Implications for KV-cache retention
Middle KV causally supports long-range consistency. Its attention is broadly distributed and largely follows temporal position, while its stored content supplies visual references whose errors can propagate forward. These findings explain why broad coverage and preferential retention of earlier references work together. SedimentKV implements both in a bounded, training-free policy for unknown-length streams; evaluations across diverse backbones and scenes show improved consistency over rollouts up to 240 seconds while preserving quality and instruction following.
References and materials
- What to Cache for Consistent Autoregressive Video Generation. Research manuscript; complete reference list.
- Supplementary Material. Experimental protocols, additional analyses, full cost statistics, and further results.








