LLM-based agents solve complex tasks through iterative reasoning, tool use, and environment interaction, where each intermediate thought directly shapes subsequent actions. Small deviations in these thoughts can therefore propagate into unsafe behaviors, yet existing guardrails typically operate only on final outputs or require intrusive model modifications. We introduce Thought-Aligner, a lightweight plug-in safety model that performs causal correction on unsafe thoughts before action execution, without altering the underlying agent. The corrected thoughts are fed back into the agent, steering its decision process and tool use toward safer trajectories. Because it operates solely at the thought level, Thought-Aligner is model-agnostic and can be integrated into diverse agent frameworks. We train Thought-Aligner via two-stage contrastive learning on paired safe and unsafe thoughts generated across ten risk scenarios. Experiments on diverse agent-safety benchmarks and six LLMs show that Thought-Aligner increases behavioral safety from about 50% without protection to around 90% on average, exceeding state-of-the-art guardrails by roughly 23%, while also improving helpfulness by about 5%. The method incurs low per-step latency and minimal overhead, enabling scalable and practical deployment. We publicly release Thought-Aligner-7B at https://huggingface.co/WhitzardAgent/Thought-Aligner-7B.


翻译:基于大语言模型的智能体通过迭代推理、工具使用和环境交互解决复杂任务,其中每个中间思维会直接影响后续行动。思维中的微小偏差可能传播为不安全行为,而现有护栏机制通常仅作用于最终输出或需要对模型进行侵入式修改。我们提出轻量级即插即用安全模型Thought-Aligner,它在行动执行前对不安全思维进行因果修正,无需改变底层智能体架构。修正后的思维被重新注入智能体,引导其决策过程和工具使用朝向更安全的轨迹。由于仅在思维层面运作,Thought-Aligner具有模型无关性,可集成到各类智能体框架中。我们通过两阶段对比学习,在十个风险场景中生成的成对安全/不安全思维上训练Thought-Aligner。在多样化的智能体安全基准测试和六个大语言模型上的实验表明,Thought-Aligner将行为安全性从无保护时的约50%提升至平均约90%,超越现有最佳护栏约23%,同时将有益性提升约5%。该方法具有较低的每步延迟和极小的额外开销,支持可扩展的实际部署。我们在https://huggingface.co/WhitzardAgent/Thought-Aligner-7B公开发布Thought-Aligner-7B模型。

0
下载
关闭预览

相关内容

AI智能体时代大模型安全风险与攻防新挑战
专知会员服务
15+阅读 · 2月27日
158页!天大等最新《大型语言模型安全:全面综述》
专知会员服务
50+阅读 · 2024年12月24日
《人工智能安全测评白皮书》,99页pdf
专知
36+阅读 · 2022年2月26日
人工智能对网络空间安全的影响
走向智能论坛
21+阅读 · 2018年6月7日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
20+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2014年12月31日
Arxiv
0+阅读 · 5月14日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
5+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
4+阅读 · 6月17日
相关资讯
《人工智能安全测评白皮书》,99页pdf
专知
36+阅读 · 2022年2月26日
人工智能对网络空间安全的影响
走向智能论坛
21+阅读 · 2018年6月7日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
20+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员