Machine unlearning is a promising approach to improve LLM safety by removing unwanted knowledge from the model. However, prevailing gradient-based unlearning methods suffer from issues such as high computational costs, hyperparameter instability, poor sequential unlearning capability, vulnerability to relearning attacks, low data efficiency, and lack of interpretability. While Sparse Autoencoders are well-suited to improve these aspects by enabling targeted activation-based unlearning, prior approaches underperform gradient-based methods. This work demonstrates that, contrary to these earlier findings, SAEs can significantly improve unlearning when employed dynamically. We introduce Dynamic DAE Guardrails (DSG), a novel method for precision unlearning that leverages principled feature selection and a dynamic classifier. Our experiments show DSG substantially outperforms leading unlearning methods, achieving superior forget-utility trade-offs. DSG addresses key drawbacks of gradient-based approaches for unlearning -- offering enhanced computational efficiency and stability, robust performance in sequential unlearning, stronger resistance to relearning attacks, better data efficiency including zero-shot settings, and more interpretable unlearning.
Figures & tables
Figure 1: An illustration of DSG
Algorithm 1 Dynamic SAE Guardrails (DSG)
Figure 2: Distribution of ρ(x) for unlearning on WMDP-Bio. Threshold at 95th percentile (dashed red line) separates MMLU from WMDP.
Figure 3: Unlearning performance on WMDP-Bio (left) and WMDP-Cyber (right). Higher MMLU accuracy and lower WMDP accuracy is better. Clamp strengths ( c ) used for DSG points are shown as annotations. DSG Pareto-dominates the top four baseline methods (RMU, SCRUB, Farrell et al., SSD).
Method
WMDP Bio ( ↓ )
MMLU ( ↑ )
MT ( ↑ )
HS Hist
C. CS
HS Geo
H. Aging
All
Target M
100.00
100.00
100.00
100.00
100.00
100.00
7.36
GA
99.44
98.18
100.00
100.00
100.00
99.35
7.44
NPO
97.95
99.99
88.88
100.00
98.82
99.35
7.29
SSD
99.44
100.00
100.00
100.00
98.82
99.68
7.24
SCRUB
94.97
99.09
100.00
100.00
98.82
99.35
6.09
Table 1: Unlearning performance on WMDP-Bio. All represents the average MMLU score. MT-Bench scores show 0.16 variance across 5 runs. DSG shows superior unlearning effectiveness compared to baselines while maintaining high MMLU performance.
C1. No Verbatim Mem.
C2. No Knowledge Mem.
C3. No Privacy Leak.
C4. Utiltiy Preserv.
VerbMem on Dforget ( ↓ )
KnowMem on Dforget ( ↓ )
PrivLeak ( ∈[−5%,5%] )
KnowMem on Dretain ( ↑ )
News
Target M
21.15
29.51
−88.16
26.78
GA
0.62
↓97.1%
0.00
↓100.0%
-8.16
under-unlearn
0.09
↓99.7%
GradDiff
2.81
↓86.7%
0.71
↓97.6%
93.10
over-unlearn
7.76
↓71.0%
NPO
20.98
↓0.8%
25.14
↓14.8%
-53.42
under-unlearn
29.02
↑8.4%
Table 2: Unlearning performance on MUSE. We highlight in green if the method satisfies the criterion and red otherwise. For privacy leakage, large positive values suggest over-unlearning , while large negative values suggest under-unlearning . DSG shows strong performance across all metrics, achieving substantial reductions in verbatim and knowledge memorization while maintaining high utility.
Figure 4: (a) Scalability: Performance across increasing forget set sizes. (b) Sequential Unlearning: Performance across sequential unlearning requests
Figure 5: Relearning attack resistance across finetuning epochs. (a) DSG demonstrates superior resistance to relearning compared to RMU. (b) Test-time DSG preserves MMLU utility better than Train-time DSG while still providing significant protection.
Figure 6: Data efficiency analysis of DSG. (A) Performance across varying training data sizes compared to RMU. (B) Zero-shot performance on WMDP-Bio (left) and WMDP-Cyber (right) using 20 features selected via Neuropedia API with different τ thresholds (shown next to each data point).
Figure 7: DSG Ablation studies (A) Static vs. dynamic clamping comparison with varying clamp strengths [10-500] for 20 and 30 features. (B) Effect of dynamic threshold percentile ( pdyn ) on performance (C) Impact of importance ratio threshold ( pratio , range 75-95) for 20 and 30 features.
Appendix figures & tables20 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 8: Distribution of forget-set activated tokens for WMDP-Cyber. Threshold at the 95th percentile (dashed red line) effectively separates MMLU from WMDP.
Table 10: Unlearning performance on WMDP-Cyber. All represents the average MMLU score. MT-Bench scores show 0.13 variance across 5 runs. DSG shows superior unlearning effectiveness compared to other baselines while maintaining high MMLU performance.
Unlearning Method
NEWS
BOOKS
GA
epoch 1
epoch 1
GradDiff
epoch 2
epoch 3
NPO
epoch 8
epoch 10
SimNPO
epoch 10
epoch 10
RMU
epoch 9
epoch 10
Appendix
Table 11: Optimal epochs for baseline unlearning methods on MUSE benchmark, determined by utility-based stopping criteria.
Figure 9: (a) Distribution of activation cosine similarity and activation magnitude ratio between Base and Finetuned models. Finetuning does not significantly change the underlying activation space. (b) Train loss when finetuning Base model and Base+SAE model on WMDP and MMLU. Loss on WMDP for the BASE+SAE model is significantly higher than on MMLU.
Figure 10: Relearning attack performance with reduced learning rate (1e-6). All configurations show minimal performance changes across finetuning epochs, demonstrating that relearning attack efficacy is strongly dependent on learning rate.
Parameter
Value
SAE
gemma-scope-2b-pt-res SAE (width 16k)
SAE layer
Layer 3, ℓ0 142
Importance ratio percentile ( pratio )
95
Dynamic threshold percentile ( pdyn )
95
Number of selected features
20
Clamp strength ( c )
500
Appendix
Table 12: DSG hyperparameters for data efficiency experiments
Parameter
Value
Steering coefficient
400
Alpha ( α )
100
Monitoring layer
3
Learning rate
5e-6
Parameter subset
MLP layers only
Appendix
Table 13: RMU hyperparameters for data efficiency experiments
Parameter
WMDP-Bio
WMDP-Cyber
SAE layer
Layer 3, ℓ0 59
Layer 3, ℓ0 59
Importance ratio percentile ( pratio )
95
90
Feature selection
20 features
20 features via
Clamp strength ( c )
500
500
τ range tested
0.1 to 0.9 (increments of 0.1)
0.1 to 0.9 (increments of 0.1)
Optimal τ
0.6
0.2
Appendix
Table 14: Hyperparameters for zero-shot experiments
Figure 11: Effect of clamp strength c on DSG performance across different feature counts. MMLU accuracy (solid lines) remains consistently high ( >99% ) for 10-20 features across all clamp values, while WMDP-Bio accuracy (dashed lines) drops sharply even at modest clamp strengths ( c=25 ). This demonstrates DSG’s ability to effectively remove targeted knowledge while preserving general model capabilities with minimal parameter sensitivity.
Figure 12: Total Variation Distance (TVD) between WikiText and benchmark datasets using percentage-based ( ρ ) vs. raw count-based ( ρraw ) metrics. Lower TVD between WikiText and MMLU indicates better alignment of retain sets, while higher TVD between WikiText and WMDP indicates better separation between retain and forget distributions. Percentage-based metrics consistently outperform raw counts on both measures across all benchmarks.
Seq Length
Original Model (s)
Static Clamping (s)
Dynamic Clamping (DSG) (s)
256 tokens
0.0872±0.0098
0.0933±0.0091 (+7.0%)
0.0936±0.0090 (+7.3%)
512 tokens
0.1618±0.0061
0.1659±0.0029 (+2.5%)
0.1676±0.0047 (+3.6%)
1024 tokens
0.3300±0.0081
0.3403±0.0083 (+3.1%)
0.3420±0.0081 (+3.6%)
Appendix
Table 15: Comparison of Inference Latency Across Sequence Lengths for gemma-2-2b-it with gemma-scope-2b-pt-res SAE. Data reported as mean ± std over 100 samples on a single A6000 GPU. Percentage increase relative to the Original Model shown in parentheses.
Figure 13: Feature Activations on Example Sequences from Forget Sets. (A) WMDP-Bio sequence with words highlighted in green indicating activation values >0 for feature ID (top) 373 and (bottom) 10933. (B) WMDP-Cyber sequence with words highlighted in green indicating activation values >0 for feature ID (top) 15286 and (bottom) 2905. Activation magnitudes are reported above the words in grey.
Biology
ID
Sentence
12382
Terms related to biological processes and structures in living organisms
9722
Concepts related to biological processes and systems
343
Terms related to biological processes and laboratory techniques
373
Scientific terminology related to biological processes and cellular functions
11
Scientific terms and concepts related to biology
Appendix
Table 16: Top 20 SAE Features for Biology and Cybersecurity in Zero-Shot Setting. List of the top 20 SAE feature IDs identified by querying Neuronpedia with “Biology” and “Cybersecurity”, alongside their corresponding Neuronpedia-provided interpretations, showing the semantic relevance of the selected features to the targeted knowledge domains.
Machine unlearning removes the influence of selected data or concepts from trained models while preserving useful behavior and avoiding full retraining.