---
title: 'WorldKV: Persistent-World Generation'
url: https://www.emergentmind.com/topics/worldkv
type: topic
---

# WorldKV: Persistent-World Generation

WorldKV is a training-free framework for persistent-world generation in autoregressive video diffusion models. It addresses the tension between long-horizon scene consistency and real-time inference by augmenting native KV-cache attention with two mechanisms: **World Retrieval**, which stores evicted KV-cache chunks and selectively reinserts scene-relevant history, and **World Compression**, which prunes redundant tokens within each chunk via key-key similarity to an anchor frame. The method is designed for settings in which revisiting a previously seen viewpoint should reproduce consistent static appearance and scene layout—termed **revisit consistency**—without incurring the linear memory growth and quadratic attention cost of full-KV inference [2605.22718].

## 1. Persistent-world generation and the scaling problem

In the formulation used by WorldKV, an autoregressive video diffusion world model generates a video \(x^{1:N}=(x^1,\dots,x^N)\) conditioned on camera or action inputs \(a^{1:N}=(a^1,\dots,a^N)\) as

\[
p(x^{1:N}\mid a^{1:N}) =\prod_{t=1}^{N}p\bigl(x^t\mid x^{<t},\,a^{\le t}\bigr).
\]

The conditioning on prior frames \(x^{<t}\) is implemented through a causal Transformer with a key-value cache. At each denoising step, new keys and values are appended to the cache. Within this setting, a persistent world requires that if a camera returns at time \(t_2>t_1\) to essentially the same pose used at \(t_1\), then the generated frame should match the earlier frame in static appearance and scene layout. WorldKV defines this property as revisit consistency [2605.22718].

The core systems issue is the scaling behavior of full-KV attention. If each frame or chunk contributes \(T\) keys and values, then after \(M\) frames the cache contains \(M\cdot T\) tokens, with memory footprint \(O(M\,T\,d)\), where \(d\) is the hidden dimension. Causal attention over the entire cache has cost

\[
O\bigl((M\,T)^2\bigr)
\]

per layer per head. As rollout length increases, VRAM usage grows linearly and attention cost grows quadratically. The result is eventual GPU memory exhaustion and degraded frame rate.

A standard mitigation is sliding-window inference, which keeps only the most recent \(W\) frames. This bounds memory by \(W\,T\,d\) and attention cost by \(O((W\,T)^2)\), restoring throughput. However, once keys are evicted from the active window, the model loses direct access to earlier viewpoints, and revisits are prone to hallucination or drift. WorldKV is explicitly positioned between these two extremes: it preserves bounded active attention while retaining access to a larger historical memory.

## 2. World Retrieval

World Retrieval modifies the eviction path of sliding-window inference. Instead of discarding the oldest chunk after the active window exceeds capacity, the method compresses that chunk and moves it into a secondary store in GPU or CPU memory. Each stored chunk is indexed by its **generation state** \(\mathbf a_i\), defined as an absolute camera pose or an accumulated action embedding [2605.22718].

At inference time, the current state \(\mathbf a_{\rm cur}\) is compared with the stored history \(\{(\mathbf K_i,\mathbf V_i,\mathbf a_i)\}_{i=1}^M\) using a relevance score

\[
s_i \;=\;\text{sim}(\mathbf a_{\rm cur},\,\mathbf a_i).
\]

The system retrieves the top-\(k\) chunks ranked by this score:

\[
\mathcal R =\mathrm{Top}\text{-}k\bigl\{(\mathbf K_i,\mathbf V_i)\,\bigm|\,i=1,\dots,M\bigl\}
\quad\text{by descending }s_i.
\]

In the default camera-action instantiation, similarity is defined as

\[
\text{sim}(\mathbf a_{\rm cur},\mathbf a_i) =-\bigl(\,\lambda_t\|\Delta\mathbf t\|_2^2 +\lambda_r\,\mathrm{geodesic}(\Delta\mathbf R)\bigr),
\]

where \(\Delta\mathbf t\) and \(\Delta\mathbf R\) are translation and rotation differences, and \(\lambda_t,\lambda_r\) normalize them. Appendix C also reports that a query-based similarity function, ranking stored chunks by cross-attention score between the current query and stored keys, works nearly as well.

The retrieved chunks are not re-encoded. Instead, they are inserted directly into the native attention window. The active window is formed as

\[
\bigl[\,W_{\rm sink}\,,\;\mathcal R,\;W_{\rm recent},\;W_{\rm cur}\bigr],
\]

where \(W_{\rm sink}\) is a small fixed sink cache anchoring the initial 3 frames, \(W_{\rm recent}\) contains the most recent 3 frames, \(\mathcal R\) is the set of retrieved chunks, and \(W_{\rm cur}\) is the chunk currently being denoised. Standard Transformer causal attention is then applied over this concatenation. The salient design choice is that retrieval operates on cached keys and values rather than on decoded visual features, so the method preserves compatibility with the backbone’s native attention mechanism.

## 3. World Compression

