arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2508.14031cs.CLcs.AIcs.LG
收藏

智能体微调导致的非预期错位:风险与缓解

Unintended Misalignment from Agentic Fine-Tuning: Risks and Mitigation

Dongyoon Hahm, Taywon Min, Woogyeol Jin, Kimin Lee

AI总结:

本研究揭示对齐LLMs经智能体微调后可能非预期错位的风险,提出PING方法通过添加自然语言前缀引导智能体拒绝有害请求,实验证明其在提升安全性的同时保留任务性能,优于现有提示方法。

摘要:

除简单文本生成外,大语言模型(LLMs)已演化为能规划并与外部工具交互以解决复杂任务的智能体系统。这一演进涉及在智能体特定任务上微调LLMs以提升其熟练度,但该微调过程中安全问题常被忽视。本研究表明,对齐的LLMs经智能体任务微调后可能非预期错位,导致执行有害任务的可能性升高、拒绝有害任务的倾向降低。为应对这些安全挑战,我们提出Prefix INjection Guard(PING)——一种简单有效的方法,将自动生成的自然语言前缀添加到智能体响应前,引导其拒绝有害请求同时保留良性任务性能。具体而言,我们引入迭代方法,交替执行(1)生成候选前缀和(2)选择优化任务性能与拒绝行为的前缀。实验结果显示,PING在不牺牲有效性的前提下显著提升微调LLM智能体的安全性,在网页导航和代码生成任务的多种基准上持续优于现有提示方法。通过线性探针分析内部隐藏状态发现,前缀token对行为修改至关重要,解释了性能提升的原因。警告:本文包含不道德或冒犯性内容。

英文摘要:

Beyond simple text generation, Large Language Models (LLMs) have evolved into agentic systems capable of planning and interacting with external tools to solve complex tasks. This evolution involves fine-tuning LLMs on agent-specific tasks to enhance their proficiency. However, safety concerns are frequently overlooked during this fine-tuning process. In this work, we show that aligned LLMs can become unintentionally misaligned, leading to a higher likelihood of executing harmful tasks and a reduced tendency to refuse them when fine-tuned to execute agentic tasks. To address these safety challenges, we propose Prefix INjection Guard (PING), a simple yet effective method that prepends automatically generated natural language prefixes to agent responses, guiding them to refuse harmful requests while preserving performance on benign tasks. Specifically, we introduce an iterative approach that alternates between (1) generating candidate prefixes and (2) selecting those that optimize both task performance and refusal behavior. Experimental results demonstrate that PING significantly enhances the safety of fine-tuned LLM agents without sacrificing their effectiveness. PING consistently outperforms existing prompting approaches across diverse benchmarks in both web navigation and code generation tasks. Our analysis of internal hidden states via linear probes reveals that prefix tokens are crucial for behavior modification, explaining the performance gains. WARNING: This paper contains contents that are unethical or offensive in nature.

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

↑