[论文解读] Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language Models
本文通过实证分析在因果语言模型和掩码语言模型的训练过程中,记忆现象如何展开,涵盖模型规模、数据集和训练条件,结果表明更大的模型记忆更快、在过拟合前记忆量更多,并且在词性和遗忘行为方面存在不同的记忆动态。
Despite their wide adoption, the underlying training and memorization dynamics of very large language models is not well understood. We empirically study exact memorization in causal and masked language modeling, across model sizes and throughout the training process. We measure the effects of dataset size, learning rate, and model size on memorization, finding that larger language models memorize training data faster across all settings. Surprisingly, we show that larger models can memorize a larger portion of the data before over-fitting and tend to forget less throughout the training process. We also analyze the memorization dynamics of different parts of speech and find that models memorize nouns and numbers first; we hypothesize and provide empirical evidence that nouns and numbers act as a unique identifier for memorizing individual training examples. Together, these findings present another piece of the broader puzzle of trying to understand what actually improves as models get bigger.
研究动机与目标
- 了解在不同模型规模和数据集上,记忆在训练过程中的演变。
- 量化数据集大小、学习率和模型规模对记忆动态的影响。
- 确定哪些语言成分(词性)记忆得更快,以及原因。
- 描述训练过程中的遗忘动态及其与模型规模的关系。
提出的方法
- 将确切记忆 M(f) 定义为模型的 argmax 与真实标记相符的文本上下文所占的比例。
- 训练大小从125M到13B的 Transformer 语言模型,使用因果(causal)和掩码(masked)语言模型任务,数据集为 WikiText-103 和 RoBERTa。
- 测量 T(N, τ):达到记忆阈值 τ 所需的每个训练样本被看到的最小次数,以及 T_update(N, τ) 表示每次更新的记忆化程度。
- 通过改变模型规模、数据集规模、学习率,并在训练样本中引入唯一标识符来研究记忆速度,进行受控实验。
- 通过在训练中插入一个验证批次作为“特殊批”并跟踪记忆衰减,利用遗忘基线分析遗忘。
- 使用词性标注来比较 R(p) 与 R_mem(p),检查特定词性的记忆。
- 探讨词典大小和唯一标识符对记忆动态的影响。
实验结果
研究问题
- RQ1模型规模如何影响训练过程中的记忆速度和程度?
- RQ2数据集规模和学习率如何影响因果与掩码语言模型的记忆动态?
- RQ3名词和数字是否记忆得更快,引入唯一标识符是否会加速记忆?
- RQ4训练过程中的遗忘动态是什么,遗忘基线如何随模型规模增长而变化?
- RQ5词性如何与语言模型的记忆速率相关?
主要发现
- 更大的模型记住训练数据更快,随着 N 增大,T(N, τ) 在所有 τ 值上都在下降。
- 在 RoBERTa 规模的数据集上,T_update(N, τ) 对于因果和掩码模型均随模型规模增大而下降。
- 在过拟合之前的记忆随着模型规模增加而增加,表明记忆不仅仅由过拟合造成。
- 在训练样本中引入唯一标识符(或增大词典)会加速记忆,显式标识符进一步提升速度。
- 名词和数字比其他词性记忆得更快,提示唯一标识符和名词/数字代理促进记忆。
- 遗忘曲线收敛到随模型规模增加而上升的基线,表明更大模型在训练中遗忘较少;遗忘基线对数据批次顺序具有鲁棒性,并受重复策略影响。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。