arXiv:2409.10715cs.CLcs.AI2024-09被引 3

Transformer模型工作记忆有限,因注意力分布越来越分散。

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

  • 通过训练模型完成N-back任务,发现注意力逐渐聚焦于N步前的位置。
  • 随着N增大,注意力矩阵熵值上升,表明注意力分散加剧。
  • 揭示了注意力机制在人与人工智能中的共性局限,适合研究认知模型者参考。

基于Transformer的大语言模型在执行N-back任务时表现出显著的工作记忆容量限制,性能随N值增加而下降。受行为科学中执行注意理论启发,我们假设Transformer的自注意力机制是导致该现象的原因。通过训练纯解码器架构的Transformer完成N-back任务,发现注意力得分在训练过程中逐渐集中于目标位置(即第N步前的位置),表明模型学会关注当前与历史位置的关系。关键发现是:随着N值增大,注意力得分矩阵的总熵值持续上升,提示注意力分布扩散可能是容量限制的根本原因。该研究为理解人类与人工智能中注意力的共性提供了机制解释,并为设计具备更强工作记忆能力的新型模型架构提供指导。

原文摘要 · Abstract (English)

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.

注意力机制工作记忆Transformer认知建模

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。