AI & ML

Transformers

Part of Deep Learning, level 4. About 13 hours of study across the topics below.

Create free account

Token RepresentationPosition InformationPositional Encoding Schemes and RoPEThe Attention BlockThe Feed-Forward BlockResidual Pathways and NormalizationModern Transformer Block DesignMixture-of-Experts LayersEncoder and Decoder ConceptsThe Causal TransformerReading a TransformerEncoder-Decoder TransformersEncoder-Only Models and Masked Language Modeling

1Representations

  1. Token RepresentationWhat a token vector carries into the stack: identity, and everything added later. 1–2 h
  2. Position InformationOrder without recurrence: how position encodings tell the stack where tokens sit. 1–2 h
  3. Positional Encoding Schemes and RoPEAbsolute, learned, relative, and rotary encodings: how position enters attention scores. 1–2 h

2Blocks

  1. The Attention BlockAttention plus the plumbing around it: residual stream, norms, and sublayer order. 1–2 h
  2. The Feed-Forward BlockA per-position MLP inside every block: capacity and memory roles. 1–2 h
  3. Residual Pathways and NormalizationGradient highways through deep stacks: skips and norms as stability engineering. 1–2 h
  4. Modern Transformer Block DesignThe design choices that became standard: pre-norm, RMSNorm, gated feed-forward units, and grouped-query attention. 1–2 h
  5. Mixture-of-Experts LayersRouting each token to a few expert feed-forward networks: more parameters without more compute per token. 1–2 h

3Architectures

  1. Encoder and Decoder ConceptsBidirectional readers vs causal writers: the two stack roles and their masks. 1–2 h
  2. The Causal TransformerThe full autoregressive stack: blocks, masks, and information flow end to end. 1–2 h
  3. Reading a TransformerOne token's journey, end to end: the synthesis walk through the whole stack. 1–2 h
  4. Encoder-Decoder TransformersThe original transformer layout: an encoder stack read by a decoder through cross-attention, as in T5. 1–2 h
  5. Encoder-Only Models and Masked Language ModelingBERT-style bidirectional pretraining: predict masked tokens, then reuse the representations. 1–2 h