上下文是流水线,而非窗口:LLM智能体管控工具中的信息损耗
Context Is a Pipeline, Not a Window: Information Attrition in LLM Agent Harnesses
AI总结:
本文指出LLM智能体管控工具存在信息损耗问题,将上下文建模为五阶段流水线,通过实验验证数据裁剪会增加工作量,且部分智能体框架存在不安全裁剪工具输出的问题。
摘要:
LLM智能体的评判标准通常只有两个数值:上下文窗口的大小,以及最终答案的正确率。这两个数值都忽略了第三个关键因素:在模型接收到工具输出之前,有多少信息已经丢失。我们在一个真实的使用工具的智能体中测量了这种信息损耗。该智能体通过读取Linux内核追踪来查找注入故障的原因。其上下文窗口几乎处于空闲状态:在720次运行中,单次使用的最大提示词仅占上下文窗口的5.75%。然而,所有工具结果中有三分之一(11189个结果中的3827个)在到达模型之前就被截断,且每个被截断的结果都变成了损坏的JSON格式。管控工具通过在固定长度处截断JSON文本来裁剪每个结果,这种裁剪并非均匀缩短结果,而是删除末尾附近的任意数据。某个字段仅在4.7%的调用中被模型接收到,而在同一结果中的另一个字段,却在99.3%的调用中被模型接收到。该字段是否包含故障证据取决于故障进程在追踪中启动的时间:是早期还是晚期。智能体的诊断准确率也呈现出相同的划分。因此,我们开展了受控实验以验证一个问题:数据丢失是否导致了准确率下降?本文做出了四项贡献:第一,我们将智能体的上下文建模为一个五阶段流水线,并测量了每个阶段的故障情况;第二,我们重放了864个真实工具结果,其中包括一个来自生产追踪的结果,该结果中,默认的裁剪操作删除了故障证据的全部128条记录;第三,受控实验表明,裁剪的实际代价首先表现为额外工作量,而非错误答案:工具调用增加了43%,计算量翻倍,且产出率从0.61降至0.31,当智能体有其他方式获取答案时,仍能找到正确结果;第四,对七个智能体框架的调查发现,其中两个框架以相同的不安全方式裁剪工具输出。数据裁剪是否真正导致了准确率下降仍是一个悬而未决的问题。
英文摘要:
LLM agents are judged by two numbers: the size of the context window, and how often the final answer is correct. Both numbers miss a third thing: how much of a tool's output is lost before the model ever sees it. We measured this loss in a real tool-using agent. The agent finds the cause of injected faults by reading Linux kernel traces. The context window was almost empty: across 720 runs, the single largest prompt used only 5.75% of it. Yet a third of all tool results (3,827 of 11,189) were cut before they reached the model, and every cut result became broken JSON. The harness cut each result by slicing its JSON text at a fixed length. This does not shorten a result evenly. It deletes whatever data sits near the end. One field reached the model in only 4.7% of calls. A second field, in the very same results, reached the model in 99.3% of calls. Which field held the fault's evidence depended on when the faulty process started: early or late in the trace. The agent's diagnosis accuracy matched this same split. So we ran controlled experiments to test one question: did the data loss cause the drop in accuracy? This paper makes four contributions. First, we model an agent's context as a five-stage pipeline, with a measured failure at each stage. Second, we replay 864 real tool results, including one from a production trace where the shipped cut deletes all 128 records of the fault's evidence. Third, a controlled experiment shows that the cut's real cost appears first as extra work, not as wrong answers: 43% more tool calls, twice the computation, and yield falling from 0.61 to 0.31. The agent still finds the right answer when it has another way to reach it. Fourth, a survey of seven agent frameworks finds two that cut tool output the same unsafe way. Whether the data cut truly causes the accuracy drop is still an open question.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。