大语言模型在统计和内部层面的记忆比较分析:跨模型共性与模型特有特征
A Comparative Analysis of LLM Memorization at Statistical and Internal Levels: Cross-Model Commonalities and Model-Specific Signatures
AI总结:
本文通过分析多个模型系列的记忆行为,揭示了记忆率与模型规模的对数线性关系及序列压缩,同时发现不同模型在内部层面存在独特的解码过程和重要头部分布特征。
摘要:
记忆是人类和大语言模型(LLM)智能的核心组成部分。然而,尽管LLM性能迅速提升,我们对记忆的理解却滞后。由于有限访问LLM预训练数据,大多数先前研究集中在单一模型系列,导致系列间的孤立观察,不清楚哪些发现是通用的或特定的。在本研究中,我们收集了多个模型系列(Pythia、OpenLLaMa、StarCoder、OLMo1/2/3)并分析其在统计和内部层面的共享或独特记忆行为,连接个体观察并展示新发现。在统计层面,我们发现记忆率与模型规模呈对数线性关系,且记忆序列可以进一步压缩。进一步分析显示记忆序列具有共享的频率和领域分布模式。然而,在上述观察下,不同模型也表现出独特的特征。在内部层面,我们发现LLM可以移除某些注入的扰动,而记忆序列更敏感。通过解码中间层和注意力头删除,我们揭示了通用的解码过程和共享的重要头部用于记忆。然而,这些重要头部在不同家族中的分布不同,显示了独特的家族级特征。通过桥接各种实验并揭示新发现,本研究为理解LLM中的记忆奠定了通用和基础性的理解。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。