atlas

Research map / Large language models / Instruction and fine-tuning

Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbation

NeurIPS 2025 · Large language models › Instruction and fine-tuning · approach: Safety alignment after fine-tuning · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Shows that random post-fine-tuning weight noise can undo harmful fine-tuning but hurts utility, and proposes Panacea, which optimizes an adaptive perturbation applied after fine-tuning via max-max optimization to reduce harmful score while preserving fine-tuning accuracy.

Problem

Harmful fine-tuning attacks in fine-tuning-as-a-service compromise safety alignment; existing pre-fine-tuning defenses (Vaccine, RepNoise) are fragile as fine-tuning proceeds, and naive random perturbations recover safety only at the cost of downstream accuracy.

Approach

Optimize, during fine-tuning, an adaptive norm-bounded perturbation that maximizes the increase in harmful loss when added to the model, and apply it to the fine-tuned weights after fine-tuning, using alternating inner (closed-form gradient-direction) and outer updates.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Apply Panacea's optimized adaptive perturbation after fine-tuning (ablation)Llama2-7B · GSM8KHS: 44.3 -> 20.1Helped
Apply Panacea's optimized adaptive perturbation after fine-tuning (ablation)Llama2-7B · AlpacaEvalFA: 44.23 -> 48.08Helped
Apply Panacea's optimized adaptive perturbation after fine-tuning (ablation)Llama2-7B · SST2FA: 94.27 -> 92.78Hurt
Use Panacea instead of SFTLlama2-7B · Harmful ratio (average)HS: 40.3 -> 19.1Helped
Use Panacea instead of SFTLlama2-7B · Harmful ratio (average)FA: 15.8 -> 16.2Helped
Use Panacea instead of SFTLlama2-7B · Clean fine-tuning dataFA: 16.4 -> 15.0Hurt
Increase perturbation intensity ρ from 0 to 5 (ablation)Panacea on GSM8K · GSM8K, harmful ratio=0.1HS: 45.8 -> 3.4Helped
Increase perturbation intensity ρ from 0 to 5 (ablation)Panacea on GSM8K · GSM8K, harmful ratio=0.1FA: 16.2 -> 6.0Hurt
Increase regularizer intensity λ from 0.001 to 0.01 (ablation)Panacea on GSM8K · GSM8K, harmful ratio=0.1HS: 20.1 -> 5.3Helped
Increase regularizer intensity λ from 0.001 to 0.01 (ablation)Panacea on GSM8K · GSM8K, harmful ratio=0.1FA: 16.7 -> 8.7Hurt
Use Panacea instead of SFTLlama2-7B · AlpacaEvalHS: 23.1 -> 18.7Helped

Surprising findings

Limitations

Experimental setup

Datasets: BeaverTails RepNoise alignment/harmful data GSM8K SST2 AlpacaEval AGNEWS AdvBench Sorry-Bench LLM-LAT

Benchmarks: BeaverTails test set (HS) GSM8K SST2 AlpacaEval AGNEWS AdvBench Sorry-Bench

Metrics: harmful score fine-tuning accuracy fulfillment rate

Baselines: SFT Vaccine RepNoise Booster Antidote Safe LoRA ConstrainSFT SaLoRA

Builds on: Vaccine RepNoise Booster SAM

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy