arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.09281cs.CLcs.AIcs.LG
收藏

语言模型“领悟”复制能力

Language Models "Grok" to Copy

Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院);Machine Learning Platform Department, Tencent(腾讯机器学习平台部);School of Computer Science, Wuhan University(武汉大学计算机学院)

Ang Lv, Ruobing Xie, Xingwu Sun, Zhanhui Kang, Rui Yan

AI总结:

本文提出语言模型的上下文复制能力发展类似“领悟”现象,并通过实验揭示其损失下降、复制能力突然饱和、与训练token数无关以及归纳头由浅入深形成等规律,为改进语言模型训练和上下文表现提供新见解。

摘要:

我们研究了语言模型的预训练动态,重点关注其从前文上下文中复制文本的能力——这是各种大语言模型应用的一项基础技能,包括上下文学习(ICL)和检索增强生成(RAG)。我们提出一种新观点:基于Transformer的语言模型发展复制能力的方式类似于“领悟”(grokking),即模型在拟合训练集很久之后才在测试集上突然泛化。我们的实验得出三个论点:(1)预训练损失迅速下降,而模型的上下文复制能力起初滞后,随后突然饱和。(2)发展复制能力的速度与训练的token数量无关,类似于只要数据分布保持不变,领悟速度就不受数据集大小影响。(3)负责复制的注意力头——归纳头(induction heads)——在训练过程中从浅层到深层逐渐形成,这与领悟过程中更深层网络中回路的发展模式相呼应。我们认为,领悟与上下文复制之间的联系可以为更有效的语言模型训练提供有价值的见解,最终提升上下文表现。例如,我们证明了增强领悟的技术(如正则化)会加速或增强上下文复制能力的发展。

英文摘要:

We examine the pre-training dynamics of language models, focusing on their ability to copy text from preceding context--a fundamental skill for various LLM applications, including in-context learning (ICL) and retrieval-augmented generation (RAG). We propose a novel perspective that Transformer-based language models develop copying abilities similarly to grokking, which refers to sudden generalization on test set long after the model fit to the training set. Our experiments yield three arguments: (1) The pre-training loss decreases rapidly, while the context copying ability of models initially lags and then abruptly saturates. (2) The speed of developing copying ability is independent of the number of tokens trained, similarly to how grokking speed is unaffected by dataset size as long as the data distribution is preserved. (3) Induction heads, the attention heads responsible for copying, form from shallow to deep layers during training, mirroring the development of circuits in deeper layers during grokking. We contend that the connection between grokking and context copying can provide valuable insights for more effective language model training, ultimately improving in-context performance. For example, we demonstrated that techniques that enhance grokking, such as regularization, either accelerate or enhance the development of context copying.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