Full text not available for this paper
Summary (Overview)
- This paper provides a mechanistic investigation of length generalization in Looped Transformers, comparing two configurations: Matched-Recurrence Looped Transformer (MR-Loop) and Decoupled-Recurrence Looped Transformer (DR-Loop).
- The authors evaluate three iterative task families—polynomial iteration, finite-state composition, and knowledge-graph traversal—using attention analysis, intermediate-state decoding (logit lens), and causal interventions (activation patching).
- Key finding 1: MR-Loop and DR-Loop achieve length generalization through distinct recurrent mechanisms: MR-Loop uses a fixed readout accumulator with advancing relation selection, while DR-Loop propagates a computational frontier through the sequence.
- Key finding 2: Extreme-length failure arises from degradation of computation-ready states and limited self-correction, allowing local errors to persist and compound.
- Key finding 3: Length generalization does not imply faithful step-by-step reasoning; models can exploit task compressibility shortcuts without representing every intermediate state.
Introduction and Theoretical Foundation
Background and Motivation
- Many reasoning tasks require executing the same computation for a variable, previously unseen number of steps (Schwarzschild et al., 2021; Thomm et al., 2024).
- Standard Transformers struggle with length generalization because their computational depth is fixed while the required number of sequential operations grows (Hahn, 2020).
- Looped Transformers repeatedly apply shared Transformer blocks, allowing computational depth to grow without adding parameters (Dehghani et al., 2019; Geiping et al., 2025).
Theoretical Framework
The paper defines the task horizon (number of ground-truth transitions) separately from the recurrent depth (number of times the shared Transformer stack is applied). These need not coincide because one recurrent pass updates all sequence positions simultaneously.
A looped Transformer is formalized as repeatedly applying a parameterized stack :
where specifies how input embeddings enter the recurrent computation.
Two Loop Configurations
| Feature | MR-Loop | DR-Loop |
|---|---|---|
| Recurrence-depth scheduling | Matched to input length () | Decoupled from input length |
| Recurrent update | ||
| Answer readout | From [EQ] delimiter | From padded output position |
| Training length curriculum | Increases on fixed schedule | Increases when accuracy threshold met |
| Recurrent depth sampling | (input length) | , clipped to |
Sequential Composition Tasks
All tasks instantiate: input with transitions , trained only on the final state with no intermediate supervision.
Table 1: Sequential composition tasks
| Task | State | Operator / transition | Varied parameters |
|---|---|---|---|
| Polynomial | |||
| FSC | |||
| KG |
Methodology
Models
- All checkpoints use 3 shared Transformer blocks, 2 attention heads per block, width 256, no positional embeddings.
- Trained on inputs up to length (11 hops), evaluated on longer sequences.
Analytical Tools
1. Attention Analysis: Tracking how information routes across token positions across recurrent passes, identifying whether attention patterns remain stationary or advance.
2. Logit Lens Decoding: Applying the model's final normalization and output projection to intermediate residual states:
3. Activation Patching / State Swaps: Replacing internal residual states with donor activations:
Key Concepts Identified
- Live–Consumed direction (MR-Loop): A shared residual vector estimated from the difference between a relation token's "live" state (scheduled fetch loop) and "consumed" state (two loops later):
- Fresh–Aged direction (DR-Loop): A shared direction distinguishing newly computed entity states (usable for composition) from aged states (still decodable but unusable).
Empirical Validation / Results
RQ1: How Do Looped Transformers Achieve Length Generalization?
MR-Loop: Fixed Readout with Advancing Relation Selection
- Attention patterns: (1) Traveling previous-token pattern—query at attends to ; (2) Fixed-query tracking—[EQ] query attention shifts to at loop . Both advance by one token per loop beyond training length.
- Intermediate value tracking: The [EQ] readout recovers intermediate entity with 100% accuracy beyond training length, while relation positions remain near zero.
- Causal tests: State-swap interventions confirm that relation-token states control selection and [EQ] supplies the entity operand. The update follows .
- Live–consumed cue transfer: At on length-20 inputs, consumed-state replacement reduces accuracy to 9.4%; adding restores it to 93.8%, matching native performance.
DR-Loop: Propagating State Frontier
- Attention propagation: Localized attention regions advance along the main diagonal and first subdiagonal by 1–2 positions per recurrent iteration, extending beyond training length.
- Intermediate-state propagation: Entities become decodable at relation position ; on 14-hop queries, and reach peak probabilities ~0.90–0.92 beyond training depth.
- Causal evidence: Patching position 5 makes counterfactual entities and decoded in 90.6% and 71.9% of examples; patching position 12 (beyond training) yields 56.25% counterfactual argmax.
- Fresh–aged distinction: An aged representation of remains decodable at 96.9% argmax accuracy, yet its next-hop score falls from 0.650 (fresh) to 0.038 (aged). Adding the fresh–aged direction restores it to 0.698.
RQ2: Why Does Length Generalization Fail at Extremely Long Horizons?
Two coupled causes identified:
1. Degradation of computation-ready states:
- MR-Loop: Transplanting a same-loop [EQ] state from a length-20 prefix into a length-30 run restores next-hop accuracy from 5.5% to 83.6%. The live–consumed cue projection declines from 28.0 (key 11) to 9.1 (key 23).
- DR-Loop: Mean per-example peak correct-entity probability falls from 0.982 (hop 5) to 0.713 (hop 16).
2. Limited self-correction:
- Survival probability formulation:
where is the conditional first-error hazard. Even constant hazard yields geometric decay .
- MR-Loop native analysis: Only 2/21 first-error trajectories at have a later correct intermediate; 0/21 sustained recovery; at , no sustained recovery and 0/64 final-answer correctness after error.
RQ3: Does Successful Length Generalization Imply Faithful Iterative Computation?
Length generalization success is task- and model-dependent (Table 4):
| Task | MR-Loop | DR-Loop |
|---|---|---|
| Polynomial (composite moduli) | ✓ | ✓ (some) |
| Polynomial (prime moduli) | × (except m=11) | × |
| FSC (all configs) | ✓ | × with 16 functions |
| KG (all 6 configs) | ✓ | ✓ (3 of 6) |
Faithfulness gap: Successful models can produce correct final answers while ground-truth intermediates are only weakly recovered. This is explained by task compressibility: when for (the remaining composition merges states), distinguishing intermediate states is unnecessary. Compressive settings (composite moduli, non-bijective FSC) admit shortcut solutions; information-preserving settings (prime moduli, bijective FSC, permutation KG) require trajectory preservation.
Theoretical and Practical Implications
Common Representational Principle
Both architectures reveal that semantic content alone is insufficient for recurrent reuse. The paper identifies computational status as a distinct representational property:
- MR-Loop: Live vs. consumed relation states control selection.
- DR-Loop: Fresh vs. aged intermediate states control composition usability.
These transferable residual directions causally control whether represented information can participate in subsequent computation, including beyond the training horizon.
Distinguishing Behavioral from Mechanistic Length Generalization
The paper separates three distinct concepts:
- Behavioral length generalization: Correct extrapolated answers.
- Faithful step-by-step reasoning: Recovery of ground-truth intermediate states.
- Reusable computation: Preservation of computation-ready states.
Implications for Recurrent Reasoning Design
- Reliable recurrent reasoning depends on preserving and refreshing internal states, not merely allocating more test-time computation.
- The survival analysis provides a framework for understanding how state degradation and error compounding interact.
- Task compressibility constrains the solution space, determining whether lossy shortcuts are available.
Conclusion
Main Takeaways
- Distinct mechanisms underlie length generalization: MR-Loop uses a fixed accumulator with advancing operator selection; DR-Loop uses a propagating state frontier.
- Computational status is critical: Representing correct information is not enough; it must remain in a computationally usable state for the next transition.
- Extreme-length failure is systematic: Computation-ready states degrade, and learned dynamics provide limited correction, allowing errors to persist and compound.
- Faithfulness is not guaranteed: Successful extrapolation does not imply faithful execution of the intended step-by-step procedure, especially when task structure permits lossy shortcuts.
Future Directions
- Architecture ablations: Systematic study of how recurrence scheduling, normalization, and readout design affect the identified mechanisms.
- Scaling: Test these principles at larger scales and in more naturalistic reasoning settings.
- Alternative configurations: Explore other looped Transformer designs beyond the matched/decoupled recurrence distinction.
Related papers
- Masked Erosion: How Acceptance Gates Lose Redundant Safeguards in Self-Improving Agents
Acceptance gates in self-improving agents cannot detect loss of redundant safeguards because overlapping protections mask deletions, eroding safety margin until a model swap or failure exposes harm.
- LoopFold: Parallelizing Recurrent Depth in Looped Transformers
LoopFold decouples recurrent depth from sequential decoding depth by predicting and correcting parallel loop states, cutting latency 46% while improving zero-shot accuracy by 2.20 points.
- What Does a Harness Repair? A Preregistered Study of Visibility, Baseline Adequacy and Evaluation Defects
Preregistered harness-search studies show most accuracy gains are visibility artifacts, and searched harnesses failed to beat trivial constant-label baselines despite large nominal improvements.