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.
Transformer encoder, decoder, and fixed-width expressivity blocks
Definition
Fix positive integers , where is the model width, is the feedforward hidden width, and are the encoder and decoder sequence lengths. A row-token matrix has one token in each row. Define and apply it coordinatewise to vectors and matrices. A positionwise feedforward network with parameters , , , and maps each row to , using the same parameters at every position. For , let and . Layer normalization with parameters and is
applied rowwise; is coordinatewise multiplication. The positive makes the denominator nonzero.
Every multi-head attention sublayer in the following post-normalized encoder and decoder layers has query, key, value, and output feature widths in def-multihead-self-attention, with its own projection parameters. The head count and head widths remain arbitrary positive integers, and the output projection has shape . Thus each attention output has the same row count and feature width as its residual input. Any attention mask must leave at least one allowed key in every query row; positive key length supplies this for unmasked attention, and the decoder causal mask supplies it through its diagonal.
A post-normalized encoder layer is the composition
A post-normalized decoder layer takes decoder states and encoder states . It first applies masked self-attention to using the causal mask, then cross-attention with queries from the resulting decoder states and keys and values from , and then a positionwise feedforward network; each sublayer output is added to its own input and followed by layer normalization. The decoder's causal mask admits keys at positions for query position . Encoder and decoder stacks are finite compositions of their respective layers, with positional encodings added to token embeddings before the stacks.
The diagram records the dataflow and residual branches of one encoder layer and one decoder layer. Each arrow is a tensor passed to the indicated sublayer; each “Add & LN” node adds its sublayer input to its output and applies the stated rowwise layer normalization. The encoder output supplies the key and value rows for decoder cross-attention. The diagram illustrates the definition and is not used in any proof.
The fixed-width expressivity result uses a different, explicitly defined block without layer normalization. In the column-token convention , one Yun attention sublayer with two heads of size one is
where , , and is a shared scalar query bias; normalizes each column over its key positions. Its tokenwise feedforward sublayer is
with and . A Yun block is , and is the set of all finite compositions of such blocks. Its positional class consists of maps with and a trainable . This expressivity block has no layer normalization; its widths and head sizes are exactly as displayed.
Definition references
Multi-head attention and self-attention
Vaswani et al., §3.1: encoder and decoder residual sublayers and post-normalization
Vaswani et al., §§3.2.3 and 3.3: causal masks and shared positionwise ReLU feedforward maps
Yun et al., §2: the width-4, two-head, head-size-one block without layer normalization
Dive into Deep Learning, §§11.7.1–11.7.5: encoder, decoder, residual, and positionwise sublayers
Multi-head attention and self-attention: projected query, key, and value heads and featurewise concatenation.
Positional encodings and causal masks: rowwise positional addition and the lower-triangular decoder mask.
Finite feedforward computation graphs and layered MLPs: finite feedforward computation graphs and layered MLP evaluation.
Depends on
Used by
- Transformer encoder-decoder forward pass Algorithm
- An observed-range language-model scaling fit Example
- Two-head fixed-width Transformers implement finite-grid lookups Lemma
- Fixed-width Transformer approximation on compact domains Theorem
- Position-free unmasked self-attention is permutation equivariant Theorem
Dependency tree · two levels
4 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
- Vaswani et al., Attention Is All You Need, §§3.1–3.5 (standard reference, not scraped)
- Yun et al., Are Transformers Universal Approximators of Sequence-to-Sequence Functions?, §2 (standard reference, not scraped)
- Dive into Deep Learning, §§11.7.1–11.7.5 (standard reference, not scraped)