Exact Unlearning of Finetuning Data via Model Merging at Scale
Organizations: Computer Science Department · Machine Learning Department
Abstract
Approximate unlearning has gained popularity as an approach to efficiently update an LLM so that it behaves (roughly) as if it was not trained on a subset of data to begin with. However, existing methods are brittle in practice and can easily be attacked to reveal supposedly unlearned information. To alleviate issues with approximate unlearning, we instead propose SIFT-Masks (SIgn-Fixed Tuning-Masks), an exact unlearning method based on model merging. SIFT-Masks addresses two key limitations of standard model merging: (1) merging a large number of tasks can severely harm utility; and (2) methods that boost utility by sharing extra information across tasks make exact unlearning prohibitively expensive. SIFT-Masks solves these issues by (1) applying local masks to recover task-specific performance; and (2) constraining finetuning to align with a global sign vector as a lightweight approach to determine masks independently before merging. Across four settings where we merge up to 500 models, SIFT-Masks improves accuracy by 5-80% over naive merging and uses up to 250x less compute for exact unlearning compared to other merging baselines.
Figures & tables
| Method | Description | Unlearning Cost | Storage |
|---|---|---|---|
| Central FT | Train a single model on all pooled data | ||
| (1) Exact unlearning methods | |||
| SISA [ 13 ] | Ensemble models trained on random data shards | ||
| APA [ 20 ] | Merge models trained on data-driven shards | ||
| (2) Model merging methods | |||
| FT + Merge [ 18 ] | Merge models trained on task-level shards | ||
| Dataset | Tasks | Labels | Label Type |
|---|---|---|---|
| TOFU | 200 | 50256 | tokens |
| Sent140 | 500 | 2 | sentiment |
| 500 | 20 | subreddits | |
| StackOverflow | 500 | 10 | tags |
| MATH | 35 | - | exact match |
| PubMed | 100 | 50256 | tokens |
| Method | MATH (35 tasks) | PubMed (100 tasks) |
|---|---|---|
| FT + Merge | 18.8 | 37.4 |
| TALL-masks | 21.8 | 51.9 |
| SIFT-Masks | 22.6 | 80.7 |
| Method | L1 | Sign | Probability |
|---|---|---|---|
| Distance | Conflicts | ||
| FT + Merge | 606K | 587M | 0.09 |
| Loc.-and-Stitch (merge-only) | 561K | 95M | 0.05 |
| Loc.-and-Stitch (merge-and-localize) | 203K | 95M | 0.24 |
| TALL-masks | 549K | 0 | 0.31 |
| SIFT-Masks | 223K | 0 | 0.94 |
| Method | Density | FT+Merge | +Mask |
|---|---|---|---|
| Loc.-and-Stitch | |||
| – Dataless | 0.05 | 0.01 | 0.20 |
| – Dataless | 0.20 | 0.05 | 0.24 |
| – =100 | 0.40 | 0.09 | 0.13 |
| SIFT-Masks | 0.57 | 0.09 | 0.94 |
| Method | flan-t5-small | flan-t5-large |
|---|---|---|
| FT + Merge | 0.22 | 0.59 |
| TALL-masks | 0.29 | 0.74 |
| SIFT-Masks | 0.29 | 0.78 |
| StackOverflow | ||
| FT + Merge | 0.40 | 0.66 |
| Method | LoRA | Full FT |
|---|---|---|
| FT + Merge | 0.57 | 0.61 |
| TALL-masks | 0.73 | 0.74 |
| SIFT-Masks | 0.76 | 0.80 |
| StackOverflow | ||
| FT + Merge | 0.66 | 0.66 |
| Method | Accuracy | Storage Cost |
|---|---|---|
| Local LoRAs | 0.86 | 95 GB |
| FT + Merge | 0.59 | 38.0 MB |
| Central FT | 0.74 | 38.0 MB |
| EMR-merging | 0.72 | 3.01 GB |
| TALL-masks | 0.73 | 3.01 GB |
| SIFT-Masks | 0.82 | 3.01 GB |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Labels (per task) | Examples (per task) | ||||||
|---|---|---|---|---|---|---|---|
| Dataset | Model | Max | Total | Min | Max | Total | |
| TOFU | GPT2-XL | 200 | - | 50256 | 20 | 20 | 4000 |
| Sent140 | Llama3.2-1B-Instruct | 500 | 2 | 2 | 52 | 440 | 40504 |
| FLAN-T5-Large | 500 | 12 | 20 | 4 | 718 | 67484 | |
| StackOverflow | FLAN-T5-Large | 500 | 10 | 10 | 124 | 632 | 97037 |
| Sent140 | |||||
| Model | Params | Format | Zeroshot | Finetune | Merge |
| GPT2-XL | 1.61B | CLS Head | 50.0 | 85.7 | 70.8 |
| Llama 3.2-1B | 1.24B | CLS Head | 50.0 | 69.4 | 55.3 |
| CLS Head + ZS Init | 50.0 | 67.4 | 53.0 | ||
| LM Head + Prompt | 68.5 | 85.5 | 77.1 | ||
| Model | Params | Format | Zeroshot | Finetune | Merge |
|---|---|---|---|---|---|
| Llama 3.2-1B | 1.24B | LM Head + Prompt | 10.0 | 75.7 | 24.9 |
| FLAN-T5-Large | 783M | CLS Head | 3.0 | 61.3 | 19.3 |
| CLS Head + ZS Init | 7.1 | 61.8 | 16.5 | ||
| CLS Head + ZS Init + Prompt | 6.7 | 70.5 | 21.7 | ||
| LM Head + Prompt | 29.7 | 76.5 | 43.2 | ||
| Model | Zeroshot | FT + Merge | TALL-masks | SIFT-Masks |
|---|---|---|---|---|
| TOFU | ||||
| GPT2-XL | 11.1 | 11.1 | 50.3 | 95.7 |
| FLAN-T5-Large | 8.1 | 8.0 | 18.7 | 47.5 |
| Llama3-1B-Instruct | 9.8 | 9.7 | 41.2 | 82.4 |
| Sent140 | ||||
| GPT2-XL | 0.0 | 62.5 | 72.3 | 70.0 |
| Method | VerbMem | Forget | PrivLeak | Retain |
|---|---|---|---|---|
| Target (pre-unlearn) | 58.4 | 63.9 | -99.8 | 55.2 |
| Retrain (unlearned) | 20.8 | 33.1 | 0 | 55.0 |
| GA_GDR | 4.9 | 31.0 | 108.1 | 27.3 |
| NPO_GDR | 1.2 | 54.6 | 105.8 | 40.5 |
| FT + Merge | 18.7 | 30.8 | 0 | 33.1 |
| TALL-masks | 19.1 | 29.3 | 0 | 35.1 |
| LoRA (r=4) | LoRA (r=16) | LoRA (r=64) | Full FT | |
|---|---|---|---|---|
| TALL-masks | 73.7 | 73.8 | 74.7 | 74.2 |
| SIFT-Masks | 76.4 | 76.5 | 76.8 | 80.2 |
| Biased Rademacher | 0.5 (default) | 0.7 | 0.9 |
|---|---|---|---|
| TOFU Probability | 0.965 | 0.963 | 0.962 |
Machine Unlearning
Machine unlearning removes the influence of selected data or concepts from trained models while preserving useful behavior and avoiding full retraining.
See all 351 papers