arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.10715cs.CLcs.AIq-bio.NC
收藏

自注意力机制限制了基于 Transformer 模型的工作记忆容量

Self-Attention Limits Working Memory Capacity of Transformer-Based Models

Yale University(耶鲁大学)

Dongyu Gong, Hantao Zhang

AI总结:

本研究发现Transformer模型的自注意力机制导致其工作记忆容量受限,在N-back任务中注意力分数分散性随N增加而增大,为改进模型架构提供了指导。

摘要:

近期关于基于 Transformer 的大型语言模型(LLMs)的研究揭示了其工作记忆容量的显著限制,这与人类行为学研究中的发现相似。具体而言,随着 N 的增加,这些模型在 N-back 任务上的性能显著下降。然而,对于为何会出现这种现象,目前仍缺乏机制上的可解释性。受行为科学中执行注意力理论的启发,我们假设基于 Transformer 模型内的自注意力机制可能是导致其工作记忆容量限制的原因。为了验证这一假设,我们训练了原始的 decoder-only transformers 来执行 N-back 任务,并发现注意力分数在训练过程中逐渐聚集到 N-back 位置,这表明模型通过学习一种关注当前位置与 N-back 位置之间关系的策略来掌握该任务。关键在于,我们发现注意力分数矩阵的总熵随着 N 的增加而增加,这表明注意力分数的分散性可能是 N-back 任务中观察到容量限制的原因。因此,我们的发现为注意力在人类和人工智能中的共同作用提供了深刻见解。此外,当前研究所揭示的自注意力机制的局限性,可为未来设计具有更强工作记忆容量和认知能力的模型架构提供指导。

英文摘要:

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.

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

↑