arXiv:2510.18745cs.CL2025-10被引 7

让Transformer模型具备类脑拓扑结构,提升可解释性。

Topoformer: brain-like topographic organization in Transformer language models through spatial querying and reweighting

  • 通过空间查询与重加权机制,在注意力中引入二维网格布局。
  • 在情感分类和BERT任务中表现相当,但生成可解释的拓扑结构。
  • 与人脑语言网络的低维拓扑变异高度对齐,适合脑启发研究。

空间功能组织是生物大脑的特征:神经元按响应特性在多尺度上呈拓扑排列。相比之下,大多数机器学习模型的表示缺乏空间偏置,呈现难以可视化和解释的无序向量空间。本文提出一种新型自注意力机制,使Transformer变为具有拓扑结构的「Topoformer」。引入空间查询——将键和查询置于2D网格上,局部查询池与特定键关联;以及空间重加权——将标准全连接层改为局部连接层。首先在1层Topoformer上训练情感分类任务,验证可行性:空间查询促进查询与键的拓扑组织,空间重加权则单独促进值和注意力输出的拓扑组织。随后在大规模BERT架构上应用该方法,使用掩码语言建模目标训练。结果表明,拓扑变体在自然语言处理基准上性能与非拓扑对照模型相当,却能通过八项语言测试套件验证其可解释的拓扑结构。最后,分析人类大脑对大量自然语句的fMRI响应数据,发现Topoformer的低维拓扑变异与人脑语言网络高度一致。扩展拓扑模型有望提升NLP研究的可解释性,并更准确模拟人类大脑中语言信息的组织方式。

原文摘要 · Abstract (English)

Spatial functional organization is a hallmark of biological brains: neurons are arranged topographically according to their response properties, at multiple scales. In contrast, representations within most machine learning models lack spatial biases, instead manifesting as disorganized vector spaces that are difficult to visualize and interpret. Here, we propose a novel form of self-attention that turns Transformers into "Topoformers" with topographic organization. We introduce spatial querying - where keys and queries are arranged on 2D grids, and local pools of queries are associated with a given key - and spatial reweighting, where we convert the standard fully connected layer of self-attention into a locally connected layer. We first demonstrate the feasibility of our approach by training a 1-layer Topoformer on a sentiment classification task. Training with spatial querying encourages topographic organization in the queries and keys, and spatial reweighting separately encourages topographic organization in the values and self-attention outputs. We then apply the Topoformer motifs at scale, training a BERT architecture with a masked language modeling objective. We find that the topographic variant performs on par with a non-topographic control model on NLP benchmarks, yet produces interpretable topographic organization as evaluated via eight linguistic test suites. Finally, analyzing an fMRI dataset of human brain responses to a large set of naturalistic sentences, we demonstrate alignment between low-dimensional topographic variability in the Topoformer model and human brain language network. Scaling up Topoformers further holds promise for greater interpretability in NLP research, and for more accurate models of the organization of linguistic information in the human brain.

Transformer拓扑结构可解释性类脑计算

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