Skip to main content
QUICK REVIEW

[Paper Review] Provably Learning Attention with Queries

Satwik Bhattamishra, Kulin Shah|arXiv (Cornell University)|Jan 23, 2026
Stochastic Gradient Optimization TechniquesComputer Science0 citations
TL;DR

The paper provides provable algorithms to recover single-head softmax attention parameters from value queries, with extensions to low-rank and robustness settings, and shows non-identifiability for multi-head attention without extra structure.

ABSTRACT

We study the problem of learning Transformer-based sequence models with black-box access to their outputs. In this setting, a learner may adaptively query the oracle with any sequence of vectors and observe the corresponding real-valued output. We begin with the simplest case, a single-head softmax-attention regressor. We show that for a model with width $d$, there is an elementary algorithm to learn the parameters of single-head attention exactly with $O(d^2)$ queries. Further, we show that if there exists an algorithm to learn ReLU feedforward networks (FFNs), then the single-head algorithm can be easily adapted to learn one-layer Transformers with single-head attention. Next, motivated by the regime where the head dimension $r \ll d$, we provide a randomised algorithm that learns single-head attention-based models with $O(rd)$ queries via compressed sensing arguments. We also study robustness to noisy oracle access, proving that under mild norm and margin conditions, the parameters can be estimated to $\varepsilon$ accuracy with a polynomial number of queries even when outputs are only provided up to additive tolerance. Finally, we show that multi-head attention parameters are not identifiable from value queries in general -- distinct parameterisations can induce the same input-output map. Hence, guarantees analogous to the single-head setting are impossible without additional structural assumptions.

Motivation & Objective

  • Motivate and formalize learning attention-based sequence models with black-box value queries.
  • Show exact parameter recovery for single-head attention with polynomial query complexity.
  • Extend to one-layer Transformers under a ReLU FFN learning assumption.
  • Develop a low-rank regime algorithm with reduced query complexity via compressed sensing.
  • Analyze robustness to additive oracle noise and identifiability in multi-head attention.

Proposed method

  • Model single-head attention as f_{W,v}(X) = alpha(X,W)^{T}(Xv) with alpha from softmax over scores s_i = x_i^T W x_N.
  • Prove exact recoverability of (W*,v*) in O(d^2) value queries by isolating the softmax via short sequences and converting to linear equations.
  • Show how to combine a two-step approach with an FFN learner to obtain a one-layer Transformer with single-head attention.
  • In the low-rank regime (rank(W*) ≤ r), design rank-one measurements and apply compressed sensing to recover with O(rd) queries.
  • Address robustness by analyzing approximate value queries and deriving ε-accurate recovery under mild norm and margin assumptions.
  • Demonstrate non-identifiability of multi-head attention parameters from value queries in general.

Experimental results

Research questions

  • RQ1Can single-head softmax attention parameters be exactly recovered from value queries?
  • RQ2How does the query complexity scale with embedding dimension d in single-head versus low-rank W*, and can compression reduce this?
  • RQ3Can one-layer Transformers be learned using value-query access by leveraging FFN learning as a subroutine?
  • RQ4How robust are the recovery guarantees when the oracle provides noisy or approximate outputs?
  • RQ5Are multi-head attention parameters identifiable from value queries, and under what structural assumptions could identifiability be achieved?

Key findings

  • Single-head attention parameters can be exactly recovered with O(d^2) value queries (Theorem 4.1).
  • A two-step approach yields a one-layer Transformer with single-head attention assuming an FFN value-query learner exists.
  • In the low-rank regime rank(W*) ≤ r, recovery is possible with O(rd) queries via compressed sensing.
  • With approximate value queries, ε-accuracy recovery is still achievable under mild norm bounds and margin conditions.
  • Multi-head attention parameters are not identifiable from value queries in general, implying no analogous single-head guarantees without extra structure.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.