Large Language Models (LLMs), trained on massive corpora with billions of parameters, show unprecedented performance in various fields. Though surprised by their excellent performances, researchers also noticed some special behaviors of those LLMs. One of those behaviors is memorization, in which LLMs can generate the same content used to train them. Though previous research has discussed memorization, the memorization of LLMs still lacks explanation, especially the cause of memorization and the dynamics of generating them. In this research, we comprehensively discussed memorization from various perspectives and extended the discussion scope to not only just the memorized content but also less and unmemorized content. Through various studies, we found that: (1) Through experiments, we revealed the relation of memorization between model size, continuation size, and context size. Further, we showed how unmemorized sentences transition to memorized sentences. (2) Through embedding analysis, we showed the distribution and decoding dynamics across model size in embedding space for sentences with different memorization scores. The n-gram statistics analysis presents d (3) An analysis over n-gram and entropy decoding dynamics discovered a boundary effect when the model starts to generate memorized sentences or unmemorized sentences. (4)We trained a Transformer model to predict the memorization of different models, showing that it is possible to predict memorizations by context.
翻译:大型语言模型(LLMs)通过在包含数十亿参数的庞大数据集上进行训练,在各个领域展现出前所未有的性能。尽管其卓越表现令人惊叹,研究者们也注意到这些LLMs存在某些特殊行为。其中记忆行为尤为突出,即LLMs能够生成与训练数据完全一致的内容。虽然已有研究对记忆现象进行过探讨,但LLMs的记忆机制仍缺乏合理解释,特别是记忆产生的成因及其动态生成过程。本研究从多维度系统探讨了记忆现象,并将讨论范围从已记忆内容扩展至部分记忆及未记忆内容。通过系列实验分析,我们发现:(1)通过实验揭示了模型规模、续写长度与上下文长度对记忆行为的影响关系,并展示了未记忆语句向已记忆语句的转化过程。(2)通过嵌入空间分析,呈现了不同记忆评分语句在嵌入空间中随模型规模变化的分布规律与解码动态。n元语法统计分析表明(3)对n元语法及熵解码动态的分析发现了模型开始生成已记忆语句与未记忆语句时的边界效应。(4)我们训练了一个Transformer模型来预测不同模型的记忆行为,证明通过上下文预测记忆现象具有可行性。