Weiwei Qi
Author directory2026
Towards Identification and Intervention of Safety-Critical Parameters in Large Language Models
Weiwei Qi | Zefeng Wu | Tianhang Zheng | Zikang Zhang | Xiaojun Jia | Zhan Qin | Kui Ren
Findings of the Association for Computational Linguistics: ACL 2026
Weiwei Qi | Zefeng Wu | Tianhang Zheng | Zikang Zhang | Xiaojun Jia | Zhan Qin | Kui Ren
Findings of the Association for Computational Linguistics: ACL 2026
Ensuring Large Language Model (LLM) safety is crucial, yet the lack of a clear understanding about safety mechanisms hinders the development of precise and reliable methodologies for safety intervention across diverse tasks. To better understand and control LLM safety, we propose the Expected Safety Impact (ESI) framework for quantifying how different parameters affect LLM safety. Based on ESI, we reveal distinct safety-critical patterns across different LLM architectures: In dense LLMs, many safety-critical parameters are located in value matrices (V) and MLPs in middle layers, whereas in Mixture-of-Experts (MoE) models, they shift to late-layer MLPs. Leveraging ESI, we further introduce two targeted intervention paradigms for safety enhancement and preservation, i.e., Safety Enhancement Tuning (SET) and Safety Preserving Adaptation (SPA). SET can align unsafe LLMs by updating only a few safety-critical parameters, effectively enhancing safety while preserving original performance. SPA safeguards well-aligned LLMs during capability-oriented intervention (e.g., instruction tuning) by preventing disruption of safety-critical weights, allowing the LLM to acquire new abilities while maintaining safety capabilities. Extensive evaluations on different LLMs demonstrate that SET can reduce the attack success rates of unaligned LLMs by over 50% with only a 100-iteration update on 1% of model weights. SPA can limit the safety degradation of aligned LLMs within 1% after a 1,000-iteration instruction fine-tuning on different tasks. Our code is available at: https://github.com/ZJU-LLM-Safety/SafeWeights-ACL
DataShield: Uncovering Risky Fine-Tuning Data Across LLMs Through Consensus Subspace Alignment
Zefeng Wu | Weiwei Qi | Jielong Chen | Tianhang Zheng | Di Hong | Chaochao Lu | Liang He | Zhan Qin | Kui Ren
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Zefeng Wu | Weiwei Qi | Jielong Chen | Tianhang Zheng | Di Hong | Chaochao Lu | Liang He | Zhan Qin | Kui Ren
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Fine-tuning large language models (LLMs) on domain-specific datasets has become a standard paradigm for adapting LLMs to specialized applications. However, recent work has shown that even fine-tuning on benign task-specific data can substantially weaken the safety capabilities of LLMs. While existing efforts have made progress in identifying data responsible for safety degradation, they usually rely on a single mean vector computed over a specific model with its tokenizer to represent the safety direction, which limits both the effectiveness and transferability of their risk assessment measures. To address these limitations, we propose DataShield, a data assessment framework that identifies risky fine-tuning samples and response segments through consensus subspace alignment over joint safety-critical semantic spaces derived from multiple safety-aligned LLMs.Within these spaces, DataShield extracts consensus safe and unsafe subspaces using semantic spectral decomposition over safe and unsafe data representations. The risk of a data sample or segment is then estimated by measuring its relative alignment with the unsafe and safe subspaces, enabling both sample-level filtering and fine-grained segment-level masking. Compared with state-of-the-art filtering and masking baselines, DataShield reduces ASR by 14.6% with sample filtering and 32.3% with segment masking, while preserving downstream utility and avoiding target-model-specific risk computation.