arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.28982cs.AIcs.SE
收藏

文本之外的行为:评估大语言模型智能体中的拒绝迁移失败

Behavior Beyond Text: Evaluating Refusal Transfer Failure in LLM Agents

Harvard University(哈佛大学);Clarkson University(克拉克森大学);Carleton University(卡尔顿大学)

Ekagra Gupta, Raj Saha, Aniekan-Abasi Inyang, Adam Al Gharib

AI总结:

本研究构建含2304个提示词的基准数据集,发现大语言模型智能体文本中被拒绝的请求常导致不安全工具调用,识别出与拒绝相关的方向,表明需直接检查工具调用智能体的动作以评估其安全性。

摘要:

尽管大语言模型正越来越多地被部署为工具调用智能体,但其安全评估仍主要聚焦于它们在文本中拒绝有害请求的能力。本研究探究文本中的拒绝行为是否会迁移到工具使用场景中。我们构建了一个包含四个领域的基准数据集,共2304个提示词,由匹配的三元组构成,这些三元组在纯文本、标准工具启用以及对抗性框架工具启用三种设置下呈现相同的有害或良性请求。随后,我们使用20个预定义的禁止动作来评估工具调用的安全性。我们测试了五个不同规模和家族的模型,发现文本中被拒绝的请求常常会导致不安全的工具调用。在标准工具启用提示下,聊天中被拒绝的有害请求有10%-52%会出现这种分歧。为了从机制上探究这一差距,我们在五个模型各自的残差流中识别出一个与拒绝相关的方向。我们发现,在工具启用的场景中,五个模型中有四个沿该方向的激活会降低。此外,较低的激活值可预测所有五个模型的不安全工具调用(AUC为0.76-0.86)。然而,通过激活修补将信号恢复到纯文本设置下的对应值,仅能阻止部分不安全调用,且主要是通过抑制工具使用而非产生更安全的调用来实现。沿拒绝方向进行引导,仅在能同时抑制良性工具使用或降低输出质量的强度下,才能几乎消除不安全调用。我们的发现表明,所识别的拒绝方向会影响模型是否执行动作,但仅能部分解释拒绝分歧。因此,评估工具调用智能体的安全性需要直接检查它们的动作以及文本响应。

英文摘要:

While large language models are increasingly deployed as tool-calling agents, their safety evaluations still focus primarily on their ability to refuse harmful requests in text. We investigate whether the refusal behavior in text transfers to tool use. We construct a benchmark of 2,304 prompts across four domains, consisting of matched triplets that present the same harmful or benign request in text-only, standard tool-enabled, and adversarially framed tool-enabled settings. We then assess tool-call safety using 20 predefined forbidden actions. Testing five models of varying sizes and families, we find that requests refused in text frequently result in unsafe tool calls. Under standard tool-enabled prompting, this divergence occurs for 10-52 percent of harmful requests refused in chat. To mechanistically investigate this gap, we identify a refusal-associated direction in the residual stream of each of the five models. We find that in tool-enabled contexts, the activations along this direction decrease in four of five models. Furthermore, lower activation predicts unsafe tool calls across all five models (AUC 0.76-0.86). However, restoring the signal to the respective text-only value through activation patching only prevents a subset of unsafe calls, primarily by suppressing tool use rather than by producing safer calls. Steering along the refusal direction nearly eliminates unsafe calls only at strengths that also suppress benign tool use or degrade the output quality. Our findings indicate that the identified refusal direction contributes to whether a model acts, but only partially explains the refusal divergence. Therefore, evaluating the safety of tool-calling agents requires directly examining their actions along with their textual responses.

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

↑