2025-10-10 · 专家 · 自然语言处理 · 机器学习

Memory Retrieval and Consolidation in Large Language Models through Function Tokens

本文提出了功能词假设,通过分析大语言模型(LLMs)中的功能词和内容词,揭示了LLMs在推理和预训练过程中记忆检索和巩固的机制。

更新于 2025-10-12。作者:Shaohua Zhang、Yuan Lin、Hang Li。

中文摘要

大型语言模型(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.

解读

一句话总结

本文提出了功能词假设,通过分析大语言模型(LLMs)中的功能词和内容词,揭示了LLMs在推理和预训练过程中记忆检索和巩固的机制。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源