Alphabeta Math
DefinitionDefinition: Literature-sourcedProof: Not applicablePipeline-generated
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 d,dff,n,m, where d is the model width, dff is the feedforward hidden width, and n,m are the encoder and decoder sequence lengths. A row-token matrix X∈Rn×d has one token in each row. Define ReLU⁡(t)=max⁡(0,t) and apply it coordinatewise to vectors and matrices. A positionwise feedforward network with parameters W1∈Rd×dff, b1∈Rdff, W2∈Rdff×d, and b2∈Rd maps each row x to ReLU⁡(xW1+b1)W2+b2, using the same parameters at every position. For z∈Rd, let zˉ=d−1∑r=1dzr and s2(z)=d−1∑r=1d(zr−zˉ)2. Layer normalization with parameters γ,β∈Rd and ϵ>0 is

LN⁡γ,β,ϵ(z)=γ⊙z−zˉ1s2(z)+ϵ+β,

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 dq=dk=dv=do=d in def-multihead-self-attention, with its own projection parameters. The head count h and head widths dh,dvh remain arbitrary positive integers, and the output projection has shape WO∈Rhdvh×d. 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

S=LN⁡γ1,β1,ϵ1 ⁣(X+MHA⁡(X,X,X)),Y=LN⁡γ2,β2,ϵ2 ⁣(S+FFN⁡(S)).

A post-normalized decoder layer takes decoder states U∈Rm×d and encoder states E∈Rn×d. It first applies masked self-attention to U using the causal mask, then cross-attention with queries from the resulting decoder states and keys and values from E, 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 j≤i for query position i. 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 E supplies the key and value rows for decoder cross-attention. The diagram illustrates the definition and is not used in any proof.

XMHAself-attnAdd&LNPositionwiseFFNAdd&LNEncoderoutputEUCausalself-attnAdd&LNCross-attntoEAdd&LNPositionwiseFFNAdd&LN

The fixed-width expressivity result uses a different, explicitly defined block without layer normalization. In the column-token convention X∈Rd×n, one Yun attention sublayer with two heads of size one is

Attn⁡Y(X)=X+∑i=12WOiWViX softmax⁡col ⁣((WKiX)T(WQiX+bQi1nT)),

where WQi,WKi,WVi∈R1×d, WOi∈Rd×1, and bQi∈R is a shared scalar query bias; softmax⁡col normalizes each column over its key positions. Its tokenwise feedforward sublayer is

FF⁡Y(Z)=Z+W2ReLU⁡(W1Z+b11nT)+b21nT,

with W1∈R4×d and W2∈Rd×4. A Yun block is FF⁡Y∘Attn⁡Y, and T2,1,4 is the set of all finite compositions of such blocks. Its positional class consists of maps X↦g(X+E) with g∈T2,1,4 and a trainable E∈Rd×n. This expressivity block has no layer normalization; its widths and head sizes are exactly as displayed.

Depends on

Used by

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