arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.03344cs.IRcs.AIcs.CL

RAG 基于思考轨迹可提升推理任务

RAG over Thinking Traces Can Improve Reasoning Tasks

University of California, Berkeley(加州大学伯克利分校)

Negar Arabzadeh, Wenjie Ma, Sewon Min, Matei Zaharia

AI总结:

提出检索思考轨迹而非文档,通过 T3 方法将其转化为结构化表示,在推理任务上显著提升性能,超越标准 RAG 和无 RAG 基线。

摘要:

检索增强生成(RAG)已被证明对知识密集型任务有效,但普遍认为其对数学和代码生成等推理密集型问题帮助有限。我们通过证明限制不在于 RAG 本身而在于语料库的选择来挑战这一假设。我们不检索文档,而是提出检索思考轨迹,即问题求解尝试过程中产生的中间思考轨迹。我们表明思考轨迹本身就是一个强大的检索源,并进一步引入 T3,一种离线方法,将其转化为结构化、利于检索的表示,以提高可用性。使用这些轨迹作为语料库,简单的检索-生成流水线在强模型和基准测试(如 AIME 2025--2026、LiveCodeBench 和 GPQA-Diamond)上持续提升推理性能,优于无 RAG 基线和检索标准网络语料库。例如,在 AIME 2025-2026 上,使用 Gemini-2-thinking 生成的轨迹进行 RAG,在 Gemini-2.5-Flash、GPT-OSS-120B 和 GPT-5 上分别实现了 +56.3%、+8.6% 和 +7.6% 的相对增益,尽管这些是更新的模型。总体而言,我们的结果表明思考轨迹是推理任务的有效检索语料库,将其转化为结构化、紧凑或诊断性表示可带来更强的增益。代码见此链接。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