ICLR2026
Sublinear Time Quantum Algorithm for Attention Approximation
Zhao Song, Jianfei Xue, Jiahao Zhang, Lichen Zhang
被引用 1 次
摘要
Given the query, key and value matrices , the attention matrix is defined as where with applied entrywise, . The attention matrix is the backbone of modern transformers and large language models, but explicitly forming the softmax matrix incurs , motivating numerous approximation schemes that reduce runtime to via sparsity or low-rank factorization.
We propose a quantum data structure that approximates any row of using only row queries to . Our algorithm preprocesses these matrices in time, where is the target accuracy, is the -statistical dimension of the exponential kernel defined by and , and measures the row distortion of that is at most , the stable rank of . Each row query can be answered in time.
To our knowledge, this is the first quantum data structure that approximates rows of the attention matrix in sublinear time with respect to . Our approach relies on a quantum Nyström approximation of the exponential kernel, quantum multivariate mean estimation for computing , and quantum leverage score sampling for the multiplication with .