TL;DR
Encode-Think-Decode (ETD) enhances the reasoning capabilities of Large Language Models (LLMs) by isolating a small subset of reasoning-critical middle layers and training the model to loop over them recursively. This approach scales test-time compute entirely within the model's latent space, yielding up to a +28.4% relative improvement on GSM8K and +36% on MATH without adding a single parameter.
What Problem Does This Paper Address?
To make LLMs better at complex tasks, researchers typically scale up model size and training data, or use test-time compute techniques like Chain-of-Thought (CoT) prompting. However, CoT forces the model to generate explicit text tokens, which is computationally expensive and fails to capture fluid, non-verbal abstract thinking.
Meanwhile, mechanistic interpretability research shows that an LLM's reasoning computation isn't spread evenly across all layers; it is highly concentrated within specific middle layers. The authors address the challenge of scaling test-time reasoning internally within these critical latent layers, avoiding the overhead of token generation while keeping the base model architecture completely unchanged.
Methods
The authors introduce Encode-Think-Decode (ETD), which restructures a standard transformer architecture into three functional blocks:
- Latent Encoder ($E$): Transforms input text into the latent space and retrieves relevant knowledge.
- Core Recurrent "Thinking" Block ($T$): A small group of middle layers trained to iteratively process and refine abstract representations.
- Latent Decoder ($D$): Maps the refined latent representations back to the output token space.
To find the optimal boundaries for these blocks, the authors use the Kneedle algorithm to analyze the average angular distance (the directional change in hidden representations) between consecutive layers. For the OLMo-2 1B model, this analysis revealed a 7-4-5 configuration (7 encoder layers, 4 thinking layers, and 5 decoder layers).
During a lightweight "mid-training" stage (using just 1.25% of the total pretraining tokens), the model is trained to loop through the $T$ block multiple times ($k$ iterations). Crucially, this introduces no new parameters, data, or hyperparameter changes.
Additionally, they explore an Adaptive Test-Time Scaling strategy based on the Adaptive Computation Time (ACT) mechanism. A lightweight router inspects the hidden state after each iteration and dynamically decides whether a token needs more "thinking" loops or can exit early, optimizing compute allocation based on problem difficulty.
Datasets
- Training/Validation: The model utilizes the original OLMo-2 mid-training data mixture, which upsamples high-quality web documents and curated STEM references. The C4 validation dataset was used to compute the layer-wise angular distances.
- Evaluation: ETD was evaluated across 17 diverse real-world benchmarks grouped into six categories of increasing reasoning intensity:
- Factual Knowledge: TriviaQA, NaturalQuestions
- Reading Comprehension: BoolQ, OpenBookQA, DROP
- Commonsense Reasoning: CommonSenseQA, HellaSwag, SocialQA, WinoGrande
- Multi-Disciplinary Reasoning: ARC-Easy, ARC-Challenge, MMLU, MMLU-Pro, AGIEval-English
- BIG-Bench Hard (BBH)
- Mathematical Reasoning: GSM8K, MATH
Key Insights and Ideas
- Reasoning is a Middle-Layer Phenomenon: Hidden representations change direction rapidly in early layers (loading context) and late layers (formatting output), but stabilize in the middle. Looping these stable middle layers acts as an internal accelerator for multi-step reasoning.
- Targeted Looping Beats Global Looping: Looping only the identified "thinking" layers significantly outperforms baseline recursive methods that loop over all layers or arbitrary blocks. This proves that layer selection must be guided by network interpretability rather than ad-hoc choices.
- Selective Scaling: Increasing the number of latent iterations ($k$) selectively boosts performance on complex reasoning tasks (like math and logic) while leaving factual recall flat. This confirms ETD specifically amplifies reasoning rather than just memorization.
- Token-Level Dynamic Depth: Harder tokens naturally demand more iterations. By using adaptive routing, the model can spend less compute on easy tokens and save its capacity for challenging steps.
Key Results
The authors tested ETD on the OLMo-2 1B Base model, showing substantial gains as the number of iterations ($k$) scaled up:
- Mathematical Reasoning: Achieved a +28.4% relative accuracy improvement on GSM8K (moving from 44.05% to 56.56% at $k=5$) and a +36% relative improvement on MATH (at $k=3$).
- Overall Categories: Across the board, performance scaled with depth. Reading Comprehension improved by +12.1% and Multi-Disciplinary Reasoning by +12.4% at $k=5$.
- Adaptive Efficiency: The adaptive-depth ETD matched or exceeded fixed-depth performance on reading comprehension tasks (like DROP and OpenbookQA) while requiring fewer average iterations.
Limitations and Future Work
- Model Scale: Due to computational constraints, the extensive evaluation was limited to a 1B parameter model. Validating ETD on larger scales (7B, 13B+) remains an open task.
- Post-Training for Instruct Models: The current pipeline integrates ETD during mid-training. Applying it to instruction-tuned or alignment-focused models will require adapting it to the post-training stage.
- Refining Adaptive Compute: While the ACT router showed promise, optimizing the trade-off between computational cost and accuracy is an area for further refinement.
- Multimodal Expansion: The authors suggest extending recursive latent reasoning to multimodal models to see if it serves as a universal principle for representation learning across domains.
Summary updated