World Compression targets redundancy within a short chunk of frames. The method selects the first frame of a chunk as an **anchor**. If \(\mathbf K^{(a)}\in\mathbb R^{T\times d}\) denotes the anchor-frame keys and \(\{\mathbf k_j^{(f)}\}_{j=1}^T\) the keys of a non-anchor frame \(f=2,\dots,F\), then the redundancy score of token \(j\) in frame \(f\) is

\[
s_j^{(f)} =\frac{1}{T}\sum_{i=1}^T \frac{\mathbf k_j^{(f)\,\top}\,\mathbf k_i^{(a)}}{\|\mathbf k_j^{(f)}\|\;\|\mathbf k_i^{(a)}\|}.
\]

A large score indicates that the token is well represented by the anchor. Pooling all \(T(F-1)\) non-anchor scores, WorldKV keeps only the bottom \(P\)-quantile of non-anchor tokens—those with the smallest redundancy scores—while retaining all anchor tokens. The resulting number of retained keys is

\[
T_{\rm retained} = T \;+\; P\,T\,(F-1).
\]

The implementation described for WorldKV uses \(F=3\) frames per chunk and \(P=25\%\), which yields \(T_{\rm retained}\approx1.5\,T\), described as a \(2\times\) reduction in per-chunk storage [2605.22718].

This compression rule has two direct consequences. First, uncompressed storage for a 3-frame chunk is \(3T\) tokens, whereas compressed storage is \((1+2P)T=1.5T\). Second, under a fixed token budget, the system can store roughly \(2\times\) more chunks. The paper states that, because retrieval selects a fixed number \(k\) of chunks, broader historical coverage can improve revisit consistency. The associated ablations further indicate that moderate compression is preferable to either no compression or overly aggressive compression.

## 4. Integrated inference pipeline and computational properties

WorldKV operates as an inference-time pipeline layered on top of sliding-window denoising. At each generation step, the next chunk is denoised using causal attention over a window composed of sink, retrieved, recent, and current frames. The oldest recent chunk is then evicted, compressed, and appended to the stored history. Retrieval scores are computed against the current camera or action state, and the top-\(k\) chunks are inserted into the attention window for the next step [2605.22718].

The paper contrasts the asymptotic properties of full-KV inference and WorldKV. After \(M\) chunks, full-KV memory is

\[
M\,F\,T\,d,
\]

and its per-layer attention cost is

\[
O\bigl((M\,F\,T)^2\bigr).
\]

With compression fraction \(P\) and retrieval budget \(k\), WorldKV stores approximately

\[
M\,(1+(F-1)P)\,T
\]

tokens in history, while the active attention window is bounded by

\[
T\,[3 + k + 3 + 3]
\]

for sink, retrieval, recent, and current. The corresponding per-layer attention cost is

\[
O\bigl((9 + k)\,T\bigr)^2,
\]

which is independent of rollout length \(M\). This is the central systems claim of the method: the stored history can grow over time, but the active attention computation remains bounded.

The implementation details reported in the paper instantiate this design with a sliding-window size \(W=18\) latent frames, partitioned into Sink \(=3\) frames, Retrieval \(=9\) frames, Recent \(=3\) frames, and Current denoising \(=3\) frames. Compression is configured as anchor-only plus \(25\%\) of non-anchor tokens, giving \(1.5\times T\) tokens per 3-frame chunk, and the retrieval budget is \(k=9\) chunks. Experiments are reported on LingBot-World-Fast (14B) using \(4\times\)H200 GPUs, with additional results on \(4\times\)B200, and on Matrix-Game-2.0 (1.3B) using \(4\times\)H200.

## 5. Empirical evaluation

The evaluation uses 60 manually designed scene-trajectory pairs across indoor, outdoor, game, and AI-gen domains. Each trajectory includes loops, forward-back traversals, and at least one revisit. The reported metrics are PSNR, SSIM, LPIPS, and FID for revisit fidelity, together with FPS for throughput [2605.22718].

Two backbone models are used: LingBot-World-Fast (14B), described as long-video distilled with native full-KV support, and Matrix-Game-2.0 (1.3B), described as trained on short clips with a native sliding window. Memory-trained baselines are WorldPlay (8B) and Yume-1.5 (5B).

The main quantitative results show the following. On LingBot-World-Fast, sliding-window inference reports \(5.05\) FPS, LPIPS \(0.581\), PSNR \(12.18\), SSIM \(0.375\), and FID \(144.04\). Full-KV reports \(2.36\) FPS, LPIPS \(0.441\), PSNR \(15.90\), SSIM \(0.472\), and FID \(85.71\). LingBot-Fast + WorldKV reports \(4.78\) FPS, LPIPS \(0.455\), PSNR \(15.66\), SSIM \(0.463\), and FID \(75.64\). On Matrix-Game-2.0, sliding-window inference reports \(18.87\) FPS, LPIPS \(0.594\), PSNR \(11.42\), SSIM \(0.280\), and FID \(157.26\). Full-KV reports \(7.82\) FPS, LPIPS \(0.529\), PSNR \(13.75\), SSIM \(0.364\), and FID \(124.91\). Matrix + WorldKV reports \(16.25\) FPS, LPIPS \(0.462\), PSNR \(14.10\), SSIM \(0.405\), and FID \(93.56\).

