Hallucination-Guided Unlearning: Using Hallucination Traces to Reveal Overfitted Memories
Organizations: Peking University · UTS Business School, University of Technology Sydney · Massachusetts Institute of Technology · University of Massachusetts Boston ·
Abstract
Selective unlearning is increasingly important for the safety and compliance of large language models. Harmful or memorized content is often entangled with useful knowledge and difficult to enumerate. We use the model's own failures to identify candidates for unlearning. We propose Hallucination-Guided Unlearning (HGU), which uses hallucinations as diagnostic signals. HGU localizes unsupported spans via evidence and internal consensus, traces a sparse set of high-responsibility MLP neurons, and edits them with compact gates under a utility-preserving KL constraint. On TOFU, HGU achieves the best MU-FE trade-off, with Avg scores of 0.7221 (forget05) and 0.7699 (forget10), and the highest SepS H-Avg (0.4382/0.4715) under mixed forget/retain prompts. On the WMDP auxiliary task, HGU yields the strongest forgetting (e.g., 14.2 on Economics) while improving Retain (52.7) and MMLU (57.2). These results suggest that tracing hallucinations enables targeted, post-hoc unlearning that better balances forgetting efficacy and general utility without full retraining.
Figures & tables
| forget01 | forget05 | forget10 | |||||||
| Method | MU | FE | Avg | MU | FE | Avg | MU | FE | Avg |
| GA+GD | 0.6696 | 0.5908 | 0.6302 | 0.0000 | 0.8772 | 0.4386 | 0.5592 | 0.9346 | 0.7469 |
| GA+KL | 0.6478 | 0.6030 | 0.6254 | 0.0000 | 0.9303 | 0.4651 | 0.0000 | 0.9020 | 0.4510 |
| NPO+GD | 0.6414 | 0.6109 | 0.6262 | 0.5465 | 0.6921 | 0.6193 | 0.5648 | 0.7668 | 0.6658 |
| NPO+KL | 0.6289 | 0.6065 | 0.6177 | 0.5231 | 0.7089 | 0.6160 | 0.4412 | 0.7680 | 0.6046 |
| DPO+GD | 0.7564 | 0.5335 | 0.6450 | 0.0000 | 0.8243 | 0.4122 | 0.0000 | 0.8041 | 0.4021 |
| forget01 | forget05 | forget10 | ||||||||||
| Method | MU | FE | SepS | H-Avg. | MU | FE | SepS | H-Avg. | MU | FE | SepS | H-Avg. |
| Untargeted unlearning | ||||||||||||
| GA+GD | 0.7043 | 0.6233 | 0.0225 | 0.0631 | 0.1061 | 0.9075 | 0.0063 | 0.0177 | 0.5263 | 0.9271 | 0.0065 | 0.0192 |
| GA+KL | 0.7109 | 0.6189 | 0.0284 | 0.0784 | 0.0000 | 0.8980 | 0.0001 | 0.0000 | 0.0000 | 0.9438 | 0.0007 | 0.0000 |
| NPO+GD | 0.7196 | 0.6371 | 0.0347 | 0.0945 | 0.5469 | 0.8300 | 0.0331 | 0.0903 | 0.4515 | 0.8045 | 0.0675 | 0.1642 |
| NPO+KL | 0.7150 | 0.6366 | 0.0298 | 0.0822 | 0.3657 | 0.8172 | 0.0647 | 0.1546 | 0.2111 | 0.8418 | 0.0070 | 0.0203 |
| Physics | Law | Economics | |||||||
| Method | Forget | Retain | MMLU | Forget | Retain | MMLU | Forget | Retain | MMLU |
| Base (no unlearning) | 38.8 | 34.6 | 58.6 | 56.7 | 71.3 | 58.6 | 60.2 | 45.6 | 58.6 |
| RMU | 27.0 | 29.2 | 57.1 | 27.8 | 37.0 | 54.5 | 27.3 | 41.2 | 55.0 |
| FALCON | 24.5 | 30.1 | 57.3 | 25.2 | 38.5 | 54.8 | 24.8 | 42.8 | 55.2 |
| LUNAR | 22.8 | 31.5 | 57.5 | 23.6 | 40.2 | 55.1 | 22.5 | 44.3 | 55.5 |
| UNLEARN | 21.3 | 32.8 | 57.8 | 22.1 | 41.7 | 55.4 | 20.9 | 45.9 | 55.9 |
Appendix figures & tables18 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | Metric 1 | Metric 2 | Metric 3 | Metric 4 | Metric 5 |
|---|---|---|---|---|---|
| TOFU forget01 | Avg | MU | FE | – | – |
| TOFU forget05 | Avg | MU | FE | – | – |
| TOFU forget10 | Avg | MU | FE | – | – |
| SepS forget10 | H-Avg. | MU | FE | SepS | – |
| MUSE-News | Avg | C1 | C4 | C6 | – |
| MUSE-Books | Avg | C1 | C4 | C6 | – |
| Experiment | Backbone | Seeds | Wall-clock / seed | Peak mem. / GPU | Total GPU-hours |
|---|---|---|---|---|---|
| TOFU forget01 | LLaMA-family 7B | 3 | 2.1 h | 46 GB | 50.4 |
| TOFU forget05 | LLaMA-family 7B | 3 | 2.4 h | 49 GB | 57.6 |
| TOFU forget10 | LLaMA-family 7B | 3 | 2.8 h | 52 GB | 67.2 |
| TOFU SepS evaluation | LLaMA-family 7B | 3 | 0.9 h | 36 GB | 21.6 |
| MUSE-News | LLaMA-family 7B | 3 | 3.6 h | 55 GB | 86.4 |
| MUSE-Books | LLaMA-family 7B | 3 | 4.8 h | 58 GB | 115.2 |
| Variant | TOFU (Std.) Avg | TOFU (SepS) H-Avg | WMDP Aux. (avg.) | ||||
|---|---|---|---|---|---|---|---|
| forget05 | forget10 | forget05 | forget10 | Forget | Retain | MMLU | |
| HGU (full) | 0.7221 | 0.7699 | 0.4382 | 0.4715 | 14.7 | 46.3 | 57.6 |
| w/o span localization (use all tokens) | 0.6958 ( –0.0263 ) | 0.7429 ( –0.0270 ) | 0.4016 ( –0.0366 ) | 0.4310 ( –0.0405 ) | 16.2 ( –1.5 ) | 44.1 ( –2.2 ) | 57.2 ( –0.4 ) |
| w/o evidence support ( removed) | 0.7034 ( –0.0187 ) | 0.7512 ( –0.0187 ) | 0.4175 ( –0.0207 ) | 0.4459 ( –0.0256 ) | 15.8 ( –1.1 ) | 44.9 ( –1.4 ) | 57.3 ( –0.3 ) |
| w/o stochastic-consensus ( removed) | 0.6982 ( –0.0239 ) | 0.7470 ( –0.0229 ) | 0.4098 ( –0.0284 ) | 0.4403 ( –0.0312 ) | 16.5 ( –1.8 ) | 44.2 ( –2.1 ) | 57.1 ( –0.5 ) |
| w/o entropy weighting ( ) | 0.7091 ( –0.0130 ) | 0.7566 ( –0.0133 ) | 0.4239 ( –0.0143 ) | 0.4531 ( –0.0184 ) | 15.6 ( –0.9 ) | 45.3 ( –1.0 ) | 57.4 ( –0.2 ) |
| Benchmark | Trace–Eval Prompt | Trace–Eval Answer | Utility–Eval Prompt | Val–Eval Prompt | Retrieval–Eval Doc | Final Eval Used? |
| TOFU | 0 | 0 | 0 | 0 | 0 | No |
| MUSE-News | 0 | 0 | 0 | 0 | 0 | No |
| MUSE-Books | 0 | 0 | 0 | 0 | 0 | No |
| WMDP-Bio/Cyber/Chem | 0 | 0 | 0 | 0 | 0 | No |
| PKU-SafeRLHF | 0 | 0 | 0 | 0 | 0 | No |
| Trace source | TOFU Avg | SepS H-Avg | MUSE Avg | WMDP Haz. | MMLU |
|---|---|---|---|---|---|
| Random training prompts | 0.7385 0.0061 | 0.4212 0.0084 | 0.697 0.007 | 27.8 0.7 | 57.1 0.3 |
| Auxiliary paraphrase prompts | 0.7642 0.0048 | 0.4587 0.0071 | 0.718 0.006 | 25.3 0.6 | 57.4 0.3 |
| All training forget prompts | 0.7678 0.0045 | 0.4661 0.0069 | 0.723 0.006 | 24.6 0.6 | 57.3 0.3 |
| Default high-propensity trace split | 0.7699 0.0038 | 0.4715 0.0068 | 0.724 0.006 | 24.4 0.5 | 57.7 0.2 |
| Method | C1 | C2 | C3 | C4 | C5 | C6 | Avg |
|---|---|---|---|---|---|---|---|
| GA+GD | 0.664 | 0.611 | 0.583 | 0.524 | 0.552 | 0.431 | 0.561 |
| GA+KL | 0.681 | 0.629 | 0.601 | 0.593 | 0.574 | 0.462 | 0.590 |
| NPO+GD | 0.704 | 0.646 | 0.621 | 0.662 | 0.602 | 0.512 | 0.625 |
| NPO+KL | 0.713 | 0.651 | 0.632 | 0.675 | 0.613 | 0.526 | 0.635 |
| ULD | 0.731 | 0.682 | 0.654 | 0.701 | 0.635 | 0.553 | 0.659 |
| LLM-Eraser | 0.742 | 0.694 | 0.671 | 0.693 | 0.651 | 0.571 | 0.670 |
| Method | C1 | C2 | C3 | C4 | C5 | C6 | Avg |
|---|---|---|---|---|---|---|---|
| GA+GD | 0.621 | 0.574 | 0.558 | 0.491 | 0.512 | 0.397 | 0.526 |
| GA+KL | 0.643 | 0.592 | 0.579 | 0.571 | 0.538 | 0.423 | 0.558 |
| NPO+GD | 0.672 | 0.618 | 0.601 | 0.631 | 0.571 | 0.474 | 0.595 |
| NPO+KL | 0.681 | 0.626 | 0.613 | 0.646 | 0.583 | 0.491 | 0.607 |
| ULD | 0.704 | 0.653 | 0.637 | 0.662 | 0.604 | 0.518 | 0.630 |
| LLM-Eraser | 0.718 | 0.661 | 0.649 | 0.655 | 0.618 | 0.532 | 0.639 |
| Method | Bio | Cyber | Chem | Avg Haz. | MMLU |
|---|---|---|---|---|---|
| Base | 63.4 | 45.8 | 48.6 | 52.6 | 58.6 |
| GA+KL | 34.9 | 31.8 | 33.7 | 33.5 | 54.2 |
| NPO+KL | 32.7 | 29.6 | 31.4 | 31.2 | 55.0 |
| RMU | 30.4 | 27.1 | 28.3 | 28.6 | 56.1 |
| FALCON | 29.8 | 26.9 | 27.5 | 28.1 | 56.3 |
| LUNAR | 28.1 | 26.4 | 26.9 | 27.1 | 56.6 |
| Method | Harmful Rate | ASR | TruthfulQA MC1 | TruthfulQA MC2 | Helpful Win |
|---|---|---|---|---|---|
| Base | 31.8 | 28.5 | 43.1 | 60.8 | 100.0 |
| GA+KL | 10.4 | 9.8 | 39.7 | 56.2 | 88.6 |
| NPO+KL | 9.1 | 8.3 | 40.5 | 57.4 | 90.2 |
| RMU | 8.7 | 7.9 | 41.6 | 58.8 | 91.7 |
| LUNAR | 8.2 | 7.4 | 42.2 | 59.3 | 92.4 |
| UNLEARN | 7.8 | 7.1 | 42.5 | 59.8 | 93.1 |
| Trace selection | Conf.-Unsup. Coverage | TOFU Avg | MUSE Avg | WMDP Haz. | MMLU |
|---|---|---|---|---|---|
| Random training prompts | 41.8 | 0.7385 | 0.697 | 27.8 | 57.1 |
| Entropy only | 58.6 | 0.7462 | 0.704 | 26.9 | 57.1 |
| Evidence support only | 67.9 | 0.7580 | 0.716 | 25.8 | 57.3 |
| Default propensity | 73.4 | 0.7699 | 0.724 | 24.4 | 57.7 |
| Default + confidence tail | 78.1 | 0.7721 | 0.727 | 24.2 | 57.6 |
| All training prompts | 84.7 | 0.7678 | 0.723 | 24.6 | 57.3 |
| Attribution computation | TOFU Avg | SepS H-Avg | WMDP Haz. | MMLU |
|---|---|---|---|---|
| Random neuron selection | 0.7198 | 0.3987 | 30.1 | 56.9 |
| Activation magnitude only | 0.7415 | 0.4294 | 27.4 | 57.0 |
| Summed-loss backward approximation | 0.7556 | 0.4481 | 25.9 | 57.3 |
| Exact local gradients, no entropy weight | 0.7566 | 0.4531 | 25.6 | 57.4 |
| Exact local per-token gradients | 0.7699 | 0.4715 | 24.4 | 57.7 |
| Editing precision | TOFU Avg | SepS H-Avg | WMDP Haz. | MMLU |
|---|---|---|---|---|
| FP16 HGU | 0.7699 | 0.4715 | 24.4 | 57.7 |
| INT8 HGU | 0.7641 | 0.4638 | 25.1 | 57.3 |
| NF4 / 4-bit HGU | 0.7512 | 0.4495 | 26.3 | 56.8 |
| Deployment model | TOFU Avg | SepS H-Avg | WMDP Haz. | MMLU |
|---|---|---|---|---|
| FP16 edited model | 0.7699 | 0.4715 | 24.4 | 57.7 |
| FP16 edit INT8 | 0.7618 | 0.4619 | 25.4 | 57.1 |
| FP16 edit NF4 | 0.7475 | 0.4421 | 26.8 | 56.6 |
| Random | HGU | |||
|---|---|---|---|---|
| Pool (target fraction) | P@512 | AUPRC | P@512 | AUPRC |
| TOFU (5%) | 0.050 | 0.050 | 0.641 | 0.598 |
| WMDP + benign (10%) | 0.100 | 0.101 | 0.574 | 0.531 |
| PKU + benign (10%) | 0.100 | 0.101 | 0.692 | 0.651 |
| Localization/evidence condition | HR | TOFU Avg | Haz. | MMLU |
|---|---|---|---|---|
| Default / clean | 0.118 | 0.7699 | 24.4 | 57.7 |
| 40% evidence removal | 0.137 | 0.7526 | 26.0 | 57.4 |
| 20% distractor passages | 0.128 | 0.7598 | 25.3 | 57.5 |
| 20% contradictory/outdated | 0.145 | 0.7459 | 26.8 | 57.2 |
| Second retriever / clean | 0.121 | 0.7668 | 24.8 | 57.6 |
| Selector | TOFU Avg | SepS H-Avg | Aux. Forget | KL |
|---|---|---|---|---|
| Layer-matched random | 0.7276 | 0.4098 | 17.5 | 0.0198 |
| Activation-matched random | 0.7364 | 0.4211 | 16.9 | 0.0186 |
| Gradient-matched random | 0.7428 | 0.4305 | 16.4 | 0.0179 |
| Integrated Gradients | 0.7587 | 0.4542 | 15.5 | 0.0154 |
| HGU | 0.7699 | 0.4715 | 14.7 | 0.0138 |
| Method | Paraphrase | Multi-turn | Jailbreak | Temperature | MMLU |
|---|---|---|---|---|---|
| NPO+KL | 39.6 | 45.2 | 53.6 | 47.1 | 55.0 |
| LUNAR | 33.7 | 39.4 | 46.8 | 41.0 | 56.6 |
| RapidUn | 30.1 | 34.8 | 42.2 | 37.3 | 57.1 |
| HGU | 27.8 | 31.8 | 38.4 | 33.5 | 57.7 |
LLM Unlearning
Large language model unlearning studies how to remove specified knowledge or behaviors while preserving a model’s unrelated capabilities.
See all 207 papers