arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.08203cs.CLcs.AI
收藏

大型语言模型中的记忆检索与巩固:通过函数标记实现

Memory Retrieval and Consolidation in Large Language Models through Function Tokens

ByteDance Seed(字节跳动种子)

Shaohua Zhang, Yuan Lin, Hang Li

AI总结:

本文提出函数标记假说,解释LLMs通过函数标记在推理时检索记忆、在预训练时巩固记忆的机制,并用二分图分析和案例研究提供实验证据。

摘要:

大型语言模型(LLMs)的显著成功源于其在预训练期间将大量知识巩固到记忆中,并在推理期间从记忆中检索知识的能力,从而实现了知识记忆、指令遵循和推理等高级能力。然而,LLMs中记忆检索和巩固的机制仍知之甚少。在本文中,我们提出函数标记假说来解释LLMs的工作机制:在推理期间,函数标记从上下文中激活最具预测性的特征,并主导下一个标记的预测(记忆检索)。在预训练期间,预测函数标记之后的下一个标记(通常是内容标记)会增加LLMs学习到的特征数量,并更新模型参数(记忆巩固)。这里的函数标记大致对应于语言学中的功能词,包括标点符号、冠词、介词和连词,与内容标记相对。我们提供了大量实验证据支持这一假说。通过二分图分析,我们表明少数函数标记激活了大多数特征。案例研究进一步揭示了函数标记如何从上下文中激活最具预测性的特征以指导下一个标记的预测。我们还发现,在预训练期间,训练损失主要由预测函数标记之后的下一个内容标记所主导,这迫使函数标记从上下文中选择最具预测性的特征。

英文摘要:

The remarkable success of large language models (LLMs) stems from their ability to consolidate vast amounts of knowledge into the memory during pre-training and to retrieve it from the memory during inference, enabling advanced capabilities such as knowledge memorization, instruction-following and reasoning. However, the mechanisms of memory retrieval and consolidation in LLMs remain poorly understood. In this paper, we propose the function token hypothesis to explain the workings of LLMs: During inference, function tokens activate the most predictive features from context and govern next token prediction (memory retrieval). During pre-training, predicting the next tokens (usually content tokens) that follow function tokens increases the number of learned features of LLMs and updates the model parameters (memory consolidation). Function tokens here roughly correspond to function words in linguistics, including punctuation marks, articles, prepositions, and conjunctions, in contrast to content tokens. We provide extensive experimental evidence supporting this hypothesis. Using bipartite graph analysis, we show that a small number of function tokens activate the majority of features. Case studies further reveal how function tokens activate the most predictive features from context to direct next token prediction. We also find that during pre-training, the training loss is dominated by predicting the next content tokens following function tokens, which forces the function tokens to select the most predictive features from context.

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

↑