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.
Two-head fixed-width Transformers implement finite-grid lookups
Statement
Let , , be integers, set and , and assume . Define Let consist of those whose columns are pairwise distinct. For column-token matrices , consider finite compositions of residual attention updates and residual tokenwise updates
where all displayed vectors and scalars are fixed across columns, assigns equal weights to all maximizing entries in each column, and each scalar is piecewise affine on at most three intervals with at least one constant piece. If satisfies for every column-permutation matrix , then such a composition maps each to and each to .
There is also a position-tagged version. For each , let where the th factor specifies column . For every function , with no permutation condition, a finite composition of the same updates maps each to .
Statement references
Facts & Assumptions
Given: The integer grids and finite tables in the Statement.
The Yun expressivity block has two heads of size one, shared query/key/value and output maps, a shared scalar query bias, residual attention, and a tokenwise ReLU feedforward sublayer of width four; it has no layer normalization (Transformer encoder, decoder, and fixed-width expressivity blocks).
Every finite composition of the unmasked Yun attention and shared tokenwise maps is permutation equivariant (Position-free unmasked self-attention is permutation equivariant).
Positional encodings are added columnwise to the token matrix before the position-aware stack (Positional encodings and causal masks).
Proof
For the unpositioned equivariance used below, let be any column-permutation matrix. In a shared Yun head, and the query and key projections transform the same way, so its score matrix satisfies . Equal-weight hardmax acts columnwise and commutes with row and column permutations, giving . Multiplication by the permuted value row then gives the permuted attention output, and residual addition preserves this identity. A shared tokenwise update also commutes with column permutations because and its coordinatewise activation is applied identically in every column. Thus every modified Yun attention or tokenwise update, and every finite composition of them, is permutation equivariant. This is the unnormalized, hardmax version of the supplier calculation in [thm-transformer-permutation-equivariance-without-position].
Put . For a grid column , where , its scalar code is Thus the valid column codes are distinct multiples of in , where . If a column has a sentinel coordinate , the sum of all its other coordinate contributions is at most , so its code is at most .
For a scalar threshold , the single-head update is an allowed attention update contribution: its key and value projections are , its query projection is with bias , and its output vector is . In query column , if it returns the largest current scalar code, and if it returns the smallest. If , all query scores are zero and equal-weight hardmax returns the mean . Thus, writing and , the contribution for is in the first coordinate when , when , when , and zero when or . In particular, if no current code equals either threshold, it shifts exactly the columns strictly between them by .
Sweep the valid scalar codes in increasing order, using the two-head update at code . All initial codes, including sentinel codes, are multiples of : every grid coordinate lies in and every entry of is an integer. Since is an integer, each strict selective shift preserves this lattice; inductively no current code can equal any half-grid threshold . This also applies to duplicate-column inputs and to the position-tagged lattice. For , order its distinct column codes as . The first sweep shifts only to , since and . Each later sweep shifts the next unmodified code and gives Thus shifted columns leave all later threshold intervals, and the final scalar codes satisfy .
Write . Unrolling the recurrence in step 2.1 gives Consequently The lower bound follows from the term; the upper bound follows from and . The map is injective: if two ordered tuples give the same , put , so . The difference equation is Reduction modulo first gives ; division by and repeated reduction modulo then gives . Hence distinct unordered column multisets have distinct values, separated by at least .
Apply one final single-head update , with a positive integer . For valid , all , so it adds to every first coordinate and changes the scalar codes to For different column multisets, their values differ by at least , while . Choose so that over the finite valid grid. The intervals for different multisets are disjoint, and codes within one multiset are distinct by step 2.1. All resulting codes are multiples of , hence distinct codes are at least apart.
If has duplicate columns but no sentinel, its scalar codes have only distinct levels. The same sweep shifts these levels, and its largest value is at most , strictly below the lower bound for valid in step 3.1. A sentinel column has a negative code by step 1.1 and remains the minimum throughout the sweep. If all codes are negative, the final update in step 4.1 shifts every code further negative. If some codes are nonnegative, the first nonnegative code is shifted by at least ; the later positive codes are shifted by still larger amounts. This exceeds every valid in step 3.1. Thus, after the final update, each invalid scalar code has one of three forms: below every valid code, above every valid code, or negative. Since there are finitely many grid inputs and all codes are multiples of , choose large enough that every invalid code lies at least outside the interval from the least to the greatest valid code.
The preceding construction gives a finite scalar code for each token of each valid context; these codes are all distinct, and column permutations carry each code and its token to the corresponding permuted token by [F2]. Let and be the least and greatest valid codes. Because the table and grid are finite, enlarge so that for every valid . A three-piece constant activation that is zero on and one outside this interval detects exactly the invalid codes. Subtracting a constant larger than the maximum absolute coordinate of every encoded grid state makes every invalid state strictly negative; for each coordinate , the allowed residual update replaces that coordinate by . These updates send every invalid state to zero and leave every valid, coordinatewise nonnegative state unchanged. For each valid code , a three-piece pulse equal to one on and zero outside, applied to , selects exactly its token. Add the vector at that token. The updated token has scalar value below every code, so later pulses cannot select it; the remaining tokens retain their codes until selected. Equivariance of makes each update correct for every permutation of . This yields on and zero on every other point of .
For the position-tagged grid, the scalar code of column has the form Since , codes in a matrix satisfy and each individual code identifies its column vector. Choose an integer with . Sweep all possible position-tagged scalar codes in increasing order, replacing the shift multiplier in step 2.1 by . All codes remain in , so none equals a half-grid threshold. Since distinct initial codes differ by at least , the first shifted code exceeds the largest possible initial code, and each subsequent shifted code exceeds its predecessor. Thus the recurrence of step 2.1 holds with in place of , and different matrices give different ordered tuples . The divisibility argument in step 3.1 applies modulo : for each fixed position, the offsets cancel and the difference of two values divided by has magnitude at most . Thus the final maxima distinguish all position-tagged matrices, and the codes distinguish every token in every matrix when . Choose still larger so these positive codes exceed all finitely many target values . The pulse layers of step 6.1 then implement the arbitrary table ; no permutation condition is needed because the position offsets distinguish columns.
Each update used above is either a two-head attention update, a single-head attention update with the second head set to zero, or a tokenwise scalar piecewise-affine update; an unused attention or feedforward sublayer is made the identity by setting its output weights to zero. Therefore the finite constructions are compositions of the modified Yun blocks specified in the Statement, proving both lookup assertions.
Depends on
Used by
Dependency tree · two levels
5 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
- Yun et al., Are Transformers Universal Approximators of Sequence-to-Sequence Functions?, Appendices B.4–B.6 (standard reference, not scraped)
- Yun et al., Are Transformers Universal Approximators of Sequence-to-Sequence Functions?, Appendix C.1–C.3 (standard reference, not scraped)