Enabling Dynamic Computation in Looped LMs

Aayush Mishra, Arnau Padrés Masdemont, Victor Conchello Vendrell, Jordi Ros Giralt, Arash Behboodi, Fabio Valerio MassoliarXiv 2026

TL;DR

This paper introduces Ragged KV and Global Prior Enforcement, two critical fixes that finally unlock the "dynamic computation" promise of Looped Language Models. By allowing tokens to exit early without breaking the KV cache for others and training the model to recognize token difficulty, the authors achieve up to a 30% reduction in FLOPs and memory while maintaining full-depth performance.

What Problem Does This Paper Address?

Looped Language Models (LMs) are a clever way to build parameter-efficient models: instead of having 80 unique layers, you might have 20 layers that the model "loops" through four times. While this saves parameters, it’s only truly efficient if the model can perform dynamic computation—exiting early on "easy" tokens (like punctuation) and spending more time on "hard" ones (like complex reasoning).

However, existing state-of-the-art looped models (like the Ouro series) fail to realize this in practice due to two main hurdles:

  1. The Cache Problem: In standard attention, each loop iteration requires its own Key-Value (KV) cache. If token A exits at loop 2, but a future token B needs to attend to token A at loop 4, token A's loop 4 KV entry doesn't exist. This forces models to compute all loops for all tokens just to keep the cache consistent.
  2. The Training Problem: Current training objectives use "local" regularization, which forces every single token to have a similar distribution of exit depths. This results in a model that treats every token with the same average effort, defeating the purpose of difficulty-aware computation.

Methods

The authors propose three primary innovations to bridge the gap between theory and practice:

  • Ragged KV: Instead of forcing full computation, they propose a "best-available" caching strategy. When a token exits at depth $d$, its KV entries for that depth are treated as "final." Any future tokens needing deeper KV entries for that position simply "alias" (reuse) the logical pointer to that final entry.

    Figure 1: Ouro forces full-depth computation even after a token exits, as future tokens may need it. This makes early-exit practically useless. Ragged KV enables true early-exit by aliasing deeper blocks to the best-available cache. It avoids forced computation and saves memory+FLOPs during inference. Surprisingly, it works out-of-the-box for Ouro models! On the right, we compare fixed- depth (1-4 loops) with Ragged KV at different exit thresholds on BigBenchHard (details in §E.1). Ragged KV unlocks significantly higher performance at low average decode depths.
  • Global Prior Enforcement: Rather than regularizing each token's exit gate individually, the authors regularize the mean exit distribution across an entire batch. This gives the model the freedom to be "peaky" and confident—exiting very early on easy tokens and very late on hard ones—as long as the average behavior matches the desired prior.

    Visualizing how Global Prior Enforcement allows for confident, context-specific exits compared to the high-entropy "fuzzy" exits of Local Enforcement.
  • Ragged-Aware Training (RA): To fix the mismatch between dense training and "ragged" inference, the authors alternate training steps. One step uses standard dense computation to train the exit policy, while the next step uses a sampled "ragged" pass to ensure the model's representations remain robust even when attending to aliased KV entries.

Datasets

The researchers validated their approach using a mix of pre-training and downstream evaluation:

  • Pre-training: A 160M parameter Ouro-style model was trained from scratch on 20B tokens of FineWeb-edu.
  • Evaluation: They tested the publicly available Ouro-1.4B and Ouro-2.6B (both standard and "thinking" versions) across a massive battery of benchmarks, including MMLU, ARC-C, HellaSwag, GSM8K, MATH500, and reasoning-heavy tasks like AIME and GPQA-Diamond.

Key Insights and Ideas

  • Ouro models were "faking" it: The authors discovered that existing Ouro models weren't actually performing dynamic jumps. Most tokens exited at the same depth as their neighbors. Ragged KV works "out-of-the-box" for these models precisely because they behave like fixed-depth models.
  • Heterogeneity is the goal: By switching to a global prior, the model finally learns to distinguish between "filler" tokens and "content" tokens. Qualitative analysis shows the model naturally spends less time on commas and spaces and more time on complex words.
  • Symbiotic Training: Ragged-aware training doesn't just fix the cache mismatch; it actually improves performance. In some cases, the "ragged" model performed better than the full-depth fixed model because it wasn't forced to perform unnecessary, potentially noisy extra computations on easy tokens.

Key Results

  • Efficiency Gains: The approach enables a 30% reduction in both FLOPs and KV memory while retaining the performance of a full-depth model.
  • Performance Frontier: On the BigBenchHard (BBH) benchmark, Ragged KV created a new "frontier," providing significantly higher accuracy at lower average decode depths compared to fixed-depth baselines.
  • Thinking Models: For Ouro-2.6B-Thinking, the model maintained high performance on difficult math tasks (AIME) while significantly reducing the average number of loops required per token.
Qualitative visualization of exit depths, showing how Global Enforcement results in truly heterogeneous, difficulty-aware exits.

Limitations and Future Work

  • Scale: Due to compute constraints, the authors could not perform full-scale pre-training on models larger than 160M, leaving the behavior of 70B+ looped models as an open question.
  • System Overhead: While the logical FLOP savings are clear, the current vLLM implementation of depth-batching has some overhead. The authors suggest that specialized kernels for dynamic depth-batching are needed to realize the full throughput potential.
  • Prefill vs. Decode: The 2.6B non-thinking Ouro model showed some instability during the "prefill" stage when using ragged caches, suggesting that the very beginning of a prompt is highly sensitive to cache precision.

Summary updated

BibTeX
@misc{mishra2026enabling,
  author = {Aayush Mishra and Arnau Padrés Masdemont and Victor Conchello Vendrell and Jordi Ros Giralt and Arash Behboodi and Fabio Valerio Massoli},
  title = {{Enabling Dynamic Computation in Looped LMs}},
  year = {2026},
  eprint = {2610.09013},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.09013},
}
Figure