Safety-Critical Parameters in LLMs and MLLMs: Identification, Characterization, and Intervention
Zefeng Wu, Weiwei Qi, Wei Gu, Tianhang Zheng, Zikang Zhang, Xiaojun Jia, Zhan Qin, Kui Ren
Abstract
Recent studies have started to investigate internal safety-relevant components, such as safety-critical parameters and neurons, in large language models (LLMs) by gradient-based importance attribution to guide safety interventions. However, existing gradient-based methods have four limitations. First, they rely on gradients of generic training objectives, which measure discrepancies between model outputs and specific response patterns rather than directly measuring output safety. Second, they overlook parameter variations across layers and modules. Third, safety-critical parameters in multimodal large language models (MLLMs) remain underexplored. Furthermore, a single gradient is insufficient to reflect local parameter geometry. To address the first three limitations, we propose Multimodal Safety Index (MSI), which quantifies output safety using the expected safety value and develops estimators for its gradient and parameter variation magnitudes for importance attribution. To address the fourth limitation, we extend MSI to Neighborhood-Consensus Multimodal Safety Index (NC-MSI) by aggregating gradients across locally perturbed model states. Using NC-MSI, we identify distinct safety-critical parameter distributions in LLMs and MLLMs and propose two targeted intervention strategies: Safety Enhancement Tuning (SET) aligns unsafe models by updating only a few safety-critical parameters, preserving general capabilities. Safety-Preserving Adaptation (SPA) freezes critical parameters and adopts our optimizer, SafeAdamW, enabling aligned models to acquire new capabilities without significant safety degradation. Experiments across LLMs and MLLMs demonstrate that SET reduces the attack success rate of under-aligned models by over 70% in only 100 steps using 1% of parameters, whereas SPA limits safety degradation of aligned models to within 0.5% on average after 1,000 steps of fine-tuning.
Create a lesson
Metadata
- Comments
- 26 pages, 7 figures, 21 tables. The abstract has been slightly shortened to comply with arXiv's character limit. The full abstract is available in the PDF
Related papers
SLAE: Sparse Locality-Aware Editing for Safety-Aligned MLLMs
Shared title terminologycs.CRJiaqing Li, Shide Zhou, Tianlong Yu et al.
SteelYourHeart: Catching LLMs Taking Shortcuts in Vulnerability Detection
Shared title terminologycs.CRRun Hao, Zhuoran Tan
From Binary to Source Code: Measuring LLMs Reverse Engineering Capabilities on Obfuscated Binaries
Shared title terminologycs.CRDavid Schmidt, Patrick Felbauer, Gabriel Gegenhuber et al.
Typographic Response Jailbreak: A Safety Blind Spot in Image Editing Models
Shared title terminologycs.CRWenzhuo Xu, Zonghao Ying, Deyue Zhang et al.
Partial Parameter Recovery from Gemma-Style Architectures via Black-Box Queries: Identifiability and Limits
Shared title terminologycs.CRRuijie Ma, Yi Chen, Hongbo Yu et al.
Secure-Miner: Improving Secure Code Generation for LLMs by Mining Secure Coding Practices
Shared title terminologycs.CRJunjie Li, Jinqiu Yang