Bayesian Data Scheduler Provides Adaptive Defense Against Harmful Fine-Tuning of Large Language ModelsAdaptive Defense against Harmful Fine-Tuning for Large Language Models via Bayesian Data Scheduler
The paper proposes the Bayesian Data Scheduler BDS, a fine-tuning-stage defense method that requires no attack simulation, for reducing the safety risks of harmful fine-tuning of large language models. BDS models harmful fine-tuning defense as a Bayesian inference problem: given a fine-tuning dataset and an alignment dataset, it learns a posterior distribution over the safety attribute of each data point, then weights the data according to safety attributes sampled from the posterior distribution, so as to constrain the fine-tuning process and weaken the influence of harmful data. Because the posterior distribution is conditioned on the fine-tuning dataset, BDS can adapt the defense to the specific dataset. The authors also introduce a neural scheduler based on amortized Bayesian learning, enabling the method to transfer to new data without retraining. The authors state that under multiple attack and defense settings, the method achieves state-of-the-art performance, and the code has been released on GitHub.