RAG over Thinking Traces Can Improve Reasoning Tasks
Pith reviewed 2026-07-01 00:31 UTC · model grok-4.3
The pith
Retrieving thinking traces as the RAG corpus improves reasoning performance on math and code benchmarks.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
Thinking traces serve as an effective retrieval corpus for reasoning-intensive tasks. A retrieve-then-generate pipeline using these traces outperforms both non-RAG baselines and retrieval over standard web corpora on benchmarks including AIME 2025-2026, LiveCodeBench, and GPQA-Diamond. The approach produces relative gains such as +56.3% on AIME 2025-2026 for Gemini-2.5-Flash when traces come from Gemini-2-thinking. Transforming traces offline into structured, compact, or diagnostic representations unlocks additional improvements.
What carries the argument
Thinking traces, defined as intermediate thinking trajectories generated during problem-solving attempts, used as the retrieval corpus in a retrieve-then-generate pipeline, with an optional offline T3 transformation to create structured representations.
If this is right
- Reasoning accuracy rises on math and code benchmarks when the retrieval corpus consists of thinking traces rather than documents.
- The same pipeline outperforms retrieval over standard web corpora on the tested benchmarks.
- Gains hold for multiple strong models, including cases where the target model is newer than the one that generated the traces.
- Applying the T3 offline transformation to structure the traces produces larger improvements than raw traces alone.
Where Pith is reading between the lines
- Systems could maintain growing collections of thinking traces to support repeated retrieval for similar problem types.
- The transfer of traces across models suggests that reasoning patterns captured in traces may be reusable even as base models advance.
- Similar trace-based retrieval might apply to other structured reasoning domains if comparable intermediate trajectories can be collected.
Load-bearing premise
That thinking traces generated by one group of models form a sufficiently general corpus that transfers to improve performance of other models on new benchmarks without harmful distribution shift.
What would settle it
A controlled run of the retrieve-then-generate pipeline on AIME 2025-2026 or GPQA-Diamond that shows no accuracy increase or a decrease relative to the non-retrieval baseline would falsify the claim.
Figures
read the original abstract
Retrieval-augmented generation (RAG) has proven effective for knowledge-intensive tasks, but is widely believed to offer limited benefit for reasoning-intensive problems such as math and code generation. We challenge this assumption by showing that the limitation lies not in RAG itself, but in the choice of corpus. Instead of retrieving documents, we propose retrieving thinking traces, i.e., intermediate thinking trajectories generated during problem solving attempts. We show that thinking traces are already a strong retrieval source, and further introduce T3, an offline method that transforms them into structured, retrieval-friendly representations, to improve usability. Using these traces as a corpus, a simple retrieve-then-generate pipeline consistently improves reasoning performance across strong models and benchmarks such as AIME 2025--2026, LiveCodeBench, and GPQA-Diamond, outperforming both non-RAG baselines and retrieval over standard web corpora. For instance, on AIME 2025-2026, RAG with traces generated by Gemini-2-thinking achieves relative gains of +56.3%, +8.6%, and +7.6% for Gemini-2.5-Flash, GPT-OSS-120B, and GPT-5, respectively, even though these are more recent models. Overall, our results suggest that thinking traces are an effective retrieval corpus for reasoning tasks, and transforming them into structured, compact, or diagnostic representations unlocks even stronger gains. Code available at https://github.com/Narabzad/t3.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper claims that standard RAG is limited for reasoning tasks not because of the technique itself but due to the choice of corpus; instead, retrieving over 'thinking traces' (intermediate trajectories from problem-solving attempts) yields consistent gains on math/code benchmarks (AIME 2025-2026, LiveCodeBench, GPQA-Diamond). It introduces T3, an offline method to convert raw traces into structured, retrieval-friendly representations, and reports that a retrieve-then-generate pipeline using Gemini-2-thinking traces outperforms both non-RAG baselines and web-corpus RAG, with large relative gains even when applied to newer models (e.g., +56.3% on AIME for Gemini-2.5-Flash).
Significance. If the empirical results are robust, the work would establish thinking traces as a viable and often superior retrieval corpus for reasoning augmentation, opening a path to self-referential RAG that does not rely on external web data. The availability of code is a positive factor for reproducibility.
major comments (2)
- [Experimental Setup / Trace Generation] The central claim that trace-based RAG transfers to newer models without distribution shift or selection artifacts (e.g., the +56.3% relative gain on AIME 2025-2026 for Gemini-2.5-Flash using Gemini-2-thinking traces) is load-bearing, yet the manuscript provides no protocol details on trace collection, success filtering, or problem sampling. This leaves open the possibility that reported gains arise from retrieving near-solutions rather than general reasoning support.
- [Results / Baselines] The comparison to 'retrieval over standard web corpora' is presented as decisive, but without explicit controls for corpus size, indexing method, or retrieval hyperparameters matched across conditions, it is unclear whether the advantage is due to the nature of thinking traces or to differences in corpus quality and coverage.
minor comments (2)
- [§3 (T3 Method)] The abstract states that T3 produces 'structured, retrieval-friendly representations' but does not define the precise transformation steps or output format; a short example in §3 would clarify usability.
- [Results] Table or figure reporting absolute accuracies (not only relative gains) alongside the non-RAG and web-RAG baselines would make the magnitude of improvement easier to interpret.
Simulated Author's Rebuttal
We thank the referee for the constructive comments. We address each major point below and will make the corresponding revisions to strengthen the manuscript.
read point-by-point responses
-
Referee: [Experimental Setup / Trace Generation] The central claim that trace-based RAG transfers to newer models without distribution shift or selection artifacts (e.g., the +56.3% relative gain on AIME 2025-2026 for Gemini-2.5-Flash using Gemini-2-thinking traces) is load-bearing, yet the manuscript provides no protocol details on trace collection, success filtering, or problem sampling. This leaves open the possibility that reported gains arise from retrieving near-solutions rather than general reasoning support.
Authors: We agree that additional protocol details are required to support the central claim and rule out selection artifacts. In the revised manuscript we will add a dedicated subsection in the Experimental Setup that specifies the trace generation procedure (models, prompts, temperature), success filtering criteria (e.g., traces retained only when the final answer matches the ground truth or reaches a defined partial-progress threshold), and the exact problem-sampling strategy used for the corpus. We will also include a quantitative check (cosine similarity of retrieved traces to test problems) demonstrating that performance gains persist even after excluding near-duplicate traces. revision: yes
-
Referee: [Results / Baselines] The comparison to 'retrieval over standard web corpora' is presented as decisive, but without explicit controls for corpus size, indexing method, or retrieval hyperparameters matched across conditions, it is unclear whether the advantage is due to the nature of thinking traces or to differences in corpus quality and coverage.
Authors: We acknowledge that the current baseline comparison lacks explicit matching of corpus size, indexing pipeline, and hyperparameter tuning. In the revision we will report the exact token counts of both corpora, use the identical embedding model and vector index for both conditions, and separately optimize the retrieval hyper-parameters (k, similarity threshold) for each corpus before reporting results. These controls will be added to the Results section and the associated tables. revision: yes
Circularity Check
No circularity; purely empirical performance comparisons
full rationale
The paper reports direct experimental results on retrieve-then-generate pipelines using thinking traces as corpus, with gains measured against non-RAG baselines and web corpora on held-out benchmarks. No equations, parameter fits, or derivations are present that could reduce reported improvements to quantities defined by the paper's own inputs. No self-citation chains, uniqueness theorems, or ansatzes are invoked to justify the central claim. The work is self-contained against external benchmarks via explicit model and dataset comparisons.
Axiom & Free-Parameter Ledger
Forward citations
Cited by 1 Pith paper
-
Natural Language Query to Configuration for Retrieval Agents
BRANE maps queries to optimal retrieval pipeline configurations using LLM-derived features and per-configuration correctness predictors, improving the cost-quality Pareto frontier on three benchmarks.
Reference graph
Works this paper leans on
-
[1]
doi: 10.18653/v1/2024.findings-emnlp
Association for Computational Linguistics. doi: 10.18653/v1/2024.findings-emnlp
-
[2]
URLhttps://aclanthology.org/2024.findings-emnlp.496/. Leo Gao, Jonathan Tow, Baber Abbasi, Stella Biderman, Sid Black, Anthony DiPofi, Charles Foster, Laurence Golding, Jeffrey Hsu, Alain Le Noac’h, Haonan Li, Kyle McDonell, Niklas Muennighoff, Chris Ociepa, Jason Phang, Laria Reynolds, Hailey Schoelkopf, Aviya Skowron, Lintang Sutawika, Eric Tang, Anish ...
-
[3]
DAPO: An Open-Source LLM Reinforcement Learning System at Scale
URLhttps://arxiv.org/abs/2503.14476. A Prompts Here, we present the prompts used for transforming thinking traces and for RAG inference. The prompt used for transformation strategies introduced in Section 3.2, namely Structural Normalization (Struct), Semantic Distillation (Semantic), and Reflection (Reflect) are shown in Figure 4, 5 and 6, respectively. ...
work page internal anchor Pith review Pith/arXiv arXiv 2000
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.