arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.18874cond-mat.dis-nncs.CLphysics.comp-ph
收藏

查询和键总是相关的吗?——基于Transformer波函数的案例研究

Are queries and keys always relevant? A case study on Transformer wave functions

International School for Advanced Studies(国际高等研究学院);University of Trieste(的里雅斯特大学)

Riccardo Rende, Luciano Loris Viteritti

AI总结:

本研究针对Transformer注意力机制在量子多体自旋哈密顿量基态变分波函数参数化中的应用展开,发现仅依赖位置的简化注意力可在降低成本的同时取得有竞争力的结果,且优化后标准注意力权重与输入无关,为大系统研究省略查询和键提供了物理依据。

摘要:

点积注意力机制最初为自然语言处理任务设计,是现代Transformer的核心基础。它通过计算查询(queries)与键(keys)的相似度重叠,能精准捕捉句子中词对之间的语义关系。本研究聚焦Transformer的注意力机制,探究其在变分波函数参数化以近似量子多体自旋哈密顿量基态这一特定领域的适用性。具体而言,我们在二维$J_1$-$J_2$海森堡模型(晶格量子多体系统领域的常用基准)上开展了数值模拟。通过将标准注意力机制与一种排除查询和键、仅依赖位置的简化版本进行性能对比,我们在降低计算成本和参数用量的同时取得了具有竞争力的结果。此外,通过分析标准注意力机制生成的注意力图,我们发现在优化结束时,注意力权重实际上变得与输入无关。我们通过解析计算支撑了数值结果,为研究大系统时原则上为何应从注意力机制中省略查询和键提供了物理层面的洞见。

英文摘要:

The dot product attention mechanism, originally designed for natural language processing tasks, is a cornerstone of modern Transformers. It adeptly captures semantic relationships between word pairs in sentences by computing a similarity overlap between queries and keys. In this work, we explore the suitability of Transformers, focusing on their attention mechanisms, in the specific domain of the parametrization of variational wave functions to approximate ground states of quantum many-body spin Hamiltonians. Specifically, we perform numerical simulations on the two-dimensional $J_1$-$J_2$ Heisenberg model, a common benchmark in the field of quantum many-body systems on lattice. By comparing the performance of standard attention mechanisms with a simplified version that excludes queries and keys, relying solely on positions, we achieve competitive results while reducing computational cost and parameter usage. Furthermore, through the analysis of the attention maps generated by standard attention mechanisms, we show that the attention weights become effectively input-independent at the end of the optimization. We support the numerical results with analytical calculations, providing physical insights of why queries and keys should be, in principle, omitted from the attention mechanism when studying large systems.

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

↑