RecurTrace: Adaptive Latent Reasoning with Loop-Time Memory

Yuxiang Wang, Kunyu Feng, Yingda Shen, Haoning Xu, Junyu Wang, Zhizheng WuarXiv 2026

TL;DR

RecurTrace introduces a novel way to scale an LLM's "thinking time" in latent space by repeatedly cycling hidden states through a small block of middle layers. By incorporating Loop Memory Attention to prevent the model from forgetting earlier iterations and an oracle-distilled halting head to dynamically adjust compute based on question difficulty, RecurTrace achieves significant accuracy gains across reasoning tasks without adding parameters or generating extra tokens.

What Problem Does This Paper Address?

Standard Transformers spend the exact same amount of computational depth on easy questions ("What is 2+2?") as they do on hard ones ("Solve this complex calculus problem"). While "Chain-of-Thought" (CoT) prompting allows models to spend more compute by generating more tokens, it is slow and expensive.

An alternative approach is latent looping—re-running a block of middle layers multiple times to increase effective depth without emitting extra tokens. However, existing latent looping methods suffer from two major flaws:

  1. Forgetting: The looped layers only see the output of the immediately preceding iteration, meaning crucial information computed in earlier loops gets overwritten or lost.
  2. Fixed Budgets: Models usually run a fixed number of loops for the entire dataset, wasting compute on easy inputs and under-allocating it for hard ones. Traditional adaptive halting mechanisms (like ACT or PonderNet) often collapse, failing to find the right balance and defaulting to stopping after just one loop.

Methods

RecurTrace addresses these limitations by modifying a pretrained, frozen language model (specifically Qwen3 variants) with two lightweight, trainable components (accounting for only ~2.2% of the model's total parameters):

  • Loop Memory Attention (LMA): Instead of only passing the latest hidden state forward, LMA allows each token to attend to its own historical states from previous iterations along a "loop-time" axis. It uses a compact sliding window ($W=3$) to keep memory costs constant. Crucially, it only looks at the same token position across time, preventing any future token leakage.
  • Oracle-Distilled Halting Head: To decide when to stop looping, the authors train a sequence-level halting head. Instead of using generic mathematical penalties (like ACT), they use an offline "oracle" that checks whether running a deeper loop actually reduces the model's cross-entropy loss on that specific training example. At inference, the model loops until the halting head's confidence falls below a threshold, subject to a minimum floor ($T_{min}=2$).
Figure 2: RecurTrace architecture. A frozen encoder feeds a weight-tied block that recurs to variable depth, re-injecting its input after the first loop. Before each looped layer, Loop Memory Attention reads same-position states from a three-loop sliding window. Random-depth training supports multiple depths, while an oracle-distilled halting head predicts whether another loop will help, allocating more computation to hard inputs. After halting, the remaining frozen layers generate the answer.

Datasets

The model was trained on a diverse 1.15 million direct-answer reasoning mixture consisting of:

  • Synthetic Generators: Pointer chasing, symbolic state tracking, and algorithmic arithmetic.
  • Real Math Benchmarks: GSM8K, MATH, AQUA-RAT, MetaMathQA, Orca-Math, and MathQA.
  • Multi-hop QA & Logic: HotpotQA, MuSiQue, StrategyQA, ProofWriter, and CLUTRR.

Evaluation was performed across 14 train-covered tasks and a "classic" suite of 8 general benchmarks (including MMLU, ARC, and HellaSwag) to test generalization.

Key Insights and Ideas

  • Memory is Essential for Recurrence: The authors found that without LMA, plain looping actually hurts performance on larger models due to "representational drift" (the hidden states degrade rather than refine). Memory turns extra iterations into consistent optimization.
  • Task Structure Dictates Memory Utility: For stateless tasks like "pointer chasing" (where you just look up the next step), memory isn't needed. For stateful tasks like arithmetic or state tracking, memory is vital. RecurTrace uses a token-wise gate to automatically open or close the memory path depending on the task structure.
  • Why Traditional Halting Fails: Standard adaptive compute methods like ACT and PonderNet apply a penalty for taking extra steps. When applied post-hoc to a frozen backbone, this penalty signal completely overwhelms the quality signal, causing the model to collapse to a single loop. Direct oracle distillation avoids this pitfall.

Key Results

  • Beating Fixed Depth: On the MathQA benchmark (1.7B model), RecurTrace achieved 56.92% accuracy with an average of 2.04 loops. This outperforms the best fixed-loop configuration (54.71% at 2 loops) and significantly beats other adaptive compute baselines like CALM and PonderNet.
Figure 1: MathQA accuracy versus mean loop count by halt- ing method (1.7B, 3 training × 8 evaluation seeds). Points are means ±1 SD across training seeds; the dashed line marks the best fixed depth (54.71%). RecurTrace reaches 56.92% at ∼2 loops, 1.25 points above TaH-Mismatch. Inset: fixed- depth accuracy peaks at 2 loops.
  • Compute Follows Difficulty: The halting head successfully allocates more loops to harder problems. On MathQA, items failed on the first loop received an average of 3.10 loops, compared to 2.50 loops for easier items.
Figure 3: Depth tracks difficulty on MathQA at the illustrative operating point τ=0.10 (Appendix G reports the main point). Left panel, hard items receive more loops than easy items on average (3.10 versus 2.50), with dots showing the 8 seeds. Right panel, both groups peak at two loops, but hard items have a heavier tail, a mean gap of about 0.6 loops.
  • Favorable Scaling: The benefits of RecurTrace scale up with model size. Compared to a same-budget fine-tuned baseline, RecurTrace improves generation accuracy by 0.6 points at 0.6B, 1.2 points at 1.7B, 2.2 points at 4B, and 3.4 points at 8B.

Limitations and Future Work

  • Sequence-Level Halting: The halting head makes a single decision for the entire sequence at once, rather than letting individual tokens exit early.
  • No Cross-Position Memory: Loop Memory Attention only looks at the same token position across iterations, meaning it cannot pass information across different tokens over loop-time.
  • Direct-Answer Focus: The current implementation was only evaluated on short, direct-answer targets rather than long-form generation.
  • Complementary to CoT: Latent looping acts in a different space than Chain-of-Thought token generation. A natural next step is exploring how to combine both to get the best of both worlds.

Summary updated

BibTeX
@misc{wang2026recurtrace,
  author = {Yuxiang Wang and Kunyu Feng and Yingda Shen and Haoning Xu and Junyu Wang and Zhizheng Wu},
  title = {{RecurTrace: Adaptive Latent Reasoning with Loop-Time Memory}},
  year = {2026},
  eprint = {2609.03379},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.03379},
}
Figure