Abstract
Transformer has become fundamental to a vast series of pre-trained large models that have achieved remarkable success across diverse applications. Machine unlearning, which focuses on efficiently removing specific data influences to comply with privacy regulations, shows promise in restricting updates to influence-critical parameters. However, existing parameter-efficient unlearning methods are largely devised in a module-oblivious manner, which tends to inaccurately identify these parameters and leads to inferior unlearning performance for Transformers. In this paper, we propose MAPE-Unlearn, a module-aware parameter-efficient machine unlearning approach that uses a learnable pair of masks to pinpoint influence-critical parameters in the heads and filters of Transformers. The learning objective of these masks is derived by desiderata of unlearning and optimized through an efficient algorithm featured by a greedy search with a warm start. Extensive experiments on various Transformer models and datasets demonstrate the effectiveness and robustness of MAPE-Unlearn for unlearning.
Introduction
As privacy regulations like GDPR grant users the "right to be forgotten," machine unlearning (MU) has become a critical necessity for large-scale models. However, removing specific data influences from massive Transformer models presents a significant challenge. Retraining from scratch is computationally prohibitive, while existing "parameter-efficient" methods often pick individual weights to update based on simple heuristics.
The authors argue that these existing methods are module-oblivious. Transformers rely on parallel attention heads and hierarchical filters; picking individual weights at random ignores these broader functional relationships. This leads to a dilemma where unlearning either fails to remove the data influence effectively or destroys the model's general performance (fidelity).
Methodology
The proposed MAPE-Unlearn (Module-Aware Parameter-Efficient Unlearning) framework operates at the module level rather than the weight level.
Dual Masking and Importance Scoring
The approach introduces a pair of learnable binary masks—one for multi-head attention (MHA) units and one for feed-forward network (FFN) filters. A mask value of 1 indicates the module is updated, while 0 keeps it frozen. To decide which modules to mask, unlearning is formulated as a constrained optimization problem. The authors use a second-order Taylor expansion and approximate the Hessian matrix using the diagonal Fisher Information Matrix (FIM). This allows for the calculation of "importance scores" for each head and filter without the prohibitive cost of computing a full Hessian for billions of parameters.
Optimization Strategy
Mask selection is optimized using an efficient greedy algorithm with a warm start. It begins with an initial guess based on gradients and then iteratively swaps modules to find the configuration that best satisfies the unlearning objective. MAPE-Unlearn serves as a strategy that can be integrated into existing unlearning methods such as Second-Order (SO) updates, Gradient Ascent (GA), and Negative Preference Optimization (NPO).
Experimental Results
Performance and Sparsity
Experiments across GLUE benchmarks, SQuAD, and the TOFU benchmark reveal a "Goldilocks zone" at approximately 90% sparsity. Updating only 10% of the modules provides sufficient flexibility to erase target data while preserving the model's general knowledge.
On SQuAD v2.0, MAPE-SO maintained a Test F1 score of 73.57%, nearly identical to the original model, whereas full-parameter methods often saw sharper declines. In hazardous knowledge removal (WMDP benchmark), MAPE-Unlearn reduced accuracy on dangerous topics to near-random levels while preserving general reasoning capabilities.
Robustness and Sequential Unlearning
MAPE-Unlearn demonstrates significant resistance to "relearning" attacks. Because 90% of the parameters are frozen, there are fewer pathways for an attacker to re-inject forgotten information through quick fine-tuning. Furthermore, by restricting updates to specific modules, the framework mitigates the accumulation of approximation errors in sequential unlearning requests, allowing the model to handle more requests before requiring a full retrain.
Conclusion and Future Work
MAPE-Unlearn demonstrates that the functional unit of knowledge in a Transformer is the module (head/filter) rather than individual weights. While the greedy search and FIM approximation are efficient, future work may explore more complex intra-layer interactions to further refine mask selection. Additionally, as the crucial layers for unlearning vary by task, scaling these methods to models exceeding 70B parameters remains a computational challenge.
Summary updated