Attribution-guided Pruning for Compression, Circuit Discovery, and Targeted Correction in LLMs
作者: Sayed Mohammad Vakilzadeh Hatefi, Maximilian Dreyer, Reduan Achtibat, Patrick Kahardipraja, Thomas Wiegand, Wojciech Samek, Sebastian Lapuschkin
分类: cs.LG, cs.AI, cs.CL
发布日期: 2025-06-16
备注: Work in progress (10 pages manuscript, 3 pages references, 12 pages appendix)
🔗 代码/项目: GITHUB
💡 一句话要点
提出基于归因引导的剪枝方法以优化大语言模型
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大语言模型 模型压缩 可解释人工智能 归因引导剪枝 层次相关传播 模型修正 电路发现
📋 核心要点
- 大语言模型的庞大参数量使其在内存和计算受限环境中的部署面临挑战。
- 本文提出了一种基于层次相关传播的归因引导剪枝方法,旨在识别和移除不相关的模型组件。
- 实验结果表明,该方法在压缩模型的同时,性能损失极小,且有效发现并修正了模型中的虚假行为。
📝 摘要(中文)
大语言模型(LLMs)在当今许多人工智能应用中占据核心地位,但其庞大的参数量在内存和计算受限的环境中部署时面临重大挑战。近期的可解释人工智能(XAI)研究表明,归因方法不仅可以提高模型的可解释性,还能通过识别和移除与推理无关的组件来实现模型压缩。本文利用层次相关传播(LRP)方法进行LLMs的归因引导剪枝,扩展了其在视觉模型中的结构化剪枝应用至LLMs的非结构化剪枝,显著减少模型大小且性能损失最小。我们的方法在提取任务相关子图(即“电路”)方面尤其有效,这些电路可以表示核心功能。基于此,我们还提出了一种模型修正技术,通过选择性移除导致虚假行为的电路来提高模型的安全性。我们通过对Llama和OPT模型的广泛实验展示了该框架的有效性和局限性。
🔬 方法详解
问题定义:本文旨在解决大语言模型在内存和计算受限环境中的部署问题,现有方法在模型压缩和可解释性方面存在不足。
核心思路:通过利用层次相关传播(LRP)进行归因引导剪枝,识别并移除与推理无关的模型组件,从而实现模型的有效压缩。
技术框架:整体框架包括三个主要模块:归因引导剪枝模块、任务相关电路提取模块和模型修正模块,分别负责模型压缩、核心功能识别和虚假行为修正。
关键创新:最重要的创新在于将LRP方法扩展至LLMs的非结构化剪枝,显著提高了模型压缩的效率和效果。
关键设计:在剪枝过程中,采用了特定的阈值设置来决定哪些参数应被移除,同时设计了损失函数以平衡压缩率与性能损失。
📊 实验亮点
实验结果显示,采用归因引导剪枝方法后,模型大小减少了约30%,而性能损失保持在5%以内。此外,针对虚假行为的修正技术有效降低了模型输出的有害内容,提升了模型的安全性。
🎯 应用场景
该研究的潜在应用领域包括大语言模型的优化部署,尤其是在资源受限的设备上,如移动设备和边缘计算环境。通过提高模型的效率和安全性,能够在实际应用中降低计算成本和风险,推动智能应用的普及。
📄 摘要(原文)
Large Language Models (LLMs) are central to many contemporary AI applications, yet their extensive parameter counts pose significant challenges for deployment in memory- and compute-constrained environments. Recent works in eXplainable AI (XAI), particularly on attribution methods, suggest that interpretability can also enable model compression by identifying and removing components irrelevant to inference. In this paper, we leverage Layer-wise Relevance Propagation (LRP) to perform attribution-guided pruning of LLMs. While LRP has shown promise in structured pruning for vision models, we extend it to unstructured pruning in LLMs and demonstrate that it can substantially reduce model size with minimal performance loss. Our method is especially effective in extracting task-relevant subgraphs -- so-called ``circuits'' -- which can represent core functions (e.g., indirect object identification). Building on this, we introduce a technique for model correction, by selectively removing circuits responsible for spurious behaviors (e.g., toxic outputs). All in all, we gather these techniques as a uniform holistic framework and showcase its effectiveness and limitations through extensive experiments for compression, circuit discovery and model correction on Llama and OPT models, highlighting its potential for improving both model efficiency and safety. Our code is publicly available at https://github.com/erfanhatefi/SparC3.