GRACE:Gradient-guided Coreset Selection for LLM Unlearning
Organizations: University of Pisa, Pisa, Italy · Scuola Superiore Sant’Anna, Pisa, Italy · Aarhus University, Aarhus, Denmark
Abstract
Machine Unlearning methods for Large Language Models typically assume pre-specified forget and retain sets. In realistic settings, however, requests may provide only a few examples of undesired behavior, requiring forget and retain sets to be inferred from heterogeneous corpora. We study this data-selection problem and propose GRACE , a gradient-guided coreset selection method that constructs both forget and retain sets for LLM unlearning. GRACE first computes a forget direction from seed examples that elicit the undesired behavior, then selects a compact forget coreset whose gradients approximate this direction using non-negative orthogonal matching pursuit. To preserve model utility, it selects retain examples after projecting out the forget direction and applying clustered orthogonal matching pursuit in the remaining gradient space. Across two target domains, two model families, and four unlearning algorithms, GRACE improves model utility while maintaining comparable forget quality, with particularly consistent gains over prior gradient-based selection methods.
Figures & tables
| Method | MUSE ( ) | WMDP-Bio ( ) |
|---|---|---|
| LLaMA - 3.1 8B Instruct | ||
| Embeddings | 47.7% | 55.55% |
| RASLIK | 28.89% | 61.67% |
| Ours | 46.67% | 82.22% |
| Qwen 2.5 3B Instruct | ||
| Embeddings | 47.7% | 55.55% |
| MU Method | Selection | LLaMA MU | Qwen MU |
|---|---|---|---|
| GradDiff | Embedding | ||
| RASLIK | |||
| GRACE | |||
| SimNPO | Embedding | ||
| RASLIK | |||
| GRACE |
| Algorithm | Embedding | RASLIK | GRACE |
|---|---|---|---|
| GradDiff | 1.000 | 0.990 | 0.990 |
| SimNPO | 0.950 | 0.962 | 0.958 |
| NPO | 0.982 | 0.982 | 0.977 |
| RMU | 0.982 | 0.978 | 0.978 |
| Metric | Embedding | RASLIK | Ours | |
|---|---|---|---|---|
| Leak (Forget) | ||||
| Dev (Forget) | ||||
| Coh (Forget) | ||||
| Pres (Retain) | ||||
| Sem (Retain) | ||||
| Coh (Retain) |
Appendix figures & tables15 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | LLaMA | Qwen | Reduced Dim |
|---|---|---|---|
| WMDP-Bio | 13,631,488 | 7,372,800 | 65,536 |
| MUSE | 6,815,744 | 3,686,400 | 65,536 |
| Selection Method | WMDP-Bio | MUSE |
|---|---|---|
| RASLIK | 36 | 26.5 |
| GRACE | 37.2 | 25 |
| Split | Metric | Krippendorff’s |
|---|---|---|
| Forget | Answer Leakage | 0.66 |
| Deviation Quality | 0.45 | |
| Response Coherence | 0.73 | |
| Test | Answer Preservation | 0.91 |
| Coherence and Correctness | 0.89 | |
| Semantic Quality | 0.86 |
| LLaMA | Qwen | ||||||||
| WMDP-Bio | MUSE | WMDP-Bio | MUSE | ||||||
| Algo | Selection | FQ | MUT | FQ | MUT | FQ | MUT | FQ | MUT |
| Pre-Unlearning | - | 0.60 | 0.68 | 0.11 | 0.67 | 0.75 | 0.60 | 0.57 | 0.56 |
| GradDiff | Emb. | 1.00 | 0.18 | 1.00 | 0.24 | 1.00 | 0.11 | 1.00 | 0.24 |
| RASLIK | 0.99 | 0.34 | 0.99 | 0.26 | 0.99 | 0.12 | 0.99 | 0.09 | |
| GRACE | 0.99 | 0.49 | 0.99 | 0.43 | 0.99 | 0.31 | 0.99 | 0.16 | |
| LLaMA | Qwen | ||||||||||||||||||||||||
| WMDP-Bio | MUSE | WMDP-Bio | MUSE | ||||||||||||||||||||||
| Forget | Retain | Forget | Retain | Forget | Retain | Forget | Retain | ||||||||||||||||||
| Algo | Selection | Leak | Dev | Coh | Pres | Sem | Coh | Leak | Dev | Coh | Pres | Sem | Coh | Leak | Dev | Coh | Pres | Sem | Coh | Leak | Dev | Coh | Pres | Sem | Coh |
| GradDiff | Embedding | 10.000 | 6.640 | 1.015 | 3.290 | 2.968 | 2.808 | 10.000 | 6.430 | 1.020 | 3.755 | 3.885 | 3.765 | 10.000 | 7.935 | 1.140 | 2.028 | 1.928 | 1.805 | 9.990 | 5.060 | 1.000 | 3.849 | 4.593 | 4.417 |
| RASLIK | 9.955 | 5.765 | 1.010 | 5.003 | 5.390 | 5.390 | 9.990 | 5.490 | 1.010 | 4.111 | 4.628 | 4.518 | 10.000 | 5.565 | 1.010 | 2.538 | 2.548 | 2.457 | 10.000 | 5.740 | 1.020 | 2.995 | 2.960 | 2.889 | |
| GRACE | 10.000 | 5.975 | 1.005 | 7.465 | 8.184 | 8.003 | 10.000 | 5.590 | 1.030 | 5.690 | 6.475 | 6.370 | 10.000 | 5.860 | 1.000 | 5.573 | 5.540 | 5.130 | 9.930 | 5.380 | 1.020 | 4.775 | 4.575 | 4.300 | |
| LLaMA | Qwen | ||||||||
| WMDP-Bio | MUSE | WMDP-Bio | MUSE | ||||||
| Algo | Selection | MMLU | GPQA | MMLU | GPQA | MMLU | GPQA | MMLU | GPQA |
| Pre-Unlearning | - | 52.73 | 27.90 | 54.07 | 29.91 | 56.72 | 27.68 | 56.28 | 30.36 |
| GradDiff | Emb. | 28.76 | 27.68 | 30.02 | 27.68 | 22.88 | 27.90 | 23.65 | 27.46 |
| RASLIK | 23.19 | 26.12 | 25.64 | 26.79 | 22.95 | 26.56 | 23.09 | 26.34 | |
| GRACE | 23.73 | 28.12 | 45.31 | 28.35 | 23.27 | 27.01 | 23.04 | 26.56 | |
| Candidate Pool | |||||
|---|---|---|---|---|---|
| FRA (%) | 81 | 81 | 82 | 81 | 80 |
| WMDP-Bio | MUSE | |||
|---|---|---|---|---|
| - Clusters | FQ | MUT | FQ | MUT |
| 5 | 0.96 | 0.54 | 0.98 | 0.46 |
| 10 | 0.96 | 0.52 | 0.97 | 0.48 |
| 15 | 0.96 | 0.52 | 0.99 | 0.43 |
| 20 | 0.95 | 0.57 | 0.99 | 0.44 |
| 50 | 0.94 | 0.52 | 0.97 | 0.44 |
| Ablated | GRACE | ||||
|---|---|---|---|---|---|
| Ablation | Setting | FQ | MUT | FQ | MUT |
| No Projection | SimNPO / Bio | 0.91 | 0.58 | 0.95 | 0.57 |
| SimNPO / MUSE | 0.93 | 0.49 | 0.96 | 0.48 | |
| RMU / Bio | 0.96 | 0.34 | 0.96 | 0.34 | |
| RMU / MUSE | 0.99 | 0.18 | 0.99 | 0.19 | |
| No Clustering | SimNPO / Bio | 0.95 | 0.57 | 0.95 | 0.57 |
| Dataset | Selection | FQ | MUT |
|---|---|---|---|
| WMDP-Bio | GRACE | 0.95 | 0.57 |
| RASLIK-F + GRACE-R | 0.96 | 0.55 | |
| GRACE-F + RASLIK-R | 0.96 | 0.51 | |
| RASLIK | 0.96 | 0.48 | |
| MUSE | GRACE | 0.95 | 0.48 |
| RASLIK-F + GRACE-R | 0.95 | 0.45 |
| Selection | Bio | MUSE |
|---|---|---|
| RASLIK | 48.3% | 33.3% |
| GRACE | 81.7% | 47.7% |
| Algo | Data | Sel. | FQ | MUT | MMLU | GPQA |
|---|---|---|---|---|---|---|
| GradDiff | Bio | Emb. | 1.00 | 0.25 | 32.32 | 23.21 |
| RASLIK | 0.99 | 0.15 | 23.96 | 27.46 | ||
| GRACE | 1.00 | 0.51 | 29.80 | 26.34 | ||
| MUSE | Emb. | 1.00 | 0.34 | 28.02 | 22.10 | |
| RASLIK | 1.00 | 0.29 | 33.73 | 26.79 | ||
| GRACE | 1.00 | 0.44 | 32.32 | 26.56 |
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