| name | world-cache |
| title | WorldCache: Accelerating World Models for Free via Heterogeneous Token Caching |
| version | 0.0.2 |
| engine | skillxiv-v0.0.2-claude-opus-4.6 |
| license | MIT |
| url | https://arxiv.org/abs/2603.06331 |
| keywords | ["World Models","Inference Optimization","Caching","Diffusion Models","Token Prediction"] |
| description | Accelerates iterative world model inference by classifying tokens by temporal curvature (predictability) and applying differentiated caching: stable tokens reused, linear tokens extrapolated, chaotic tokens updated. Achieves 3.7x speedup with 98% rollout quality. |
WorldCache: Heterogeneous Token Caching for Fast World Model Rollouts
Diffusion-based world models require iterative denoising at each inference step, making them prohibitively slow for real-time simulation. Token heterogeneity in world models—where structural features change nonlinearly while background elements evolve smoothly—makes uniform caching strategies fail. Some tokens can be safely reused, others need linear extrapolation, and critical chaotic tokens demand full updates. WorldCache exploits this heterogeneity through curvature-guided classification, achieving 3.7x speedup.
Core Concept
Rather than caching all tokens uniformly or recomputing everything, classify tokens into three categories based on temporal curvature (local nonlinearity of token trajectory):
- Stable tokens (low curvature): Evolve predictably; directly reuse from cache
- Linear tokens (moderate curvature): Evolve smoothly; use first-order extrapolation
- Chaotic tokens (high curvature): Exhibit sharp nonlinear changes; apply damped update mixing recent velocities
Monitor only chaotic tokens for drift accumulation, triggering full backbone evaluation only when their drift exceeds threshold. This avoids per-token overhead while maintaining quality on critical features.
Architecture Overview
- Curvature Scoring: Measure temporal nonlinearity of each token's evolution across denoising steps
- Token Classification: Partition tokens into stable/linear/chaotic based on curvature threshold
- Heterogeneous Prediction: Apply differentiated strategies per class
- Drift Monitoring: Accumulate normalized drift signal from chaotic tokens only
- Adaptive Skipping: Trigger full backbone evaluation when chaotic-token drift exceeds threshold η
Implementation Steps
Implement curvature-based token classification and heterogeneous caching strategies within a diffusion world model loop.
Compute Curvature Score
Measure token-level temporal nonlinearity using discrete curvature of the token's trajectory:
import torch
import numpy as np
def compute_token_curvatures(token_history, window_size=3):
"""
Compute curvature (local nonlinearity) for each token position.
Args:
token_history: tensor of shape [num_steps, num_tokens, feature_dim]
tracking token evolution across denoising steps
window_size: number of consecutive steps for local curvature (typically 3)
Returns:
curvatures: [num_tokens] tensor with scalar curvature per token
"""
num_steps = token_history.shape[]
num_tokens = token_history.shape[]
curvatures = torch.zeros(num_tokens, device=token_history.device)
num_steps >= window_size:
recent = token_history[-window_size:, :, :]
v1 = recent[] - recent[]
v2 = recent[] - recent[]
acceleration = v2 - v1
vel_magnitude = torch.norm(v1, dim=, keepdim=) +
curvatures = torch.norm(acceleration, dim=) / vel_magnitude.squeeze()
curvatures
():
low_thresh, high_thresh = curvature_thresholds
token_classes = torch.zeros_like(curvatures, dtype=torch.long)
token_classes[curvatures >= low_thresh] =
token_classes[curvatures >= high_thresh] =
token_classes