看而非选:LLM智能体工具选择失败的注意力-片段解释
Looking Is Not Picking: An Attention-Segment Account of Tool-Selection Failures in LLM Agents
AI总结:
本文通过分析LLM智能体对工具定义片段的注意力,发现工具选择失败源于决策读出阶段而非工具可见性,并提出了基于注意力的无训练选择器来修复。
摘要:
LLM智能体会错误地调用工具,自然的猜测是模型在拥挤的工具箱中未能看到正确的工具。我们通过一个并发工作未涉及的视角——模型对标记的工具定义片段的注意力——展示了相反的情况。在真实的BFCL失败案例上,通过每个候选的注意力argmax,模型在80%的情况下最关注正确的工具(对比21%的随机概率),而正确工具是注意力不足的片段仅占10%:它看到了正确的工具但仍然选错。这直接反驳了直观的“拥挤工具箱/中间丢失”解释:失败在于决策读出,而非工具箱,我们通过三种方式证实了这一点。(1) 输入vs.读出:修复提示(重新排序或复制正确工具)仅恢复<=23%的失败,而读出侧干预恢复59-91%。(2) 表示不变性:两种不同表示中的指向正确工具的干预——加性注意力logit偏置和残差流转向向量——恢复的失败案例大致相同(每任务Jaccard 0.865合并,每模型0.79-0.91),因此瓶颈定位于读出,与干预的表示无关。(3) 无训练、无正确工具的选择器:基于每个片段的注意力在BFCL上缩小了大部分无正确工具与有正确工具之间的差距(函数名选择合并+11.9分 vs. 有正确工具上限+17.9分),并在Seal-Tools上增加+14.9分;每个模型均为正向(精确McNemar检验p<=8e-4每个)。范围不同:因果注意力偏置剂量反应在10个遵循掩码的模型(3-32B)上是双向且单调的,而0.5-32B全范围仅携带相关性诊断;可部署的选择器在5个单轮模型上评估,尚未迁移到多轮循环。
英文摘要:
LLM agents mis-call tools, and the natural guess is that the model failed to see the right tool in a crowded harness. We show the opposite through a lens concurrent work sets aside -- the model's attention to labeled tool-definition segments. On real BFCL failures, by per-candidate attention argmax the model attends most to the correct tool 80% of the time (vs. 21% chance), and the gold is the under-attended segment on only 10%: it looks at the right tool and still picks wrong. This directly refutes the intuitive "crowded-harness / lost-in-the-middle" explanation: the failure is at the decision readout, not the harness, and we pin it there three ways. (1) Input vs. readout: repairing the prompt (reordering or duplicating the gold tool) recovers <=23% of failures, while readout-side interventions recover 59-91%. (2) Representation-invariance: two gold-pointed interventions in different representations -- an additive attention-logit bias and a residual-stream steering vector -- recover largely the same failures (per-task Jaccard 0.865 pooled, 0.79-0.91 per model), so the bottleneck is localized to the readout independent of which representation is poked. (3) A training-free, gold-free selector: per-segment attention closes most of the gold-free-vs-oracle gap on BFCL (+11.9 pts pooled function-name selection vs. +17.9-pt oracle headroom) and adds +14.9 pts on Seal-Tools; every model positive (exact McNemar p<=8e-4 each). Scopes differ: the causal attention-bias dose-response is bidirectional and monotonic on 10 mask-honoring models (3-32B), the full 0.5-32B span carrying only the correlational diagnostic; the deployable selector is evaluated on 5 single-turn models and does not yet transfer to a multi-turn loop.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。