Memory is the foundation of all human activities; without memory, it would be nearly impossible for people to perform any task in daily life. With the development of Large Language Models (LLMs), their language capabilities are becoming increasingly comparable to those of humans. But do LLMs have memory? Based on current performance, LLMs do appear to exhibit memory. So, what is the underlying mechanism of this memory? Previous research has lacked a deep exploration of LLMs' memory capabilities and the underlying theory. In this paper, we use Universal Approximation Theorem (UAT) to explain the memory mechanism in LLMs. We also conduct experiments to verify the memory capabilities of various LLMs, proposing a new method to assess their abilities based on these memory ability. We argue that LLM memory operates like Schr\"odinger's memory, meaning that it only becomes observable when a specific memory is queried. We can only determine if the model retains a memory based on its output in response to the query; otherwise, it remains indeterminate. Finally, we expand on this concept by comparing the memory capabilities of the human brain and LLMs, highlighting the similarities and differences in their operational mechanisms.
翻译:记忆是人类一切活动的基础;没有记忆,人们几乎无法完成日常生活中的任何任务。随着大语言模型(LLMs)的发展,其语言能力正日益接近人类水平。但大语言模型是否拥有记忆?基于当前表现,大语言模型确实展现出记忆能力。那么,这种记忆的底层机制是什么?先前研究对大语言模型的记忆能力及其理论基础缺乏深入探讨。本文运用通用近似定理(UAT)阐释大语言模型中的记忆机制。我们还通过实验验证了多种大语言模型的记忆能力,并提出一种基于这些记忆能力评估其性能的新方法。我们认为,大语言模型的记忆运作方式类似于薛定谔的记忆,即只有当特定记忆被查询时,它才变得可观测。我们只能根据模型对查询的输出判断其是否保留了该记忆;否则,记忆状态将保持不确定。最后,我们通过比较人脑与大语言模型的记忆能力拓展了这一概念,强调二者在运作机制上的异同。