TL;DR
Looped language models save parameters by running the same Transformer layers multiple times, but they still pay a hefty memory tax by caching separate key-value (KV) states for every loop. Decomposed Latent Attention (DLA) slashes this memory cost by storing each token's cross-loop average at full size and compressing only the loop-to-loop differences into tiny codes. Its sliding-window sibling, DLA-SW, keeps exact KV states for recent tokens and compressed codes for older ones, achieving up to 23.5% lower memory than prior compression methods while improving task scores by an average of 2.29 points.
What Problem Does This Paper Address?
Standard Transformers grow their parameter count as they get deeper. Looped language models—such as Ouro and Huginn—sidestep this by applying a shared stack of Transformer layers repeatedly (e.g., 4 or 32 times) to boost test-time computation without adding parameters.
However, parameter sharing does not eliminate the KV cache bottleneck. During autoregressive generation, each loop produces its own distinct keys and values. A conventional implementation stores a separate KV cache for every loop, meaning memory usage scales with both sequence length and recurrence depth.
Applying existing latent KV compression methods to looped models runs into two walls:
- Mixing shared and varying signals: KV states across loops share a strong common baseline alongside loop-specific variations. Averaging them destroys the variations, while a standard low-rank bottleneck doesn't explicitly protect the shared baseline.
- Training–inference mismatch: A token's compressed cross-loop code isn't finalized until its last loop finishes, yet subsequent tokens need that code during earlier loops. Strict token-by-token training is too slow, while parallel training with approximated codes exposes the model to different histories than it will see at inference time.
Methods
The authors introduce DLA and its sliding-window variant DLA-SW, both trained end-to-end using only the standard language-model cross-entropy loss (no auxiliary distillation or reconstruction losses).
Decomposed Latent Attention (DLA)
For each token, physical layer, KV head, and key/value type (before rotary position encoding), DLA splits the $n$-loop KV trajectory into two parts:
- Shared mean: The full-dimensional average across all $n$ loops is stored directly in the cache, preserving the common reference without lossy compression.
- Loop contrasts: The remaining variation around the mean is projected onto a fixed orthonormal basis along the loop dimension (using Sylvester–Hadamard matrices for power-of-two depths, or the Helmert basis in general). Each contrast is compressed by a learned linear encoder $U_j$ into a compact code (bottleneck width $p = 16$).
During inference, each loop $r$ reconstructs its historical KV states on demand by decoding the contrast codes with learned maps $V_j$, mixing them back via the fixed basis, and adding the stored mean.
DLA with a Sliding Window (DLA-SW)
To fix the training–inference mismatch, DLA-SW retains exact, native per-loop KV states for the most recent $W$ tokens (e.g., $W = 128$) and uses DLA's compressed codes for all older tokens.
This simple boundary unlocks causal blockwise training: if the sequence is divided into blocks of length $B \le W$, all tokens within a block can be processed in parallel while reading the exact same native KV states (for recent tokens) and already-committed codes (for distant tokens) that token-sequential decoding would see.
Datasets
The authors evaluate two looped backbones—Ouro-1.4B-Thinking (24 layers, 4 loops) and Huginn-3.5B (4-layer core, 32 loops)—across three benchmarks:
- Mathematical reasoning: Trained on 7,500 problems from MATH and evaluated on MATH-500 (accuracy).
- Code generation: Trained on MBPP (filtered for evaluation overlap) and evaluated on MBPP+ v0.2.0 (pass@1 across 378 tasks).
- Document QA: Trained on QASPER v0.3 (2,593 questions) and evaluated on the 200-question QASPER subset of LongBench v1 (token-level F1, capped at 4,096 tokens).
Key Insights and Ideas
- Protect the mean, compress the differences: Keeping the cross-loop mean at full width guarantees that the average of the reconstructed states always equals the true trajectory mean, even when the bottleneck discards some loop-specific detail.
- Lightweight compression weights matter: Prior methods like Looped Latent Attention (LLA) and Hybrid Latent Attention (HLA) add massive projection weights—14.7× to 38.2× more parameter memory than DLA. On Huginn/QASPER, LLA's extra weights alone eat up 5.81 GiB, wiping out its cache savings.
- Exact local windows align training and inference: By keeping $B \le W$, DLA-SW eliminates the state mismatch between parallel training and sequential decoding without needing multi-pass approximations.
Key Results
- Memory savings: Averaged across all six backbone–task settings, DLA reduces mean resident memory by 23.5% compared to LLA (10.177 vs. 13.311 GiB), and DLA-SW reduces it by 15.2% compared to HLA (10.372 vs. 12.224 GiB). Code-only DLA stays below the uncompressed FullKV memory budget in all six settings.
- Task quality: Across all 12 paired comparisons (DLA vs. LLA, DLA-SW vs. HLA), DLA variants score 2.29 points higher on average, winning on score in 7 of 12 pairs and using less memory in all 12.
- Near-FullKV accuracy at a fraction of the memory: On Ouro/MATH-500, DLA-SW reaches 46.40% accuracy (within 1 point of FullKV's 47.40%). On Huginn/QASPER, DLA-SW cuts mean resident memory by 31.1% relative to FullKV (15.884 vs. 23.058 GiB) at a cost of just 0.58 F1 points (37.45 vs. 38.03).
Limitations and Future Work
- Short-sequence overhead: On tasks with shorter generations like MBPP+, DLA-SW's fixed 128-token raw window makes up a large fraction of the total cache, causing its mean resident memory to slightly exceed FullKV (by 0.34% on Ouro and 0.54% on Huginn).
- Task-dependent window sizes: The best sliding-window size $W$ varies by task and model—$W=64$ yields the best F1 and lowest memory on QASPER, whereas $W=128$ or $256$ helps on MATH-500 and MBPP+. Practitioners must profile memory and validate $W$ for their target workload.
- Training speed for code-only DLA: Without a sliding window, DLA relies on an eight-step interleaved training schedule to approximate sequential decoding, which takes 4.78× to 12.08× longer per update than a simpler two-pass prefill schedule.
Summary updated