함수 토큰을 통한 대규모 언어 모델의 메모리 검색 및 통합
Memory Retrieval and Consolidation in Large Language Models through Function Tokens
October 9, 2025
저자: Shaohua Zhang, Yuan Lin, Hang Li
cs.AI
초록
대규모 언어 모델(LLM)의 놀라운 성공은 사전 학습 과정에서 방대한 양의 지식을 메모리에 통합하고, 추론 과정에서 이를 메모리에서 검색할 수 있는 능력에서 비롯됩니다. 이는 지식 기억, 명령 수행, 추론과 같은 고급 기능을 가능하게 합니다. 그러나 LLM에서의 메모리 검색 및 통합 메커니즘은 여전히 잘 이해되지 않고 있습니다. 본 논문에서는 LLM의 작동 방식을 설명하기 위해 함수 토큰 가설을 제안합니다: 추론 과정에서 함수 토큰은 문맥에서 가장 예측 가능한 특징을 활성화하고 다음 토큰 예측(메모리 검색)을 주도합니다. 사전 학습 과정에서는 함수 토큰 뒤에 오는 다음 토큰(일반적으로 내용 토큰)을 예측함으로써 LLM이 학습하는 특징의 수가 증가하고 모델 파라미터가 업데이트됩니다(메모리 통합). 여기서 함수 토큰은 언어학에서의 기능어와 대략적으로 일치하며, 구두점, 관사, 전치사, 접속사 등을 포함합니다. 이는 내용 토큰과 대조됩니다. 우리는 이 가설을 지지하는 광범위한 실험적 증거를 제시합니다. 이분 그래프 분석을 통해 소수의 함수 토큰이 대부분의 특징을 활성화한다는 것을 보여줍니다. 사례 연구는 함수 토큰이 문맥에서 가장 예측 가능한 특징을 어떻게 활성화하여 다음 토큰 예측을 이끌어내는지를 추가로 밝힙니다. 또한 사전 학습 과정에서 함수 토큰 뒤에 오는 내용 토큰을 예측하는 것이 학습 손실을 지배하며, 이는 함수 토큰이 문맥에서 가장 예측 가능한 특징을 선택하도록 강제한다는 것을 발견했습니다.
English
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.