Fewer Heads, Fewer Memories: Pruning Redundant Attention Heads Suppresses Verbatim Memorisation
作者: Aryan Chowdhury, Riza Batista-Navarro
分类: cs.CL, cs.LG
发布日期: 2026-10-29
备注: 7 Pages, 5 Tables, 1 Figure
💡 一句话要点
通过剪枝冗余注意力头抑制逐字记忆以提升语言模型性能
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 注意力机制 记忆抑制 模型剪枝 自然语言处理
📋 核心要点
- 现有大型语言模型在训练数据中逐字记忆序列,导致隐私和知识产权问题,且影响模型的泛化能力。
- 论文提出通过剪枝冗余的注意力头来抑制逐字记忆,利用注意力头的冗余性来改善模型性能。
- 实验结果显示,剪枝729个冗余头后,记忆计数减少91.5%,同时WikiText-103的困惑度提升0.92,证明了方法的有效性。
📝 摘要(中文)
大型语言模型已被证明能够记忆并逐字再现训练数据中的序列,这引发了隐私泄露、知识产权暴露和泛化能力的担忧。理论研究表明,注意力头可能作为联想记忆机制,影响这种行为。尽管已有实证研究显示许多注意力头是冗余的,可以在有限影响下进行剪枝,但剪枝对记忆序列再现的影响尚未探讨。本文展示了在推理前将大量注意力头归零可以显著抑制逐字记忆,同时保持或改善语言建模性能。对GPT-2-XL(1.5B)的评估表明,剪枝729个任务冗余头将记忆计数减少了91.5%,同时WikiText-103的困惑度提高了0.92。这些发现表明,注意力头冗余可以被利用以减轻推理时的记忆问题,而无需重新训练或修改训练数据。
🔬 方法详解
问题定义:本文旨在解决大型语言模型在推理时逐字记忆训练数据的问题。现有方法未能有效控制记忆行为,导致隐私和知识产权风险。
核心思路:通过剪枝冗余的注意力头,减少模型的记忆能力,同时保持或提升语言建模性能。此方法利用了注意力头的冗余性,减少了模型的记忆负担。
技术框架:整体流程包括识别冗余的注意力头、剪枝这些头部并在推理时将其归零。主要模块包括冗余头的评估、剪枝算法和性能评估。
关键创新:本研究的创新在于首次探讨了剪枝冗余注意力头对逐字记忆的影响,提出了一种新的思路来利用模型的冗余性来抑制记忆行为。
关键设计:在实验中,选择了729个任务冗余的注意力头进行剪枝,采用了标准的语言建模损失函数,并在WikiText-103数据集上进行评估。
🖼️ 关键图片
📊 实验亮点
实验结果显示,剪枝729个冗余注意力头后,模型的记忆计数减少了91.5%,同时WikiText-103的困惑度提高了0.92。这表明该方法在抑制逐字记忆的同时,能够有效提升语言模型的性能。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理、对话系统和文本生成等。通过减少模型的逐字记忆能力,可以在保护隐私和知识产权的同时,提升模型的泛化能力,具有重要的实际价值和未来影响。
📄 摘要(原文)
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.