LLMs是否了解工具无关性?解密工具调用中的结构对齐偏差
Do LLMs Know Tool Irrelevance? Demystifying Structural Alignment Bias in Tool Invocations
AI总结:
本文研究LLMs在面对无关工具时的调用偏差,提出SABEval数据集和Contrastive Attention Attribution方法,揭示结构对齐偏差的成因并提出缓解策略。
摘要:
大型语言模型(LLMs)在利用外部工具方面展示了出色的能力。然而,在实践中,LLMs经常暴露于与用户查询无关的工具,此时期望的行为是避免调用。本文识别了工具拒绝中广泛但被忽视的机理性缺陷,即结构对齐偏差:即使工具无法满足用户的目标,LLMs仍然倾向于在查询属性可以合理分配到工具参数时调用该工具。为系统研究这一偏差,我们引入了SABEval,一个将结构对齐与语义相关性解耦的新数据集。我们的分析显示,结构对齐偏差在LLMs中引发了严重的工具调用错误,但现有评估中对此问题鲜有关注。为研究这一偏差的内部机制,我们提出Contrastive Attention Attribution,揭示了语义检查和结构匹配的两种竞争路径。这两种路径的相对强度驱动LLMs的工具调用决策。基于这些发现,我们进一步引入了一种重新平衡策略,通过大量实验验证,该策略能有效缓解结构对齐偏差,而不会影响通用工具使用能力。
英文摘要:
Large language models (LLMs) have demonstrated impressive capabilities in utilizing external tools. In practice, however, LLMs are often exposed to tools that are irrelevant to the user's query, in which case the desired behavior is to refrain from invocations. In this work, we identify a widespread yet overlooked mechanistic flaw in tool refusal, which we term structural alignment bias: Even when a tool fails to serve the user's goal, LLMs still tend to invoke it whenever query attributes can be validly assigned to tool parameters. To systematically study this bias, we introduce SABEval, a new dataset that decouples structural alignment from semantic relevance. Our analysis shows that structural alignment bias induces severe tool-invocation errors in LLMs, yet remains largely unaccounted for in existing evaluations. To investigate the internal mechanisms underlying this bias, we propose Contrastive Attention Attribution, which reveals two competing pathways for semantic checking and structural matching. The relative strength of these pathways drives LLMs' tool invocation decisions. Based on these findings, we further introduce a rebalancing strategy that effectively mitigates structural alignment bias, as demonstrated by extensive experiments, without degrading general tool-use capabilities.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。