These numbers support two distinct conclusions stated in the paper. First, WorldKV matches or exceeds full-KV memory fidelity at roughly \(2\times\) throughput and outperforms sliding-window inference by large margins. Second, on the short-context Matrix model, full-KV actually hurts due to compounding errors, whereas selective retrieval avoids irrelevant KV caches. A common misconception is that simply attending to more historical tokens is always beneficial; the Matrix results provide an explicit counterexample.

Throughput measurements at the last chunk of a 1-minute rollout further emphasize the systems trade-off. For LingBot-Fast, sliding window is approximately \(5.0\) FPS on H200 and \(8.1\) on B200, full-KV is approximately \(2.4\) and \(3.8\), and WorldKV is approximately \(4.8\) and \(7.7\). For Matrix-Game-2.0 on H200, sliding window is approximately \(18.9\) FPS, full-KV approximately \(7.8\), and WorldKV approximately \(16.3\). The VRAM behavior is also contrasted: full-KV memory grows linearly to out-of-memory by approximately 60 seconds, whereas WorldKV with compression and CPU offload remains nearly flat.

## 6. Ablations, limitations, and prospective extensions

The ablation studies isolate both compression and retrieval effects. For intra-chunk compression, the paper compares 3-frame chunks compressed to effective sizes of \(1.0\), \(1.25\), \(1.5\), \(2.0\), and \(2.5\) frames retained. On LingBot, the \(3\to1.5\) setting gives LPIPS \(0.455\), PSNR \(15.66\), SSIM \(0.463\), and FID \(75.64\), while \(3\to2.0\) gives LPIPS \(0.456\), PSNR \(15.65\), SSIM \(0.461\), and FID \(76.23\). On Matrix, \(3\to1.5\) gives LPIPS \(0.462\), PSNR \(14.10\), SSIM \(0.405\), and FID \(93.56\), while \(3\to2.0\) gives LPIPS \(0.453\), PSNR \(14.26\), SSIM \(0.417\), and FID \(96.00\). The paper summarizes this as evidence that moderate compression, specifically \(3\to1.5\) or \(3\to2.0\), retains fidelity nearly equal to no compression [2605.22718].

For inter-chunk coverage under a fixed 3-chunk window, storing 6 chunks and retrieving 3 with compression outperforms storing 3 chunks and retrieving 3 without compression. On LingBot, the \(6\to3\) configuration gives LPIPS \(0.455\), PSNR \(15.66\), SSIM \(0.463\), and FID \(75.64\), compared with LPIPS \(0.468\), PSNR \(15.44\), SSIM \(0.454\), and FID \(91.39\) for \(3\to3\). On Matrix, \(6\to3\) yields LPIPS \(0.462\), PSNR \(14.10\), SSIM \(0.405\), and FID \(93.56\), compared with LPIPS \(0.496\), PSNR \(13.42\), SSIM \(0.369\), and FID \(105.99\) for \(3\to3\). By contrast, \(9\to3\) is reported as too aggressive, with degraded fidelity on both models. This supports the paper’s claim that broader historical coverage helps, but over-compression discards too much.

The retrieval-algorithm ablation compares sliding-window inference, query-based retrieval, and camera-based retrieval. On LingBot, query-based retrieval reaches LPIPS \(0.490\), PSNR \(15.07\), SSIM \(0.445\), and FID \(83.20\), whereas camera-based retrieval reaches LPIPS \(0.455\), PSNR \(15.66\), SSIM \(0.463\), and FID \(75.64\). On Matrix, query-based retrieval gives LPIPS \(0.488\), PSNR \(13.58\), SSIM \(0.363\), and FID \(109.72\), while camera-based retrieval gives LPIPS \(0.462\), PSNR \(14.10\), SSIM \(0.405\), and FID \(93.56\). Both retrieval signals outperform sliding-window inference, with camera-action retrieval best.

The paper’s limitations are explicit. Fidelity is ultimately bounded by the pretrained backbone’s generation quality. On multi-minute rollouts beyond training lengths, autoregressive drift still accumulates. CPU offload latency currently prevents pure CPU storage in a real-time loop, and the paper identifies future work on asynchronous DSP transfers. Proposed directions include combining WorldKV with training-based memory modules, improving retrieval signals through learnable key-query encodings or cross-attention memory networks, optimizing host-device offloading latency through NVMe-GPU direct DMA and sparsity-aware caching, and extending the framework to open-world or RL-driven embodied agents where memory can be indexed by semantic queries. A plausible implication is that WorldKV is best understood not as a replacement for learned memory architectures, but as an inference-time systems layer that exploits the latent structure already present in KV caches.

Source: https://www.emergentmind.com/topics/worldkv