arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.23268cs.LGcs.AI
收藏

SafeSeek: 语言模型中安全回路的通用归因

SafeSeek: Universal Attribution of Safety Circuits in Language Models

University of Science;United Arab Emirates University;Nanyang Technological University;Zayed University;Intelligent Science \& Technology Academy of CASIC

Miao Yu, Siyuan Fu, Moayad Aloqaily, Zhenhong Zhou, Safa Otoum, Xing fan, Kun Wang, Yufei Guo, Qingsong Wen

AI总结:

本文提出SafeSeek框架,通过优化识别语言模型中的完整安全回路,验证了在后门攻击和安全对齐场景中的有效性,展示了安全回路的识别与利用方法。

摘要:

机制可解释性揭示了大型语言模型(LLMs)中关键安全行为(如对齐、劫持、后门)的基础在于专门的功能组件。然而,现有安全归因方法由于依赖启发式、领域特定的度量和搜索算法,在泛化和可靠性方面存在问题。为此,我们提出了SafeSeek,一个统一的安全可解释性框架,通过优化在LLMs中识别功能完整的安全回路。与聚焦于孤立头或神经元的方法不同,SafeSeek引入可微二进制掩码,通过在安全数据集上进行梯度下降提取多粒度回路,并整合安全回路调优以利用这些稀疏回路进行高效的的安全微调。我们在LLM安全的两个关键场景中验证了SafeSeek:(1)后门攻击,识别出一个稀疏度为0.42%的后门回路,其消去使攻击成功率(ASR)从100%→0.4%,同时保留超过99%的通用用途;(2)安全对齐,本地化一个稀疏度为3.03%的对齐回路,其移除使ASR从0.8%→96.9%,而排除该回路进行帮助性微调时保持96.5%的安全保留。

英文摘要:

Mechanistic interpretability reveals that safety-critical behaviors (e.g., alignment, jailbreak, backdoor) in Large Language Models (LLMs) are grounded in specialized functional components. However, existing safety attribution methods struggle with generalization and reliability due to their reliance on heuristic, domain-specific metrics and search algorithms. To address this, we propose \ourmethod, a unified safety interpretability framework that identifies functionally complete safety circuits in LLMs via optimization. Unlike methods focusing on isolated heads or neurons, \ourmethod introduces differentiable binary masks to extract multi-granular circuits through gradient descent on safety datasets, while integrates Safety Circuit Tuning to utilize these sparse circuits for efficient safety fine-tuning. We validate \ourmethod in two key scenarios in LLM safety: \textbf{(1) backdoor attacks}, identifying a backdoor circuit with 0.42\% sparsity, whose ablation eradicates the Attack Success Rate (ASR) from 100\% $\to$ 0.4\% while retaining over 99\% general utility; \textbf{(2) safety alignment}, localizing an alignment circuit with 3.03\% heads and 0.79\% neurons, whose removal spikes ASR from 0.8\% $\to$ 96.9\%, whereas excluding this circuit during helpfulness fine-tuning maintains 96.5\% safety retention.

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

↑