Alphabeta Math
LemmaStatement: Literature-sourcedProof: AI-adaptedPipeline-generatedprecheck pending
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

A nonfinal token has inverse-length influence under bounded soft attention

Statement

Fix a finite token alphabet and a fixed soft-attention sequence model with L layers, H heads per layer, fixed query/key/value matrices, and positionwise maps that are globally Lipschitz. Assume the layer-zero input states use the additive convention yj(0)=vxj+pj, where vxj is the embedding of token xj and pj is the position-j embedding. Assume the token embeddings are bounded, the positional embeddings satisfy sup⁡i∥pi∥2<∞, and all model parameters are independent of the input length n. For two length-n inputs with the same end marker at position n and differing in only one token at a position i<n, there is a constant C<∞, depending only on these bounds, matrices, maps, L, and H, such that their final hidden states satisfy

∥yn(L)(x)−yn(L)(x′)∥2≤Cn.

If a fixed globally Lipschitz map followed by softmax converts the final hidden state to next-token probabilities, then another constant C′<∞ with the same allowed dependence satisfies ∥qn(x)−qn(x′)∥1≤C′/n. No bound is asserted when the changed symbol is the final end marker, or when the number of layers, matrices, or their norms vary with n.

Facts & Assumptions

Given: A fixed soft-attention model satisfying the additive layer-zero convention and bounds in the Statement, an input length n≥2, and two inputs differing only at position i<n.

[F1]

In each soft-attention head, the row attention weights are the softmax of the query-key scores, sum to one, and the head output is their weighted sum of value vectors (Hard and soft attention sequence models).

[A1]

The finite matrices, layer count, number of heads, embedding bounds, and global Lipschitz constants are fixed independently of n, as required in the Statement.

Proof

1.1givenF1A1induction

There are constants Bk<∞ such that ∥yj(k)∥2≤Bk for every position j, input length n, and input pair. At layer zero this follows from yj(0)=vxj+pj and the bounded token and positional embeddings. If it holds at layer k−1, each value vector has norm at most ∥Vk,h∥Bk−1 and each attention output is a convex combination of those values by [F1]; the fixed globally Lipschitz positionwise map is bounded on this resulting bounded set. Induction gives all Bk.

2.1step 1.1F1A1algebra

Consequently every dot-product score at every layer has absolute value at most some Ak<∞. For any row with n keys, its softmax weight aj is at most e2Ak/n, since its numerator is at most eAk and its denominator is at least ne−Ak.

3.1givenstep 1.1step 2.1A1algebra

We prove by induction on k that for constants Dk,Ek independent of n, the changed position satisfies ∥yi(k)−yi′(k)∥2≤Dk, while every j≠i satisfies ∥yj(k)−yj′(k)∥2≤Ek/n. This holds at k=0 because only the bounded token embedding at i changes. Assume it holds at k−1 and fix a query position j≠i and one head. Its query changes by O(1/n). Its key at position i can change by O(1), while all other keys change by O(1/n), using the fixed linear matrices and the induction hypothesis. Hence its score-difference vector Δ has ∣Δi∣≤K and ∣Δr∣≤K/n for r≠i, for a constant K independent of n.

4.1step 2.1step 3.1algebra

Interpolate the two score vectors linearly. All interpolated scores remain in [−Ak,Ak], so the distinguished key has softmax weight at most e2Ak/n throughout by step 2.1. For softmax probabilities ar(t), differentiation gives ar′(t)=ar(t)(Δr−∑sas(t)Δs); therefore ∑r∣ar′(t)∣≤2∑rar(t)∣Δr∣=O(1/n), and integration yields ∥a−a′∥1=O(1/n).

5.1step 1.1step 4.1A1algebra

The head values are uniformly bounded by step 1.1. Splitting the difference of the two weighted sums into (i) the change of values under the first attention row and (ii) the change of attention weights applied to the second value list gives ∥bj,k,h−bj,k,h′∥2=O(1/n): the changed value at i has weight O(1/n), all other value changes are O(1/n), and the total weight change is O(1/n) by step 4.1. The positionwise map is Lipschitz, so ∥yj(k)−yj′(k)∥2=O(1/n) for every j≠i. At j=i, boundedness from step 1.1 gives a constant difference. This proves the induction claim.

6.1step 5.1A1algebra∎

Since i<n, the induction bound gives ∥yn(L)−yn′(L)∥2≤EL/n. For a logit perturbation Δ, the softmax derivative is pr(Δr−∑spsΔs), whose ℓ1 norm is at most 2∥Δ∥∞≤2∥Δ∥2; hence the prediction probabilities differ by at most a constant times 1/n. Taking C=EL completes the hidden-state bound and supplies the stated probability bound.

Remarks

The proof includes the change in softmax attention weights caused by the changed key. This term is necessary because attention scores depend on the hidden states; it is bounded using the O(1/n) mass of the one changed key and the O(1/n) changes of the remaining logits.

Depends on

Used by

Dependency tree · two levels

3 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.

Sources