mlsanityData to 14 Oct 2026

Provably Learning Multi-Head Attention with Queries

arXiv 2608.03294 ↗First posted 4 Aug 2026cs.LG cs.CRcited by 2

Not on the map. Why?

Abstract (arXiv)

We study the problem of learning multi-head softmax attention from black-box input-output access. The learner may query arbitrary real-valued token sequences and observe only the scalar output at the final token. Recent work gives an algorithm using O(d2) value queries to recover the single-head parameters (W,v). For multiple heads, the same work establishes identifiability under the assumption that the heads occupy pairwise orthogonal subspaces. Applying the single-head recovery algorithm separately to the heads additionally requires bases for these subspaces to be known. We recover a canonical representation by merging heads with the same Wh, summing their corresponding vh, and discarding a merged head when this sum is zero, without these subspace assumptions. By varying the number of copies of a token, our algorithm obtains samples of a rational function whose interpolation separates the canonical heads. Additional queries formed by adding selected token vectors then match the same head across different queries. When the oracle outputs and all subsequent computations are exact, the learner chooses its query vectors at random and recovers the canonical pairs (Wh,vh):h∈[H] up to permutation with probability one. When H is known, it uses exactly 4Hd2-2H+1 value queries of maximum length 2H+1. If only a known upper bound H0 is available, the algorithm uses 4H0d2-2H0+1 value queries of maximum length 2H0+1. For approximate oracle outputs, we give conditions under which the parameter error is at most a model- and query-dependent constant multiple of the output error. Finally, we extend our result to a one-layer Transformer with multi-head attention followed by a bias-free ReLU feed-forward network. Under additional conditions, we recover a functionally equivalent Transformer without relying on a separate algorithm for learning the feed-forward network.

Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 13 of its 20 references that are in the map. First posted on arXiv 4 Aug 2026.

Builds on

13 of 20 references.

References · 13

  1. 2017Attention Is All You Needcited by 60,361
  2. 2016Stealing Machine Learning Models via Prediction APIscited by 619
  3. 2019High Accuracy and High Fidelity Extraction of Neural Networkscited by 214
  4. 2024Stealing Part of a Production Language Modelcited by 159
  5. 2019On Identifiability in Transformerscited by 116
  6. 2018Model Reconstruction from Model Explanationscited by 86
  7. 2024Equivariant Neural Functional Networks for Transformerscited by 22
  8. 2024Provably learning a multi-head attention layercited by 21
  9. 2013ROP: Matrix recovery via rank-one projectionscited by 18
  10. 2021An Exact Poly-Time Membership-Queries Algorithm for Extraction a three-Layer ReLU Networkcited by 11
  11. 2024Polynomial Time Cryptanalytic Extraction of Deep Neural Networks in the Hard-Label Settingcited by 9
  12. 2024Learning Linear Attention in Polynomial Timecited by 5
1 more
  1. 2026Functional Equivalence in Attention: A Comprehensive Study with Applications to Linear Mode Connectivitycited by 3

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 2.

2 papers.