arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.05078cs.LGcs.AI
收藏

从模型归因视角分析大语言模型中的记忆现象

Analyzing Memorization in Large Language Models through the Lens of Model Attribution

Adobe MDSR;IIT Hyderabad(印度理工学院海得拉巴分校);University of Virginia(弗吉尼亚大学)

Tarun Ram Menta, Susmit Agrawal, Chirag Agarwal

AI总结:

本文利用模型归因绕过不同 transformer 块的注意力模块,证明深层注意力主要导致记忆,而早期块支撑泛化与推理,并在 Pythia、GPTNeo 上验证可缓解记忆且保持性能。

摘要:

大语言模型(LLM)在现代应用中十分普遍,但往往会记忆训练数据,从而导致隐私泄露和版权问题。现有研究主要集中于事后分析,例如提取被记忆的内容或开发记忆度量指标,却没有探究导致记忆的底层架构因素。在本工作中,我们从架构视角研究记忆,分析不同层的注意力模块如何影响模型的记忆和泛化性能。利用归因技术,我们通过绕过特定块中的注意力模块,同时保持层归一化和 MLP 变换等其他组件不变,来系统性地干预 LLM 架构。我们给出了从数学角度分析该干预机制的定理,对有无归因时层输出之间的差异进行了界定。理论和实证分析表明,较深 transformer 块中的注意力模块主要负责记忆,而较早的块对模型的泛化和推理能力至关重要。我们通过在不同 LLM 系列(Pythia 和 GPTNeo)以及五个基准数据集上的综合实验验证了这些发现。我们的见解为在保持 LLM 性能的同时缓解记忆提供了一种实用方法,有助于在现实世界应用中实现更安全、更合乎伦理的部署。

英文摘要:

Large Language Models (LLMs) are prevalent in modern applications but often memorize training data, leading to privacy breaches and copyright issues. Existing research has mainly focused on posthoc analyses, such as extracting memorized content or developing memorization metrics, without exploring the underlying architectural factors that contribute to memorization. In this work, we investigate memorization from an architectural lens by analyzing how attention modules at different layers impact its memorization and generalization performance. Using attribution techniques, we systematically intervene in the LLM architecture by bypassing attention modules at specific blocks while keeping other components like layer normalization and MLP transformations intact. We provide theorems analyzing our intervention mechanism from a mathematical view, bounding the difference in layer outputs with and without our attributions. Our theoretical and empirical analyses reveal that attention modules in deeper transformer blocks are primarily responsible for memorization, whereas earlier blocks are crucial for the models generalization and reasoning capabilities. We validate our findings through comprehensive experiments on different LLM families (Pythia and GPTNeo) and five benchmark datasets. Our insights offer a practical approach to mitigate memorization in LLMs while preserving their performance, contributing to safer and more ethical deployment in real world applications.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