Teaching Pretrained Language Models to Think Deeper with Retrofitted Recurrence

Sean Michael McLeish, Ang Li, John Kirchenbauer, Dayal Singh Kalra, Brian R. Bartoldson, Bhavya Kailkhura, Avi Schwarzschild, Jonas Geiping, Tom Goldstein, Micah Goldblum

TL;DR

Researchers have developed a method to "retrofit" standard, fixed-depth pretrained language models into depth-recurrent models that can "think deeper" by looping through their own layers. By using a training curriculum that gradually increases the number of recurrent iterations, these models achieve significantly better reasoning performance on math tasks than their non-recurrent parents, all while maintaining a constant parameter count and memory footprint.

What Problem Does This Paper Address?

Standard Large Language Models (LLMs) have a fixed computational cost per token: one forward pass through a fixed number of layers. To improve performance, we usually have to scale up the model size (more parameters) or use "Chain-of-Thought" (CoT) prompting, which consumes more output tokens and context window.

An alternative is depth-recurrence, where a model reuses a block of its layers multiple times to process a single token. While powerful, training these models from scratch is computationally expensive and slow. The authors address this by asking: Can we take a model that has already spent trillions of tokens learning language and "surgery" it into a recurrent model? This would allow us to decouple a model's parameter count from its "thinking time" at inference, without the massive cost of training from scratch.

Methods

The authors propose a "retrofitting" pipeline that transforms models like Llama-3.2-1B, TinyLlama, and OLMo into recurrent versions.

  1. Model Surgery: They divide the pretrained layers into three sections: a Prelude (early layers), a Recurrent Block (a middle chunk that gets looped), and a Coda (final layers). To keep the parameter count efficient, they often remove some intermediate layers during this process.
  2. Recurrent Architecture: The output of the Recurrent Block is fed back into itself. To bridge the gap between the Prelude's static output and the Recurrent Block's changing state, they use a linear adapter.
  3. Training Curriculum: To save compute, they don't train with 32 loops immediately. They use a curriculum that starts with a low number of recurrences and gradually increases the mean (sampled from a Poisson-Lognormal distribution) as training progresses.
  4. Two-Phase Training:
    • Phase 1 (Healing): A short period of training on general data (FineWeb-Edu) to help the model recover its basic language abilities after the "trauma" of layer removal.
  5. Phase 2 (Reasoning): Continued training on high-quality math data to teach the model to leverage its new recurrent depth for problem-solving.
  6. Optimization: They found that the Muon optimizer was significantly more stable and effective for training these recurrent structures than standard AdamW.

Datasets

  • General/Healing: FineWeb-Edu was used to maintain general language modeling performance.
  • Math/Reasoning: Nemotron-CC-Math-v1 and Nemotron-SFT-v1-Math provided the specialized data needed to teach the model to "think" through complex problems.
  • Evaluation: The models were tested on standard reasoning benchmarks (GSM8K, MATH) and general knowledge suites (MMLU, Hellaswag, Arc-Challenge, etc.).

Key Insights and Ideas

  • Pretraining is a Head Start: Initializing a recurrent model from a pretrained fixed-depth model is vastly more efficient than random initialization. The "Llama-initialized" recurrent model outperformed the "randomly-initialized" version almost immediately in training.
  • Latent Reasoning vs. Verbal Reasoning: Unlike Chain-of-Thought, where the model explains its work in text, depth-recurrence allows reasoning to happen in the latent space. This potentially offers higher information bandwidth and doesn't clutter the context window.
  • Test-Time Scaling: A major "aha" moment is that these models exhibit a clear scaling law at inference time. By simply telling the model to loop 32 times instead of 1, accuracy on difficult math problems jumps significantly without changing a single weight.
  • The Importance of the Coda: The authors found that having a non-zero number of layers in the "Coda" (the post-recurrence layers) is critical for performance, likely acting as a necessary "decoder" for the results of the internal reasoning.

Key Results

  • Math Gains: A retrofitted TinyLlama (4,8,4 configuration) achieved 51.2% on GSM8K and 14.2% on MATH. For context, the base non-recurrent TinyLlama scores significantly lower on these tasks when given the same training budget.
  • Efficiency: Recurrent models achieved higher accuracy than their non-recurrent parents even when controlling for the total number of training FLOPs.
  • Outperforming Larger Models: The authors' 1B-parameter retrofitted models outperformed the Huginn-0125 (3.5B parameters)—a model specifically trained for recurrence from scratch—on both MMLU and GSM8K.
  • General Capabilities: Thanks to the "healing" phase, the models maintained high scores on general benchmarks like Hellaswag and Arc-Challenge, proving that you don't have to sacrifice general knowledge to gain reasoning depth.

Limitations and Future Work

  • Scale: The study focused on 1B-parameter models. While promising, it remains to be seen if these retrofitting techniques scale effectively to 70B+ parameter models.
  • Adaptive Stopping: Currently, the user must decide how many loops the model performs. A major future direction is "native adaptivity"—teaching the model to decide for itself when it has "thought enough" and should exit the loop.
  • Optimal Surgery: The choice of which layers to keep or drop was largely empirical. The authors suggest that more principled methods for layer selection during surgery could further improve efficiency.
  • Harder Problems: The authors noted the challenge of training models to recur even deeper at test time to solve problems significantly harder than those seen during training.

Summary updated

BibTeX
@inproceedings{mcleish2026teaching,
  author = {Sean Michael McLeish and Ang Li and John Kirchenbauer and Dayal Singh Kalra and Brian R. Bartoldson and Bhavya Kailkhura and Avi Schwarzschild and Jonas Geiping and Tom Goldstein and Micah Goldblum},
  title = {{Teaching Pretrained Language Models to Think Deeper with Retrofitted Recurrence}},
  booktitle = {COLM},
  year = {2026},
  url = {https://openreview.net/forum?id=PXVQTHYwgt},
}
Figure