arXiv:2603.21658cs.CLcs.LG2026-03

跨模型分析大语言模型记忆机制,发现共性与独特规律。

A Comparative Analysis of LLM Memorization at Statistical and Internal Levels: Cross-Model Commonalities and Model-Specific Signatures

  • 对比多个模型系列,从统计与内部结构两层分析记忆行为。
  • 记忆率随模型规模对数线性增长,且可进一步压缩。
  • 揭示通用解码路径与家族特异注意力头分布,适合模型安全研究者。

记忆是人类与大语言模型智能的基础组成部分。尽管大模型性能快速提升,但对其记忆机制的理解仍滞后。由于难以获取大模型的预训练数据,以往研究多局限于单一模型系列,导致不同系列间观察孤立,难以判断哪些发现具有普遍性。本文收集了Pythia、OpenLLaMa、StarCoder、OLMo1/2/3等多个模型系列,从统计与内部结构两个层面分析其共享或独特的记忆行为,整合零散发现并提出新见解。在统计层面,发现记忆率随模型规模呈对数线性增长,且被记忆序列可进一步压缩;进一步分析显示,被记忆序列具有共享的频率与领域分布模式。然而,不同模型在此基础上仍表现出个体特征。在内部层面,模型能消除部分注入扰动,但被记忆序列更敏感;通过中间层解码与注意力头消融分析,揭示了通用解码过程及共享的关键注意力头,但这些关键头的分布存在家族差异,体现家族级特征。本研究贯通多类实验,为理解大模型记忆的普遍规律奠定了基础。

原文摘要 · Abstract (English)

Memorization is a fundamental component of intelligence for both humans and LLMs. However, while LLM performance scales rapidly, our understanding of memorization lags. Due to limited access to the pre-training data of LLMs, most previous studies focus on a single model series, leading to isolated observations among series, making it unclear which findings are general or specific. In this study, we collect multiple model series (Pythia, OpenLLaMa, StarCoder, OLMo1/2/3) and analyze their shared or unique memorization behavior at both the statistical and internal levels, connecting individual observations while showing new findings. At the statistical level, we reveal that the memorization rate scales log-linearly with model size, and memorized sequences can be further compressed. Further analysis demonstrated a shared frequency and domain distribution pattern for memorized sequences. However, different models also show individual features under the above observations. At the internal level, we find that LLMs can remove certain injected perturbations, while memorized sequences are more sensitive. By decoding middle layers and attention head ablation, we revealed the general decoding process and shared important heads for memorization. However, the distribution of those important heads differs between families, showing a unique family-level feature. Through bridging various experiments and revealing new findings, this study paves the way for a universal and fundamental understanding of memorization in LLM.

大模型记忆统计分析注意力机制模型比较

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。