相同模拟,不同证据:检索到的工具输出如何损害LLM智能体的准确性
研究论文 · 2026/10/23
LLM智能体即使计算正确也可能答错。智能体框架越来越多地将长工具输出保存在上下文窗口之外,存为文件供智能体按需搜索或读取。我们使用真实科学工具PHREEQC(美国地质调查局广泛使用的地球化学模拟器,其报告可达84.68万字符,且确定性允许追溯每个打印值)来探究这种做法的准确性代价。智能体用它回答158个经执行验证的多选题。当智能体通过章节索引而非上下文读取模拟器报告时,GPT-5.1和GPT-5.2的准确率分别下降11.3和7.9个百分点,而Claude Opus 4.6和Claude Sonnet 4.6未检测到代价。重新运行全部11,007次记录的模拟器调用显示,两个GPT模型计算关键值的频率与之前大致相同;变化的是它们作答所依据的证据。在检索模式下,它们常跳过报告,从自身更高精度的输出文件作答,并错误舍入到相邻选项,我们称此失败为证据替换。在模拟固定的情况下,检索仍使GPT-5.2损失9.4个百分点。对于GPT-5.4,更频繁的正确模拟掩盖了约10个百分点的证据使用损失,使得净变化与零无法区分。指定权威输出使三个GPT模型相比普通检索准确率提高6.3-7.9个百分点;对于GPT-5.1和GPT-5.2,内联适合的输出同样有效,而要求正确舍入则无效。智能体框架中的上下文管理选择应通过准确性损失的位置来评判,而不仅仅是最终准确率。
该研究通过真实科学工具PHREEQC和大量执行验证,精准定位了智能体框架中检索式上下文管理导致的“证据替换”失败模式,并量化了不同模型的差异及缓解措施,对设计更可靠的LLM智能体具有直接指导意义。
LLM agents that compute the right answer can still answer wrongly. Agent harnesses increasingly keep long tool outputs out of the context window, saving them to files that the agent searches or reads on demand. We ask where this costs accuracy with a real scientific tool: PHREEQC, a widely used geochemistry simulator from the USGS, whose reports reach 846.8k characters and whose determinism lets every printed value be traced. Agents use it to answer 158 execution-verified multiple-choice items. When agents read the simulator's report through a section index rather than in context, GPT-5.1 and GPT-5.2 lose 11.3 and 7.9 points of accuracy, while Claude Opus 4.6 and Claude Sonnet 4.6 show no detectable cost. Re-running all 11,007 logged simulator calls shows that both GPT models compute the keyed value about as often as before; what changes is the evidence they answer from. Under retrieval they often skip the report, answer from their own higher-precision output files, and misround to a neighboring option, a failure we call evidence substitution. With the simulation held fixed, retrieval still costs GPT-5.2 9.4 points. For GPT-5.4, more frequent correct simulations mask an evidence-use loss of about ten points, leaving a net change indistinguishable from zero. Naming the authoritative output raises accuracy by 6.3-7.9 points over plain retrieval for the three GPT models; for GPT-5.1 and GPT-5.2, inlining outputs that fit works as well, while asking for correct rounding does not. Context-management choices in agent harnesses should be judged by where accuracy is lost, not only by final accuracy.