arXiv:2610.40974cs.CLOct 2026

Manuscript Offprint

arXiv:2610.40974

Fewer Heads, Fewer Memories: Pruning Redundant Attention Heads Suppresses Verbatim Memorisation

Aryan Chowdhury, Riza Batista-Navarro

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.

1 Introduction

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 (Carlini et al., 2021, 2022). Existing mitigations, such as deduplication, differential privacy, and unlearning (Kandpal et al., 2022; Yu et al., 2021; Si et al., 2023), either intervene at training time or require identifying specific memorised content, making them difficult to apply to deployed models.

Prior work has shown that MLP layers store substantial factual and memorised knowledge (Meng et al., 2022; Nanda et al., 2023), while the role of attention remains comparatively underexplored. Recent theoretical results establish that multi-head attention can function as an associative memory, with memorisation capacity scaling in the number of heads (Mahdavi et al., 2024; Dana et al., 2024). This capacity arises from softmax saturation: when attention weights concentrate sharply on a small set of positions, the corresponding value vectors dominate the head's output, enabling precise token retrieval rather than diffuse contextual aggregation. Independently, empirical work has consistently shown that a substantial fraction of attention heads can be zeroed out at inference time without degrading downstream task performance (Michel et al., 2019; Voita et al., 2019). The implications of this redundancy for memorisation, however, remain unexplored. Our contributions are as follows:

  • We demonstrate that inference-time pruning of task-redundant attention heads substantially reduces memorised-sequence reproduction while preserving language modelling performance on the benchmark used to identify redundant heads.

  • We find that memorised sequences induce sharper softmax saturation and stronger cross-head agreement, creating a coordinated signal toward the memorised continuation.

  • We show that pruning task-redundant heads weakens this collective signal by removing part of their contribution from the residual stream, offering a mechanistic explanation for the observed reduction in memorisation.