ThinkRetrieve: Retrieval-Augmented Reasoning Traces for Test-Time Scaling

Vaibhav Singh, Soumya Suvra Ghosal, Sarvesh Gharat, Soumyabrata Pal, Ramasuri Narayanam, Dinesh ManochaarXiv 2026

TL;DR

While forcing Large Reasoning Models (LRMs) to "think longer" can improve performance, extended reasoning chains often suffer from error compounding and drift. ThinkRetrieve solves this by dynamically injecting relevant, fully solved worked examples directly into the model's intermediate reasoning traces. This procedural scaffolding stabilizes long-form thinking, yielding up to a 60% relative accuracy boost on challenging math Olympiad problems with minimal computational overhead.

What Problem Does This Paper Address?

The recent paradigm of test-time scaling (TTS)—popularized by models like OpenAI’s o1 and DeepSeek-R1—allows LLMs to solve complex, multi-step problems by allocating more compute at inference time to generate extended "chains of thought."

However, recent studies show that "thinking longer does not always mean thinking better." As reasoning traces grow, models hit diminishing or even negative returns. Without external grounding, a model relying purely on sequential self-reflection (e.g., repeatedly telling itself "Wait, let me think again") tends to wander off-track. Errors compound, uncertainty increases, and the model often "overthinks" its way out of a correct initial answer.

Traditional Retrieval-Augmented Generation (RAG) doesn't solve this because it fetches static factual knowledge before reasoning begins. The authors of ThinkRetrieve address a critical question: How can we dynamically guide an LRM's reasoning process while it is actively thinking?

Methods

ThinkRetrieve introduces a framework that interleaves model generation with dynamic, step-aware retrieval of procedural scaffolds (complete solved problems) rather than static facts.

Figure 1: Comparison of sequential test-time scaling (Muennighoff et al., 2025) and ThinkRetrieve. (Top) In standard sequential test-time scaling (Muennighoff et al., 2025), the model generates an initial reasoning trace and then relies on self-reflection (e.g., “Wait, let’s think again”) to extend its thinking. However, without access to external guidance, the continued reasoning often drifts away from the correct solution path, leading to an incorrect final answer. (Bottom) ThinkRetrieve augments the reasoning process with retrieved exemplars. After the initial thinking phase, the model generates an intermediate answer, which is used as a query to retrieve a relevant solved example from an external example bank. The retrieved exemplar is inserted into the thinking trace as an in-context example (ICE), enabling the model to extract key takeaways, identify errors in its own reasoning, and course-correct before producing the final answer.

The workflow operates iteratively within a fixed token budget:

  1. Step Generation: The LRM generates an initial reasoning trace until it hits a natural step boundary (like a </think> token).
  2. Interim Answer Extraction: Instead of immediately continuing, the model is prompted to output a quick intermediate answer based on its current state.
  3. High-Signal Querying: The original question and this intermediate answer are combined to form a search query. This filters out the verbose "noise" of the raw reasoning trace.
  4. Dense Retrieval: A pre-trained encoder (e.g., E5-Large) performs a nearest-neighbor search against an external bank of solved problems to find a structurally analogous example.
  5. In-Trace Injection: The retrieved question-solution pair is formatted as an in-context example and injected directly into the active thinking trace, followed by a prompt instructing the model to review its logic and proceed.

Datasets

The authors evaluated ThinkRetrieve across four distinct benchmarks:

  • GSM-8K: Grade-school math word problems.
  • MATH-500: A curated subset of competition-level math problems.
  • AIME 2025: Ultra-hard, Olympiad-level problems from the American Invitational Mathematics Examination.
  • SciQ: A multiple-choice science QA dataset.

For the math benchmarks, the external example bank was built from a rigorously decontaminated subset of NuminaMath-1.5 (~309,000 synthetic problems). For SciQ, the model retrieved from the dataset's own training split.

Key Insights and Ideas

  • Procedural vs. Factual Guidance: The core philosophy is showing the model how to reason rather than what facts to use. Injecting a complete, step-by-step solution of a similar problem provides a structural blueprint.
  • Actively Reducing Uncertainty: By tracking policy entropy, the authors found that ThinkRetrieve steadily reduces answer uncertainty as the budget scales. Standard TTS, by contrast, introduces conflicting hypotheses that cause late-stage confidence reversals.
  • Cognitive Checkpoints: The injected examples serve two distinct qualitative purposes depending on the model's state:
  • Error Correction: If the model is wrong, the structural analog provides a contrastive signal that helps it catch its mistake (e.g., realizing it missed a duplicate counting step).
  • Confidence Anchoring: If the model is already on the right track, the exemplar confirms its logic, preventing it from second-guessing itself and overthinking into an error.
Figure 3: Qualitative comparison on a MATH-500 problem. Both methods arrive at the same incorrect intermediate estimate of 1/6. Sequential TTS (left) fails to catch the error through self-reflection. ThinkRetrieve (right) retrieves a similar problem; this contrastive signal helps the model recognize the error in its reasoning on the original problem, correcting the answer to 1/3.

Key Results

The framework was tested across five reasoning models ranging from 1.5B to 8B parameters (including DeepSeek-R1-Distill-Qwen-1.5B and various Qwen3 variants).

  • Consistent Performance Gains: ThinkRetrieve outperformed standard test-time scaling and static input-level few-shot baselines across every single model and benchmark combination.
  • Substantial Olympiad Improvements: The largest gains occurred on the hardest tasks. On AIME 2025, ThinkRetrieve achieved up to a +13.4 absolute percentage point gain (a ~60% relative improvement) for Qwen3-1.7B.
  • Flattening the Collapse: As shown in Figure 4, while standard TTS accuracy often collapses sharply at high token budgets (e.g., DeepSeek-R1-1.5B on GSM-8K), ThinkRetrieve maintains stable, monotonically increasing performance.
Figure 4: Test-time scaling behavior across models and benchmarks. Accuracy as a function of thinking budget B for sequential TTS (orange) and ThinkRetrieve (blue), across four reasoning models (rows) and three benchmarks (columns), averaged over three seeds with min–max shading. Sequential TTS degrades or plateaus at higher budgets— collapsing sharply for DeepSeek-R1-1.5B on GSM-8K—while ThinkRetrieve maintains stable or increasing accuracy across every setting, most dramatically on the hardest benchmark (AIME 2025).
  • High Efficiency: Because the injected exemplar tokens count against the generation budget but are not actually generated by the model, ThinkRetrieve adds only about 6% wall-clock overhead compared to standard TTS.

Limitations and Future Work

  • Corpus Coverage Dependency: The system's efficacy is bound to the quality and coverage of the external example bank. If a problem is highly novel or distributionally distant from the corpus, the retrieved examples may be irrelevant or misleading.
  • Risk of Confident Hallucinations: Because ThinkRetrieve forces the model's answer distribution to collapse (lowering entropy), anchoring onto a subtly mismatched or misleading exemplar can cause the model to confidently lock in a wrong answer.
  • Domain Generalization: The current implementation was heavily validated on structured math and science domains. Testing its viability in more open-ended environments, such as code generation or complex logical reasoning, remains an open area for future research.

Summary updated

BibTeX
@misc{singh2026thinkretrieve,
  author = {Vaibhav Singh and Soumya Suvra Ghosal and Sarvesh Gharat and Soumyabrata Pal and Ramasuri Narayanam and Dinesh Manocha},
  title = {{ThinkRetrieve: Retrieval-Augmented Reasoning Traces for Test-Time Scaling}},
  year = {2026},
  eprint = {2608.10928},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.10928},
}
Figure