Abstract
In large language model (LLM) unlearning, private information is required to be removed. Task arithmetic unlearns by subtracting a specific task vector (TV)—defined as the parameter difference between a privacy-information-tuned model and the original model. While efficient, it can cause over-forgetting by disrupting parameters essential for retaining other information. Motivated by the observation that each parameter exhibits different importance for forgetting versus retention, we propose a per-parameter task arithmetic (PerTA) mechanism to rescale the TV, allowing per-parameter adjustment. These weights quantify the relative importance of each parameter for forgetting versus retention, estimated via gradients (i.e., PerTA-grad) or the diagonal Fisher information approximation (i.e., PerTA-fisher). Extensive experiments demonstrate that PerTA consistently improves upon standard TV, and in many cases surpasses widely used training-based unlearning methods in both forgetting effectiveness and overall model utility. By retaining the efficiency of task arithmetic while mitigating over-forgetting, PerTA offers a principled and practical framework for LLM unlearning.
The Challenge of Selective Forgetting
As Large Language Models (LLMs) are trained on vast datasets, they often memorize sensitive, private, or copyrighted information. Machine unlearning seeks to erase this specific "forget set" while preserving the model's general capabilities, or "retain set."
Existing approaches face a trade-off between efficiency and efficacy. Training-based methods, which involve iterative retraining with specialized loss functions, are computationally expensive and scale poorly as the forget set grows. Conversely, Task Arithmetic offers a fast, training-free alternative by creating a Task Vector (TV) from a model fine-tuned only on the forget set. However, applying a uniform TV often leads to "over-forgetting," where essential general knowledge is inadvertently damaged due to parameter entanglement.
Per-parameter Task Arithmetic (PerTA)
To address the limitations of uniform task arithmetic, we introduce Per-parameter Task Arithmetic (PerTA). This method recognizes that individual parameters contribute differently to forgetting and retention. Instead of a global scaling factor, PerTA applies a per-parameter weight matrix to the Task Vector to selectively update the model.
The PerTA workflow consists of three primary steps:
- One-Time Gradient Computation: Gradients are calculated for both the forget set ($g_f$) and the retain set ($g_r$) just once, ensuring high efficiency.
- Importance Estimation: A weight matrix is constructed where each entry represents the relative importance of a parameter for forgetting versus retention. Parameters crucial for the forget set but less so for the retain set receive higher weights. We propose two variants: PerTA-grad, using absolute gradient magnitudes, and PerTA-fisher, using squared gradients (diagonal Fisher information) to create a sharper selection boundary.
- Weighted Task Arithmetic: The final model is updated by element-wise multiplication of the Task Vector with the importance weights before subtraction from the original model.
Experimental Evaluation
We evaluated PerTA on the TOFU (Task of Fictitious Unlearning) and MUSE (News subset) benchmarks using Llama-3.2 1B and 3B models.
Key Results
- Performance Balance: PerTA consistently outperformed vanilla Task Vectors and heavy training-based methods like NPO and Gradient Ascent. On the challenging "Forget 10%" task in TOFU, where training-based methods often saw utility collapse, PerTA-fisher maintained high model utility (0.548) while achieving near-theoretical forget quality.
- Efficiency: PerTA is significantly faster than iterative training. For a 10% unlearning task, PerTA required approximately 7 minutes, compared to over 23 minutes for the best-performing training-based baseline (NPO+).
- Robustness: PerTA demonstrated superior resistance to quantization attacks, which are often used to attempt recovery of unlearned data, proving it creates a more permanent erasure of information.
Insights and Future Directions
Visualizing PerTA weights reveals that unlearning is most active in the shallowest and deepest attention layers, corresponding to surface features and complex semantics, while middle layers—responsible for basic syntax—remain largely untouched. This aligns with linguistic theory and suggests that future optimizations could focus on these specific layers to further reduce computational overhead.
While PerTA represents a significant step forward, current evaluation metrics often rely on model hallucinations to signify "forgetting." Future research should explore methods that encourage models to explicitly refuse queries about forgotten data rather than generating incorrect information, moving toward a more robust definition of machine unlearning.
Summary updated