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.
Position-free unmasked self-attention is permutation equivariant
Statement
Let be a sequence matrix whose rows are token representations, and let be any permutation matrix. Every finite composition of position-shared encoder layers built from unmasked multi-head self-attention, residual additions, rowwise layer normalization, and a shared positionwise feedforward map, with no positional encoding, satisfies
For a fixed attention mask , the corresponding layer satisfies . Hence every permutation that leaves a fixed mask unchanged is an equivariance of the corresponding layer. The standard causal mask for and for is preserved only by the identity permutation.
Statement references
Facts & Assumptions
Given: A sequence matrix , a permutation matrix , shared projections and positionwise maps, and—when a mask is present—a mask transformed together with the token indices.
Each multi-head self-attention head forms query, key, and value rows by applying the same matrices to every token; its output is scaled-dot-product attention followed by a shared output projection (Multi-head attention and self-attention).
Residual addition, rowwise layer normalization, and a positionwise feedforward map apply the same vector function at every position (Transformer encoder, decoder, and fixed-width expressivity blocks).
Proof
For one head, write , , and . On input , the projections are , , and . The unmasked score matrix therefore becomes .
Row softmax commutes with simultaneous row and column permutation: every row's logits are merely reordered, so its normalized entries are reordered by the same permutation. Thus ; multiplying by gives . Concatenation and the shared output projection preserve this identity, and so does the residual addition.
A shared positionwise map applies the same function to each row, hence maps to the permutation of its outputs. Rowwise layer normalization has the same property because each row's mean and variance are unchanged by reordering rows. Combining these identities with the attention and residual identity in step 2.1 shows that one encoder layer is equivariant; induction over the finite stack gives .
For a masked head, transforming the mask to gives the same score-and-weight calculation as steps 1.1–2.1, proving the stated mask identity. A permutation preserving the causal mask must preserve the relation on the finite chain ; its unique least element must map to itself, and then induction on the remaining ordered positions makes every position fixed. Therefore only the identity preserves the standard causal mask.
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?, Appendix A (standard reference, not scraped)
- Vaswani et al., Attention Is All You Need, §§3.1–3.2.3 (standard reference, not scraped)
- Dive into Deep Learning, §§11.6.1 and 11.7.1 (standard reference, not scraped)