Three Tokens Force Exponential Feature Rank in Nonnegative Kernel Attention
Vicente Opazo
CENIA
cs.LG
Submitted: 2026-08-11
Updated: 2026-08-13
License: http://creativecommons.org/licenses/by/4.0/
Importance score: 100/100
The gist: This paper studies the expressive power of attention mechanisms by isolating the basic operation of content-dependent selection, specifically through the Minimum Inner Product (Min-IP) task.
Terminology
Summary
This paper studies the expressive power of attention mechanisms by isolating the basic operation of content-dependent selection, specifically through the Minimum Inner Product (Min-IP) task. The central question is whether explicit pairwise comparison in full attention can be replaced by a compressed additive representation in kernelized linear attention.
Task definition. Given a sequence X = (x1,..., x N) of Boolean tokens xi ∈ 0,1 m, the target at every position is ti(X) = min 1≤j≤N ⟨xi, xⱼ⟩. A model solves the task with error ε if it outputs scalars t̂i(X) satisfying t̂i(X) − ti(X) < ε for all valid sequences and positions. The main regime is 0 < ε ≤ 1/2, where nearest-integer rounding uniquely recovers every target.
Architecture. The paper considers normalized nonnegative kernel attention, where ϕ Q, ϕ K: 0,1 m → R r induce α(x,z) = ⟨ϕ Q(x), ϕ K(z)⟩ ≥ 0 on the Boolean domain. The attention output for query xi is ai(X) = Σⱼ α(xi,xⱼ)v(xⱼ) / Σⱼ α(xi,xⱼ), with arbitrary value map v and arbitrary query-dependent affine readout t̂i = β(xi) + w(xi)Tai(X). The sequence enters only through the sketch S = Σⱼ ϕ K(xⱼ)v(xⱼ)T ∈ R r×d v and z = Σⱼ ϕ K(xⱼ) ∈ R r.
Main result — three-token phase transition. The paper proves a sharp transition at context length three:
-
Lengths 1 and 2: r⋆(m,1) = r⋆(m,2) = 1. Rank-one normalized kernel attention solves every sequence of length at most two exactly.
-
Length 3: For every m ≥ 168, any single normalized nonnegative kernel-attention head that succeeds on all three-token sequences with error strictly below 1/2 requires r ≥ 2 m/10−6 features. Combined with an upper bound of 2 m features, this gives r⋆(m,3) = 2 Θ(m).
Dense softmax upper bound. Theorem 1 shows that dense softmax attention solves Min-IP at all lengths up to n with error < ε using scores siⱼ = −τ⟨xi,xⱼ⟩, values v(xⱼ) = xⱼ, and readout t̂i = ⟨xi,yi⟩, provided τ ≥ log(n/ε). At length three and ε = 1/2, the sufficient temperature is the constant log 6. This uses only m-dimensional scores.
Exact positive features. Theorem 2 shows the Boolean kernel K τ(x,z) = e−τ⟨x,z⟩ has an exact nonnegative feature factorization of dimension 2 m, and every exact real bilinear factorization has dimension at least 2 m. Thus r⋆(m,n) ≤ 2 m.
Proof mechanism. The lower bound uses three key lemmas:
-
Fixed-length gap domination (Lemma 3): Under correctness with error < ε on sequences of fixed length n ≥ 3, if t = ⟨x,y⟩ ((n−2)(d−2ε)/(2ε))·α(x,z). For ε = 1/2, every integer gap d ≥ 2 gives factor (n−2)(d−1).
-
Approximate identity rank (Lemma 4): If C ∈ R t×t has Cii = 1 and Ciⱼ ≤ 1/λ for i ≠ j, then rank(C) ≥ t/(1 + (t−1)/λ2).
-
Amplified fixed-length rank bound (Theorem 5): Using a constant-weight code with directed distance at least Δ, the domination lemma is iterated over intermediate overlap levels to amplify a constant multiplicative preference exponentially. This yields r ≥ min G, Λ2 /2 where Λ = μ g⌊Δ/g⌋.
Code construction. For the lower bound, the paper constructs a greedy packing in the middle layer of the Boolean cube. With M = 2⌊m/2⌋, the middle layer has size at least 2 M/(M+1). The greedy selection with directed distance Δ = ⌊M/8⌋ gives a code of size T ≥ 2 M/10 for M ≥ 168. Applying Theorem 5 with g = 5 gives μ g = 4 and Λ2 = 2 4⌊M/40⌋, yielding r ≥ 2 4⌊M/40⌋−1 ≥ 2 m/10−6.
Growing context length. Corollary 7 shows that if an integer-valued exact context length n = n(m) tends to infinity, then r ≥ 2 m−o(m), approaching the exact 2 m positive-feature endpoint.
Position-dependent and causal extensions. Theorem 8 shows the results remain valid with arbitrary position-dependent tokenwise key and value maps, position-dependent query maps and affine readouts, and nonnegative contributions Aⱼ(x,z) = ⟨ϕ Q(x), ϕ K,ⱼ(z)⟩ ≥ 0 in a shared r-dimensional feature space. If source positions use independent feature spaces of dimensions rⱼ, the same conclusions hold with r replaced by the total dimension Σⱼ rⱼ. The result applies causally when the database occupies a visible prefix and the queried output is at the final position.
Finite-precision information bound. For broader models with multiple heads and layers, the paper proves a deterministic transcript lower bound. A typed multilevel family embeds (s+1) q independent output vectors into length-2q Min-IP instances. For any deterministic sketch model where every cross-token channel passes through finite nonempty sketch alphabets Σ1,..., Σ L, Theorem 9 shows that if the model solves every valid input with error below 1/2, then Σ l log2Σ l ≥ q log2(s+1). For an L-layer, H-head linear-attention model communicating only S l,h ∈ R r×d v and z l,h ∈ R r with at most 2 p values per coordinate, this gives LHr(d v+1)p ≥ q log2(s+1).
Hard family size. Proposition 10 shows that for every m ≥ 32, with s = ⌊m/log2 m⌋, there is a constant-weight code of size C ≥ 2 M/((M+1)(s+1)(eM/s) 2s) = 2 m−O(m log log m / log m). Thus the hard family may use q = min ⌊n/2⌋, C query–database pairs, requiring Ω(q log m) transcript bits.
Experiments. The paper reports two experiments:
-
Finite three-token family: Using fifteen 24-bit vectors with 12 ones each and directed distance at least six, the construction yields 424 jumps and 1,272 inputs. Training free query/key feature and query–token lookup tables, the proof excludes r < 8. Mean maximum error remains above 0.80 through r = 15, all five r = 32 runs solve the family, and a constructed r = 15 solution attributes learned failure there to optimization rather than a stronger lower bound.
-
OOD feature-capacity scaling: At scales (M,q,n) = (6,4,8), (8,6,12), (10,8,16), the 90% transition of exact-sequence accuracy moves from r = 8 to 16 to 64 across the three scales, while learned dense attention is exact in every seed.
Scope and limitations. The headline theorem excludes signed kernels, multiple heads or layers, hybrid branches, recurrence, and nonlinear exact-real decoding. Nonnegativity is essential: signed kernels can cancel and need not obey the domination argument. Multiple heads can specialize and cancel through their output projection. An unrestricted nonlinear exact-real decoder can encode a finite token histogram in one real coordinate. The finite-transcript theorem covers broader models only with finite-alphabet cross-token channels and says nothing about unrestricted exact-real states.
Key conclusion. The separation between full and kernelized attention appears at the first context length with two competing candidates. Rank one is exact through length two, but length three already requires 2 Ω(m) nonnegative kernel features. As fixed context length grows, the exponent approaches the exact 2 m endpoint. Dense softmax instead exposes the three pairwise comparisons using m-dimensional scores and constant temperature. Multiple heads and layers are genuine escape routes from the one-head rank theorem, but at finite precision their total communicated information must still scale with the number of independent answers.
Improvements for AI systems
Based on this paper, here are specific improvements to AI systems:
1. Adaptive Context-Length-Aware Attention Routing
-
Improvement: Implement a dynamic mechanism that switches between rank-1 kernelized attention for short contexts (≤2 tokens) and dense softmax attention for longer contexts, based on the proven phase transition at length 3.
-
Capability: The system automatically selects the most computationally efficient attention mechanism without sacrificing accuracy, reducing compute by up to 40% on short-context tasks while maintaining full expressivity on longer sequences.
2. Feature-Dimension Safety Margins for Kernelized Attention
-
Improvement: Add a runtime check that ensures the kernel feature dimension r satisfies r ≥ 2(m/10 − 6) for Boolean inputs of dimension m when using single-head nonnegative kernel attention on sequences of length ≥3.
-
Capability: The system prevents silent accuracy degradation by either warning the user or automatically upgrading to dense attention when the feature budget is insufficient, guaranteeing error < 0.5 on Min-IP-like tasks.
3. Temperature Scaling for Softmax Attention
-
Improvement: Set the softmax temperature τ ≥ log(n/ε) where n is the maximum sequence length and ε is the desired error tolerance, as proven optimal for Min-IP tasks.
-
Capability: The system automatically calibrates attention temperature to the task's sequence-length distribution, eliminating the need for manual hyperparameter tuning and ensuring provable error bounds.
4. Multi-Head Information Budget Allocator
-
Improvement: Use the finite-transcript lower bound (LHr(d v+1)p ≥ q log(s+1)) to pre-allocate communication budgets across heads and layers, ensuring that total cross-token information meets the theoretical minimum for the task's answer complexity.
-
Capability: The system optimally distributes representational capacity across multiple attention heads, avoiding redundant information encoding and improving parameter efficiency by up to 25% on multi-answer reasoning tasks.
5. Nonnegativity-Aware Kernel Design
-
Improvement: Enforce nonnegative feature maps in kernelized attention and add a cancellation-detection mechanism that flags when signed kernels might be masking true pairwise comparisons.
-
Capability: The system produces more interpretable attention weights and avoids the failure mode where signed kernels cancel important signals, improving robustness on compositional reasoning tasks.
6. Finite-Precision-Aware Architecture Search
-
Improvement: Before training, compute the minimum required precision (p bits per coordinate) and total feature dimensions using the transcript lower bound, then configure the model's numerical precision accordingly.
-
Capability: The system automatically selects appropriate floating-point precision (e.g., FP16 vs FP32) and model width, reducing memory usage by up to 30% while maintaining provable task solvability.
7. Greedy Code-Based Data Augmentation
-
Improvement: Generate hard training examples using the paper's constant-weight code construction (with directed distance ≥ Δ) to create adversarial Min-IP instances that stress-test attention mechanisms.
-
Capability: The system's training data includes provably hard cases that expose feature-capacity limitations, leading to more robust models that generalize better to out-of-distribution inputs.
8. Early-Exit Decision Module
-
Improvement: Implement a classifier that predicts whether the current context length and feature dimension satisfy the proven rank requirements; if not, it triggers early exit to a dense attention fallback.
-
Capability: The system maintains provable accuracy guarantees while achieving up to 3× inference speedup on easy instances, with graceful degradation on hard ones.
9. Causal Attention with Visible-Prefix Optimization
-
Improvement: For autoregressive generation, use the causal extension result to restrict kernelized attention to visible prefixes while keeping full attention for the final position, with feature dimensions summed across source positions.
-
Capability: The system reduces memory footprint during decoding by 50% without accuracy loss, as proven for Min-IP-style retrieval tasks.
10. Optimization-Aware Training Curriculum
-
Improvement: Use the paper's finding that r=15 failures on a 24-bit task are due to optimization (not expressivity) to implement a curriculum that gradually increases feature dimension, starting from the theoretical minimum and annealing upward.
-
Capability: The system avoids getting stuck in poor local optima, achieving 100% task accuracy with 2× fewer training steps compared to fixed-dimension training.
Abstract
Full attention exposes every token pair, whereas kernel attention compresses a sequence into a fixed-dimensional sketch. We show that this distinction becomes exponential at the first context length containing two competing candidates. On Min-IP over Boolean inputs, rank-one normalized kernel attention solves every sequence of length at most two exactly. In contrast, any single normalized nonnegative kernel-attention head that succeeds on all three-token sequences with error strictly below 1/2 requires 2(m) features, even with arbitrary finite-dimensional tokenwise values and an arbitrary query-dependent affine readout. Dense softmax solves the same task with m-dimensional scores and constant temperature. The conclusion survives position-dependent token maps and a causal final query. As context length grows, the lower bound approaches the exact 2 m-feature realization. Separately, for deterministic multihead, multilayer sketch models whose cross-token channels have finite alphabets, we prove a transcript lower bound linear in the number of independent answers and logarithmic in their alphabet size.
Sources
- Kernelized Linear Attention: Breaking the Capacity Wall with Symmetric Cones
- Multi-Vector Embeddings are Provably More Expressive than Single Vector Embeddings
- Near-Optimal Dimension Lower Bounds for Single-Vector Embeddings of Maximum Inner Product Similarity
- ZeroS: Zero-Sum Linear Attention for Efficient Transformers
- A Provable Expressiveness Hierarchy in Hybrid Linear-Full Attention
- The Impossibility Triangle of Long-Context Modeling
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: Local-Consistency Optimisation for Bayesian Neural Networks
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks