Saved in:
Bibliographic Details
Main Authors: Rende, Riccardo, Viteritti, Luciano Loris
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2405.18874
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915100052422656
author Rende, Riccardo
Viteritti, Luciano Loris
author_facet Rende, Riccardo
Viteritti, Luciano Loris
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2405_18874
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Are queries and keys always relevant? A case study on Transformer wave functions
Rende, Riccardo
Viteritti, Luciano Loris
Disordered Systems and Neural Networks
Computation and Language
Computational Physics
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.
title Are queries and keys always relevant? A case study on Transformer wave functions
topic Disordered Systems and Neural Networks
Computation and Language
Computational Physics
url https://arxiv.org/abs/2405.18874