通过内部计算图分析大模型越狱攻击的内在机制
Mechanistic Interpretability of LLM Jailbreaks via Internal Attribution Graphs

- 构建干净与攻击提示的内部计算图对比,揭示推理路径变化
- 发现攻击导致安全模块被抑制、新攻击特征涌现、路径重定向
- 可定位漏洞模式并干预节点,适合安全研究者和模型开发者
大型语言模型虽具强大能力,却极易受对抗性提示和越狱攻击影响。现有方法多依赖输入输出行为或归因分析,难以揭示对抗扰动如何改变模型内部推理过程,导致不安全行为机制不清。本文提出一种基于成对内部计算图的机制化诊断框架,将提示相关的推理建模为潜在特征间的结构化因果交互。通过构建并对齐干净与攻击提示的计算图,发现攻击会系统性地改变内部推理:安全相关组件被抑制、攻击特异性特征出现、计算路径发生重路由。在此基础上,提出统一框架,实现(i)计算分解为不变、被抑制、新生结构;(ii)识别与失败模式相关的重复漏洞模式;(iii)对节点、路径和子图进行因果干预,直接评估其对攻击成功的影响。实验在多个开源LLM及多样化对抗与越狱基准上验证,内部计算图的结构偏差与不安全行为强相关。针对性干预已识别的漏洞模式可提升模型鲁棒性,确立内部计算图为理解、诊断和缓解LLM漏洞的原理性基础。
原文摘要 · Abstract (English)
Large language models (LLMs) exhibit remarkable capabilities but remain highly vulnerable to adversarial prompts and jailbreak attacks. Existing approaches primarily analyze these failures through input-output behaviors or attribution methods, offering limited insight into how adversarial perturbations alter the model's internal reasoning. Consequently, the mechanisms underlying unsafe or incorrect behaviors remain poorly understood. We introduce a mechanistic framework for diagnosing LLM vulnerabilities using paired internal computation graphs, which represent prompt-specific inference as structured causal interactions among latent features. By constructing and aligning computation graphs for clean and attacked prompts, we reveal that adversarial attacks induce systematic transformations of internal reasoning, including suppression of safety-relevant components, emergence of attack-specific features, and rerouting of computation paths. Building on this representation, we propose a unified framework that (i) decomposes computation into invariant, suppressed, and emergent structures, (ii) identifies recurring vulnerability motifs associated with failure modes, and (iii) performs causal interventions on nodes, paths, and subgraphs to directly evaluate their contributions to attack success. This enables a transition from descriptive attribution to causal diagnosis of model failures. Experiments across multiple open-source LLMs and diverse adversarial and jailbreak benchmarks demonstrate that structural deviations in internal computation graphs strongly correlate with unsafe behaviors. Furthermore, targeted interventions on identified vulnerability motifs improve model robustness, establishing internal computation graphs as a principled foundation for understanding, diagnosing, and mitigating LLM vulnerabilities.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。