更少的注意力头,更少的记忆:修剪冗余注意力头可抑制逐字记忆
Fewer Heads, Fewer Memories: Pruning Redundant Attention Heads Suppresses Verbatim Memorisation
AI总结:
本研究提出修剪大型语言模型的冗余注意力头,可在不重新训练或修改训练数据的情况下,显著抑制逐字记忆并提升语言建模性能。
摘要:
大型语言模型已被证实会记忆并复制训练数据中的逐字序列,这引发了隐私泄露、知识产权暴露以及泛化能力极限的担忧。近期理论研究表明,注意力头可能通过作为联想记忆机制促成这种行为,其记忆容量随注意力头数量增加而扩大。与此同时,实证研究显示许多注意力头是冗余的,修剪它们对下游性能影响有限。尽管存在这些并行发现,修剪冗余注意力头对记忆序列复制的影响仍未被探索。本研究证明,在推理前将大量注意力头置零可显著抑制逐字记忆,同时在用于识别冗余头的基准上保留甚至提升语言建模性能。在已知记忆序列上评估GPT-2-XL(15亿参数),我们发现修剪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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。