Learning from Recurrence: Internalizing Depth-Induced Preferences in Looped Language Models

Authors: Hui Chen (University of Wisconsin-Madison), Joshua Elsdon (Microsoft), Can Goksen (Microsoft)

Summary (Overview)

  • The paper introduces preference write-back, a self-distillation method for looped language models where deeper recurrent executions generate training trajectories that teach the shared recurrent block through shallow (single-pass) training, without reference answers or correctness filtering.
  • The authors show that additional recurrent depth primarily redistributes probability among already top-ranked tokens (top token unchanged 95.6% of positions across 4 passes), occasionally changing the preferred continuation.
  • Single-pass learning outperforms full-depth learning on the same targets: on GSM8K, one-pass training reaches 62.70% vs. 56.86% for four-pass training at four-pass inference in the mean-depth-4 model.
  • Updates learned through one pass remain useful at later recurrent passes: using the updated block only on passes 2–4 recovers 62.47% of the 62.70% full-update accuracy (6.29 of 6.52 points).
  • The method generalizes across multiple looped model families (Retro-OLMo, Retro-LLaMA, Huginn, LoopUS, Ouro), improving one-pass and multi-pass accuracy in most cases while retaining non-mathematical capabilities (OLMES average changes <0.2 points).

Introduction and Theoretical Foundation

Background

Looped Transformer language models scale inference-time computation by reapplying recurrent blocks before emitting each token, decoupling computation depth from layer depth. This makes recurrent depth attractive for:

  • Serving efficiency: parameter sharing, depth-wise batching, KV-cache reuse
  • Latent test-time computation: iterating in hidden-state space before token emission

Key Research Questions

The paper addresses a fundamental gap: although reapplying a shared block makes additional depth available, the model must learn to use it. The central questions are:

  1. What do additional passes actually change in predictions?
  2. Can the shared block learn from its own deeper predictions?

Theoretical Foundation

The work connects to:

  • Iterative computation in controlled settings: recurrent models can learn genuine iterative algorithms (Schwarzschild et al., 2021; Bansal et al., 2022; Saunshi et al., 2025)
  • Self-distillation: changes in a model's own predictive distribution can provide useful training signal (Zhang et al., 2026)
  • Weight-tied architectures: Universal Transformers (Dehghani et al., 2019), ALBERT (Lan et al., 2020)

Methodology

Architecture: Looped Language Model

The model retrofits OLMo-2 1B stage-1 checkpoint with:

  • Input stack PP: first 7 Transformer blocks
  • Shared recurrent core FθF_\theta: middle 4 blocks
  • Output stack CC: final 5 blocks
  • Injection projection AψA_\psi: position-wise linear projection

The recurrent computation for a prefix x1:nx_{1:n} is:

si=Fθ(Aψ([si−1;e])),i=1,…,rs_i = F_\theta(A_\psi([s_{i-1}; e])), \quad i = 1, \dots, r

where e=P(x1:n)∈Rn×de = P(x_{1:n}) \in \mathbb{R}^{n \times d} is the input encoding, sis_i is the state after pass ii, and [⋅;⋅][\cdot; \cdot] denotes concatenation along the hidden dimension.

The next-token distribution after rr passes is:

pr(⋅∣x1:n)=softmax(W[C(sr)]n)p_r(\cdot \mid x_{1:n}) = \mathrm{softmax}(W[C(s_r)]_n)

Mid-Training

  • Continued causal language modeling on the Dolmino mixture
  • Execution depth sampled from a Poisson-lognormal distribution: r∼πtr \sim \pi_t with mean μt\mu_t
  • Recurrence curriculum: gradually increase mean depth μt\mu_t toward target m∈{4,8,32}m \in \{4, 8, 32\}

Preference Write-Back

Three decoupled depths:

  • Teacher depth rTr_T: execution whose behavior is retained as supervision
  • Training depth rLr_L: recurrent computation through which supervision acts
  • Inference depth rEr_E: depth at which updated computation is reused

Supervision construction: For a prompt xx, greedy decoding at teacher depth produces:

y^t=arg⁡max⁡v∈VprT(0)(v∣x,y^<t),t=1,…,T\hat{y}_t = \arg\max_{v \in \mathcal{V}} p_{r_T}^{(0)}(v \mid x, \hat{y}_{<t}), \quad t = 1, \ldots, T

Training objective (completion-only next-token likelihood):

LrL(θ)=−1∑jTj∑j=1N∑t=1Tjlog⁡prL(y^t(j)∣x(j),y^<t(j);θ,ϕ)\mathcal{L}_{r_L}(\theta) = -\frac{1}{\sum_j T_j} \sum_{j=1}^{N} \sum_{t=1}^{T_j} \log p_{r_L}\left(\hat{y}_t^{(j)} \mid x^{(j)}, \hat{y}_{<t}^{(j)}; \theta, \phi\right)

Only the shared recurrent core θ\theta is updated; all other parameters ϕ\phi (including injection projection) remain fixed.

Empirical Validation / Results

Main Results: Mathematical Reasoning

Table 1: Accuracy before/after write-back across recurrent depths

ModelGSM8K (m)GSM1K (m)SVAMP (m)Avg. vs. control
Non-looped control44.0539.8356.50-
Mean depth 456.18 (+27.5%)51.12 (+28.3%)63.30 (+12.0%)+26.5%
+ Self-distillation62.70 (+42.3%)54.36 (+36.5%)64.70 (+14.5%)+34.9%
Mean depth 856.33 (+27.9%)52.53 (+31.9%)66.00 (+16.8%)+39.9%
+ Self-distillation62.85 (+42.7%)56.02 (+40.6%)65.20 (+15.4%)+43.6%
Mean depth 3257.01 (+29.4%)53.36 (+34.0%)67.70 (+19.8%)+34.0%
+ Self-distillation62.09 (+41.0%)54.36 (+36.5%)65.70 (+16.3%)+46.2%

