Adaptive Defense against Harmful Fine-Tuning for Large Language Models via Bayesian Data Scheduler
Zixuan Hu, Li Shen, Zhenyi Wang, Yongxian Wei, Dacheng Tao
Abstract
Harmful fine-tuning poses critical safety risks to fine-tuning-as-a-service for large language models. Existing defense strategies preemptively build robustness via attack simulation but suffer from fundamental limitations: (i) the infeasibility of extending attack simulations beyond bounded threat models due to the inherent difficulty of anticipating unknown attacks, and (ii) limited adaptability to varying attack settings, as simulation fails to capture their variability and complexity. To address these challenges, we propose Bayesian Data Scheduler (BDS), an adaptive tuning-stage defense strategy with no need for attack simulation. BDS formulates harmful fine-tuning defense as a Bayesian inference problem, learning the posterior distribution of each data point's safety attribute, conditioned on the fine-tuning and alignment datasets. The fine-tuning process is then constrained by weighting data with their safety attributes sampled from the posterior, thus mitigating the influence of harmful data. By leveraging the post hoc nature of Bayesian inference, the posterior is conditioned on the fine-tuning dataset, enabling BDS to tailor its defense to the specific dataset, thereby achieving adaptive defense. Furthermore, we introduce a neural scheduler based on amortized Bayesian learning, enabling efficient transfer to new data without retraining. Comprehensive results across diverse attack and defense settings demonstrate the state-of-the-art performance of our approach. Code is available at https://github.com/Egg-Hu/Bayesian-Data-Scheduler.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
5 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Safeguarding LLM Fine-tuning via Push-Pull Distributional Alignment cites LoRA: Low-Rank Adaptation of Large Language Models
- Safeguarding LLM Fine-tuning via Push-Pull Distributional Alignment cites Data Selection for Language Models via Importance Resampling
- Safeguarding LLM Fine-tuning via Push-Pull Distributional Alignment cites LESS: Selecting Influential Data for Targeted Instruction Tuning
- Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient Influence cites LoRA: Low-Rank Adaptation of Large Language Models
- Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient Influence cites Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!
- Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient Influence cites Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbation
- Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbation cites Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient Influence
- Data Selection for Language Models via Importance Resampling cites RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Models
- Surgery: Mitigating Harmful Fine-Tuning for Large Language Models via Attention Sink cites Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!
- Surgery: Mitigating Harmful Fine-Tuning for Large Language Models via Attention Sink cites Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbation
- Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To! cites Data Selection for Language Models via Importance Resampling
- Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To! cites RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Models
- LESS: Selecting Influential Data for Targeted Instruction Tuning cites Data Selection for Language Models via Importance Resampling
- OASIS: Mitigating Harmful Fine-tuning Attacks on LLMs via Orthogonal and Adaptive Safety Alignment Strategy cites LoRA: Low-Rank Adaptation of Large Language Models
- OASIS: Mitigating Harmful Fine-tuning Attacks on LLMs via Orthogonal and Adaptive Safety Alignment Strategy cites Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbation
Cited by top-tier papers5
- Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning PerturbationYibo Wang, Tiansheng Huang, Li Shen, Huanjin Yao et al.NeurIPS 2025 · 22 citations
- Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient InfluenceQuoc Minh Nguyen, Trung Le, Jing Wu, Anh Tuan Bui et al.ICLR 2026 · 10 citations
- Surgery: Mitigating Harmful Fine-Tuning for Large Language Models via Attention SinkGuozhi Liu, Weiwei Lin, Tiansheng Huang, Ruichao Mo et al.ICML 2026 · 5 citations
- Safeguarding LLM Fine-tuning via Push-Pull Distributional AlignmentHaozhong Wang, Zhuo Li, Yibo Yang, He Zhao et al.ACL 2026 · 1 citation
- OASIS: Mitigating Harmful Fine-tuning Attacks on LLMs via Orthogonal and Adaptive Safety Alignment StrategyJiayu Tang, Guowei Peng, Qiuhao Xie, Yuning Yang et al.ACL 2026
Builds on43
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
- Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!Xiangyu Qi, Yi Zeng, Tinghao Xie, Pin-Yu Chen et al.ICLR 2024 · 1,104 citations
- RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language ModelsSamuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi et al.EMNLP Findings 2020 · 692 citations
- LESS: Selecting Influential Data for Targeted Instruction TuningMengzhou Xia, Sadhika Malladi, Suchin Gururangan, Sanjeev Arora et al.ICML 2024 · 460 citations
- Data Selection for Language Models via Importance ResamplingSang Michael Xie, Shibani Santurkar, Tengyu Ma, Percy LiangNeurIPS 2023 · 383 citations
Related papers
- Booster: Tackling Harmful Fine-tuning for Large Language Models via Attenuating Harmful PerturbationTiansheng Huang, Sihao Hu, Fatih Ilhan, Selim Furkan Tekin et al.ICLR 2025
- Antidote: Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning AttackTiansheng Huang, Gautam Bhattacharya, Pratik Joshi, Joshua Kimball et al.ICML 2025
- SDD: Self-Degraded Defense against Malicious Fine-tuningZixuan Chen, Weikai Lu, Xin Lin, Ziqian ZengACL 2025
- Safe Delta: Consistently Preserving Safety when Fine-Tuning LLMs on Diverse DatasetsNing Lu, Shengcai Liu, Jiahao Wu, Weiyu Chen et al.ICML 2025
- NLSR: Neuron-Level Safety Realignment of Large Language Models Against Harmful Fine-TuningXin Yi, Shunfan Zheng, Linlin Wang, Gerard de Melo et al.AAAI 2025 · 38 citations
