Fewer Heads, Fewer Memories: Pruning Redundant Attention Heads Suppresses Verbatim Memorisation
Abstract
Large language models have been shown to memorise and reproduce verbatim sequences from their training data, raising concerns about privacy leakage, intellectual property exposure, and the limits of generalisation. Recent theoretical work suggests that attention heads may contribute to this behaviour by functioning as associative memory mechanisms, with memorisation capacity scaling with the number of heads. At the same time, empirical work has shown that many attention heads are redundant and can be pruned with limited impact on downstream performance. Despite these parallel findings, the effect of pruning redundant heads on memorised-sequence reproduction remains unexplored. In this work, we demonstrate that zeroing out a substantial fraction of attention heads prior to inference can significantly suppress verbatim memorisation while preserving, or even improving, language modelling performance on the benchmark used to identify redundant heads. Evaluating GPT-2-XL(1.5B) on known memorised sequences, we find that pruning 729 task-redundant heads reduces the memorisation count by 91.5%, while improving WikiText-103 perplexity by 0.92. These findings suggest that attention-head redundancy can be exploited to mitigate memorisation at inference time, without retraining or modifying the training data.
Create a lesson
Metadata
- Categories
- cs.CL, cs.LG
- Comments
- 7 Pages, 5 Tables, 1 Figure
Related papers
Deneb-Vritra: Descriptions, Edges and Names Examined by Blocking Via Restoring Token Representations and Attention
Shared title terminologycs.CLMohammed Nayeem Khan, Akhil P, Shahina Shaik
Look Back, Draft Ahead: Corrective Prefix Attention for Parallel Speculative Decoding
Shared title terminologycs.CLMohammad Mahdi Moradi, Ali Pourranjbar, Zongzuo Wang et al.
LimeTree: Linear-Memory Graph Neural Networks over Tree-Graphs for Resource-Efficient Language Modeling and Context Extrapolation
Shared title terminologycs.CLElisabeth Fink
Learn the Effects, Not the Examples: Implicit ICL via Attention Patching
Shared title terminologycs.CLSeungwon Woo, Hyunseo Shin, Wonseok Hwang
From Rewarding What Models Say to How They Think: Attention Process Reward Model for LLM Reinforcement Learning
Shared title terminologycs.CLKairong Han, Nuanqiao Shan, Ziyu Zhao et al.
PCC: Pivotal Channel Compensation for Layer Pruning of Large Language Models
Shared title terminologycs.CLXiangqian Wang, Yucheng Zhang, Zhaohong Jia et al.