Key findings:

  • Write-back increases accuracy in 15 of 18 model–benchmark comparisons at mean depths
  • Final models achieve 34.9–46.2% mean relative gains over non-looped control
  • On GSM8K, mean-depth-4 improves from 40.86% (1 pass) to 56.18% (4 passes) to 62.70% (after write-back)

Learning Depth Matters

Table 4: Single-pass vs. full-depth learning

ModelTeacherTrainingGSM8K (m)GSM1K (m)SVAMP (m)
Mean depth 44162.70 (+11.6%)54.36 (+6.3%)64.70 (+2.2%)
4456.86 (+1.2%)51.04 (-0.2%)62.20 (-1.7%)
44† (last pass only)56.63 (+0.8%)49.96 (-2.3%)61.30 (-3.2%)

Gradient analysis explains the advantage:

  • One-pass learning places loss directly on first-pass state
  • With four-pass learning, gradient at first-pass state has only 7.3% of the norm of direct one-pass gradient and cosine similarity 0.009
  • First and fourth applications account for 5.4% and 59.1% of per-pass gradient norms under four-pass learning

Pass-Wise Interventions

Table 3: Using updated block at different passes (GSM8K, 4-pass inference)

Pass 1Pass 2-4Accuracy (%)
✗✗56.18
✓✗56.25 (+0.1%)
✗✓62.47 (+11.2%)
✓✓62.70 (+11.6%)

The later-pass replacement recovers 6.29 of 6.52 points of the fully updated model's gain.

Recipe Dependence

Table 5: Input injection matters

InjectionTraining depthGSM8K gainGSM1K gainSVAMP gain
✓1+11.6%+6.3%+2.2%
✓4+1.2%-0.2%-1.7%
✗1+3.1%+0.0%-3.7%
✗4-0.1%+3.1%+0.5%

With input injection, one-pass learning wins; without it, four-pass learning is comparable or better.

Transfer Across Model Families

Table 6: Write-back on public looped checkpoints (GSM8K)

ModelmDepth 1 gainDepth m gain
Mean depth 4 (ours)4+4.6%+7.7%
Retro-OLMo16+15.2%+6.0%
Retro-LLaMA8+25.7%+5.3%
Huginn (3.5B)32N/A (0→1.59)+0.9%
LoopUS8+73,300% (0.08→55.65)-0.3%
Ouro4+47.8%-3.1%

Non-Mathematical Capabilities Retained

Table 8: OLMES 17-task average

ModelAll (17)
Non-looped control53.94
Mean-depth-4 Looped LM56.88 (+6.3%)
+ Self-distillation57.02 (+6.9%)
Mean-depth-8 + Self-distillation57.09 (+7.1%)
Mean-depth-32 + Self-distillation56.40 (+5.6%)

Write-back changes the 17-task average by less than 0.2 percentage points for each model.

Theoretical and Practical Implications

Theoretical Implications

  1. Depth-induced preferences as learnable signal: The paper demonstrates that deeper recurrent execution produces preference changes that serve as useful training signal—a form of "learning from one's own computation."

  2. Decoupling behavior exposure from incorporation: Separating teacher depth (rTr_T), training depth (rLr_L), and inference depth (rEr_E) reveals that the computational path connecting supervision to parameters matters as much as the supervision itself.

  3. Gradient analysis explains shallow-learning advantage: Full-depth training dilutes and redirects gradients away from early-pass states (cosine similarity 0.009 to direct one-pass gradient), explaining why single-pass learning is more effective with input injection.

  4. Recipe-dependent learning: The advantage of shallow learning depends on whether input injection is used, linking how recurrent computation is developed to how it can be improved.

Practical Implications

  1. Efficient self-improvement: Models can improve their reasoning without reference answers, correctness filtering, or external supervision—only their own deeper executions.

  2. Parameter-efficient updates: Only the shared recurrent core is updated (4 of 16 blocks), keeping the rest of the model frozen.

  3. Cross-model applicability: The method transfers to diverse looped architectures (fixed-injection, gated, non-injected), suggesting broad utility.

  4. Test-time compute scaling: The approach enhances the value of inference-time computation, complementing serving efficiency gains of looped models.

Conclusion

The paper demonstrates that once a model learns to benefit from recurrent depth, its own deeper executions can provide supervision for further learning. Key takeaways:

  1. Preference write-back improves both one-pass and multi-pass accuracy across six mathematical reasoning benchmarks, with mean relative gains up to 46.2% over non-looped controls.

  2. Single-pass learning outperforms full-depth learning on the same targets in input-injected models, with gradient analysis revealing that deeper training dilutes the signal reaching early-pass states.

  3. Shallow-learned updates remain useful at later recurrent passes, recovering nearly the entire four-pass gain when applied only at passes 2–4.

  4. The advantage of shallow learning depends on the recurrent recipe, connecting the development of recurrent computation to its subsequent improvement.

Future Directions

The findings open up broader questions about how behavior emerging during recurrent computation development can guide continued learning, including:

  • What other behaviors beyond preference refinement emerge with depth
  • How to design recurrent recipes that maximize learnability from depth-induced behavior
  • Whether these mechanisms scale to larger models and more diverse tasks

Related papers