Quantum Attention by Overlap Interference: Predicting Sequences from Classical and Many-Body Quantum Data

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Pecilli, Alessio, Rosati, Matteo
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915780039278592
author Pecilli, Alessio
Rosati, Matteo
author_facet Pecilli, Alessio
Rosati, Matteo
contents We propose a variational quantum implementation of self-attention (QSA), the core operation in transformers and large language models, which predicts future elements of a sequence by forming overlap-weighted combinations of past data. At variance with previous approaches, our QSA realizes the required nonlinearity through interference of state overlaps and returns a Renyi-1/2 cross-entropy loss directly as the expectation value of an observable, avoiding the need to decode amplitude-encoded predictions into classical logits. Furthermore, QSA naturally accommodates a constrained, trainable data-embedding that ties quantum state overlaps to data-level similarities. We find a gate complexity dominant scaling O(T d^2) for QSA, versus O(T^2 d) classically, suggesting an advantage in the practical regime where the sequence length T dominates the embedding size d. In simulations, we show that our QSA-based quantum transformer learns sequence prediction on classical data and on many-body transverse-field Ising quantum trajectories, establishing trainable attention as a practical primitive for quantum dynamical modeling.
format Preprint
id arxiv_https___arxiv_org_abs_2602_06699
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Quantum Attention by Overlap Interference: Predicting Sequences from Classical and Many-Body Quantum Data
Pecilli, Alessio
Rosati, Matteo
Quantum Physics
Computation and Language
Machine Learning
We propose a variational quantum implementation of self-attention (QSA), the core operation in transformers and large language models, which predicts future elements of a sequence by forming overlap-weighted combinations of past data. At variance with previous approaches, our QSA realizes the required nonlinearity through interference of state overlaps and returns a Renyi-1/2 cross-entropy loss directly as the expectation value of an observable, avoiding the need to decode amplitude-encoded predictions into classical logits. Furthermore, QSA naturally accommodates a constrained, trainable data-embedding that ties quantum state overlaps to data-level similarities. We find a gate complexity dominant scaling O(T d^2) for QSA, versus O(T^2 d) classically, suggesting an advantage in the practical regime where the sequence length T dominates the embedding size d. In simulations, we show that our QSA-based quantum transformer learns sequence prediction on classical data and on many-body transverse-field Ising quantum trajectories, establishing trainable attention as a practical primitive for quantum dynamical modeling.
title Quantum Attention by Overlap Interference: Predicting Sequences from Classical and Many-Body Quantum Data
topic Quantum Physics
Computation and Language
Machine Learning
url https://arxiv.org/abs/2602.06699