Recent work on Transformer-based large language models (LLMs) has revealed striking limits in their working memory capacity, similar to what has been found in human behavioral studies. Specifically, these models' performance drops significantly on N-back tasks as N increases. However, there is still a lack of mechanistic interpretability as to why this phenomenon would arise. Inspired by the executive attention theory from behavioral sciences, we hypothesize that the self-attention mechanism within Transformer-based models might be responsible for their working memory capacity limits. To test this hypothesis, we train vanilla decoder-only transformers to perform N-back tasks and find that attention scores gradually aggregate to the N-back positions over training, suggesting that the model masters the task by learning a strategy to pay attention to the relationship between the current position and the N-back position. Critically, we find that the total entropy of the attention score matrix increases as N increases, suggesting that the dispersion of attention scores might be the cause of the capacity limit observed in N-back tasks. Our findings thus offer insights into the shared role of attention in both human and artificial intelligence. Moreover, the limitations of the self-attention mechanism revealed in the current study could inform future efforts to design more powerful model architectures with enhanced working memory capacity and cognitive capabilities.
In-context superposition: human-like working memory interference in large language models
School of Psychological and Brain Sciences, Georgia Tech(佐治亚理工学院心理与脑科学学院);Department of Psychology, New York University(纽约大学心理学系);Department of Cognitive Science, Indiana University Bloomington(印第安纳大学布卢明顿分校认知科学系);Honda Research Institute(本田研究所);Center of Excellence for Computational Cognition, Georgia Tech(佐治亚理工学院计算认知卓越中心);Departments of Neuroscience and Psychology, The University of Texas at Austin(德克萨斯大学奥斯汀分校神经科学和心理学系)
Strong Memory, Weak Control: An Empirical Study of Executive Functioning in LLMs
Department of Computer Science and Engineering, University of Minnesota(计算机科学与工程系,明尼苏达大学);Department of Linguistics, Hamline University(语言学系,哈姆林大学);Department of Psychology, University of Wisconsin-Stout(心理学系,威斯尼斯托大学);Department of English, University of Minnesota(英语系,明尼苏达大学)
Bridging the Dimensional Chasm: Uncover Layer-wise Dimensional Reduction in Transformers through Token Correlation
School of Physics, Peking University(北京大学物理学院);Institute of Theoretical Physics, Chinese Academy of Sciences(中国科学院理论物理研究所);Center for High Energy Physics, Peking University(北京大学高能物理研究中心);Beijing Computational Science Research Center(北京计算科学研究中心)
Neural ODE Transformers: Analyzing Internal Dynamics and Adaptive Fine-tuning
Korea University(高丽大学);Johns Hopkins University(约翰斯·霍普金斯大学);Texas A&M University-Commerce(德州农工大学 Commerce 分校);Qualcomm AI Research(高通人工智能研究部);Stanford(斯坦福大学);KAIST(韩国科学技术院);Qualcomm Vietnam Company Limited(高通越南有限公司)
School of Natural Sciences, Institute for Advanced Study, Princeton, NJ, 08540, USA(自然科学学院,普林斯顿高级研究院);Department of Brain Sciences, Weizmann Institute of Science, Rehovot, 76100 Israel(脑科学系,魏兹曼科学研究院)
Language Hierarchization Provides the Optimal Solution to Human Working Memory Limits
Max Planck Institute for Human Cognitive and Brain Sciences(马克斯·普朗克人类认知与脑科学研究所);University of Science and Technology of China(中国科学技术大学);Tianjin Normal University(天津师范大学);Macquarie University(麦考瑞大学);Beijing Normal University(北京师范大学)
An Exploration of Hierarchical Attention Transformers for Efficient Long Document Classification
University of Copenhagen(哥本哈根大学);CSIRO Data61(澳大利亚联邦科学与工业研究组织Data61);Athens University of Economics and Business(雅典经济与商业大学);Pioneer Centre for AI(人工智能先锋中心)
Effects of Parameter Norm Growth During Transformer Training: Inductive Bias from Gradient Descent
Allen Institute for AI(艾伦人工智能研究所);New York University(纽约大学);University of Washington(华盛顿大学);Bar Ilan University(巴伊兰大学);Hebrew University of Jerusalem(希伯来大学)