KUDA: Knowledge Unlearning by Deviating Representation for Large Language Models

Ce Fang, Zhikun Zhang, Min Chen, Qing Liu, Lu Zhou, Zhe Liu, Yunjun GaoarXiv 2026

TL;DR

KUDA (Knowledge Unlearning by Deviating representAtion) is a novel framework designed to precisely erase sensitive, copyrighted, or harmful data from Large Language Models (LLMs) without degrading their general capabilities. By combining causal tracing to pinpoint knowledge-storing layers with a relaxed null-space projection for gradient updates, KUDA breaks target knowledge associations while keeping the model's core linguistic and reasoning skills intact.

What Problem Does This Paper Address?

As LLMs are trained on massive, uncurated web datasets, they inevitably memorize text they shouldn't—such as private personal information, copyrighted material, or dangerous instructions (e.g., how to build bioweapons or execute cyberattacks).

"Machine unlearning" aims to scrub this specific knowledge post-training without requiring a costly retraining process from scratch. However, current approaches fall into two traps:

  1. Full-parameter updates often cause "model collapse" or severely degrade the model's general intelligence.
  2. Response-level alignment (e.g., safety fine-tuning to say "I cannot answer that") merely masks the behavior. The underlying knowledge remains embedded in the weights and can easily be extracted using adversarial prompts or jailbreaks.

Existing partial-parameter methods attempt to target specific weights but lack a holistic strategy that couples precise parameter selection with an effective knowledge-removal mechanism.

Methods

KUDA tackles this problem at the representation level through a three-stage pipeline:

  1. Unlearning Layers Selection: The authors leverage causal tracing to identify which specific Feed-Forward Network (FFN) layers act as the model's factual database. By targeting only these FFN layers and leaving Multi-Head Self-Attention (MHSA) layers untouched, KUDA preserves the model's core semantic and text-generation capabilities.
  2. Knowledge Representation Deviation: Instead of forcing the model to output random tokens or gibberish, KUDA introduces a specialized forgetting loss. This loss uses cosine similarity to deliberately push the hidden representations of the target data away from their original pre-trained states, effectively breaking the model's internal "knowledge associations."
  3. Relaxation Null-Space Projection: To prevent the forgetting process from damaging benign knowledge, KUDA projects the unlearning gradients into a relaxed null-space of the retaining data's feature covariance matrix. This ensures that parameter updates remain mathematically orthogonal to the features required for general model utility.
Figure 2: The overview of KUDA pipeline to balance the knowledge removal and utility retention for LLMs. KUDA includes three major stages: 1) We employ causal tracing and causal effect to identify FFNs critical for knowledge storage, and apply a sliding window to select the target unlearning layers for parameter updates. 2) The representations generated from the last unlearning layer are captured and utilized to derive the update gradients ∇Lu based on the mechanism of knowledge representation deviation. 3) The gradients are projected into the relaxation null-space of retaining knowledge, and ∇′Lu is then applied to the last linear transformation matrix of FFN in each unlearning layer. Rforget and Rretain are the representations of forgetting and retaining knowledge. NSretain denotes the relaxation null-space of retaining knowledge.

Datasets

The authors evaluated KUDA on two prominent unlearning benchmarks:

  • MUSE (Machine Unlearning Six-Way Evaluation): Includes BOOKS (forgetting Harry Potter series excerpts while retaining fandom wiki data) and NEWS (forgetting specific target BBC articles while retaining others).
  • WMDP (Weaponized Biological and Cyber Defense Benchmark): Focuses on removing hazardous knowledge in Biosecurity (Bio) and Cybersecurity (Cyber), using Wikitext as the retaining set to measure general knowledge preservation.

Key Insights and Ideas

  • Decoupling Memory from Processing: A key architectural insight is that FFNs function as key-value memories for facts, while MHSAs handle contextual interaction. Selectively updating only the FFNs prevents broader linguistic degradation.
  • Deviation over Destruction: Traditional methods that force uniform distributions or random outputs act like a sledgehammer to the model's latent space. KUDA's approach—pushing representations just far enough to break factual associations—is far more precise.
  • Geometric Resolution of Gradient Conflicts: Standard unlearning relies on a scalar factor ($\alpha$) to balance forgetting and retention losses. However, if the gradients point in opposite directions, adjusting their magnitude doesn't fix the conflict. KUDA's null-space projection solves this geometrically by eliminating the conflicting gradient components entirely.

Key Results

  • High Fidelity Forgetting: On the MUSE benchmark, KUDA achieved near-complete removal of target knowledge while incurring a marginal utility degradation of only 3.1% on MUSE and 1.7% on WMDP.
  • Hazardous Knowledge Suppression: When tested on WMDP using Zephyr-7B-Beta, KUDA successfully eliminated 88.8% of dangerous biological and cyber knowledge while maintaining stable general knowledge performance (measured via MMLU).
  • Architecture Agnostic Generalization: Unlike competing state-of-the-art methods like RMU, which struggled to transfer to newer model architectures due to internal design changes, KUDA successfully generalized to modern models like Llama-3.1-8B and Qwen-3-8B.

Limitations and Future Work

  • Causal Tracing Bottleneck: Computing the causal effects to identify the target layers is computationally heavy. However, the authors note this is a one-time, offline operation per model architecture; once the layers are found, they can be reused across different unlearning tasks.
  • Scalability of Feature Capture: Capturing the input features of the retaining dataset scales linearly with the size of that dataset. While the authors introduced Stochastic Proportional Sampling to alleviate this, managing extremely large-scale retaining sets remains an I/O challenge for future optimization.

Summary updated

BibTeX
@misc{fang2026kuda,
  author = {Ce Fang and Zhikun Zhang and Min Chen and Qing Liu and Lu Zhou and Zhe Liu and Yunjun Gao},
  title = {{KUDA: Knowledge Unlearning by Deviating Representation for Large Language Models}},
  year = {2026},
  eprint = {2602.19275},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.19275},
}
Figure