泛化 vs. 记忆:将语言模型的能力追溯至预训练数据
Generalization v.s. Memorization: Tracing Language Models' Capabilities Back to Pretraining Data
AI总结:
本文提出分布记忆概念和task-gram语言模型,通过统计预训练语料中n-gram共现频率,在Pythia模型上分析四项任务,发现记忆在知识密集型任务中作用更大,泛化是推理任务关键。
摘要:
大型语言模型(LLMs)令人印象深刻的能力引发了争论:这些模型究竟是真正泛化到了未见任务,还是主要依赖于记忆大量预训练数据。为了探究这一问题,我们引入了记忆的扩展概念——分布记忆,它衡量LLM输出概率与预训练数据频率之间的相关性。为了有效捕获特定任务的预训练数据频率,我们提出了一种新颖的task-gram语言模型,该模型通过统计预训练语料库中任务输入与输出的语义相关n-gram对的共现来构建。使用在Pile数据集上训练的Pythia模型,我们评估了四项不同任务:机器翻译、事实问答、世界知识理解和数学推理。我们的发现揭示了不同程度的记忆效应,其中事实问答的记忆效应最强。此外,随着LLM规模增加,所有任务的模型性能均有提升,但只有事实问答的记忆程度增加,而机器翻译和推理任务展现出更强的泛化能力,产生更多新颖输出。本研究表明,记忆在较简单的知识密集型任务中发挥更大作用,而泛化则是较难的推理任务的关键,为更深入分析大型预训练语料库提供了可扩展方法。
英文摘要:
The impressive capabilities of large language models (LLMs) have sparked debate over whether these models genuinely generalize to unseen tasks or predominantly rely on memorizing vast amounts of pretraining data. To explore this issue, we introduce an extended concept of memorization, distributional memorization, which measures the correlation between the LLM output probabilities and the pretraining data frequency. To effectively capture task-specific pretraining data frequency, we propose a novel task-gram language model, which is built by counting the co-occurrence of semantically related $n$-gram pairs from task inputs and outputs in the pretraining corpus. Using the Pythia models trained on the Pile dataset, we evaluate four distinct tasks: machine translation, factual question answering, world knowledge understanding, and math reasoning. Our findings reveal varying levels of memorization, with the strongest effect observed in factual question answering. Furthermore, while model performance improves across all tasks as LLM size increases, only factual question answering shows an increase in memorization, whereas machine translation and reasoning tasks exhibit greater generalization, producing more novel outputs. This study demonstrates that memorization plays a larger role in simpler, knowledge-intensive tasks, while generalization is the key for harder, reasoning-based tasks, providing a scalable method for analyzing large pretraining corpora in greater depth.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。