Causal Decoder Blocks Update Every Prefix Position
Two distinct pre-norm blocks preserve the model-width residual stream while applying causal attention at every depth. Track axes, masks, head and MLP widths, and the 156-parameter block count.
The position-aware records enter two decoder blocks. Each block uses the pre-norm equations established earlier:
For this model, every stream tensor has shape . The two attention heads each use width 2, and the MLP expands each token record from width 4 to 8 and contracts it to 4.
Causality Applies in Every Block
For , each head applies the inclusive lower-triangular visibility matrix
Applying the mask only in the first block is insufficient. A later unmasked block can create a future-to-past route even if earlier representations were causal.
Depth Changes Values, Not the Interface
Block 1 and Block 2 have the same input-output shape but different parameters. Write , , and rather than calling all three tensors “the embedding.” The token and position tables create ; subsequent records are contextual residual-stream states.
Count One Block from Its Declared Conventions
Attention has four matrices and no biases: 64 entries. The biased MLP has . Two LayerNorms each have gain and bias of length 4: 16. One block therefore has
learned entries, and two blocks have 312.
Q1. Track a decoder stack shape
For and , what is the residual-stream shape after the second block?
Answer it first, then check.