Skip to content

Transformers

PART 7 — Transformers

The Transformer architecture wraps Attention in normalization and feed-forward networks (MLPs).

Data Flow Example (Decoder Block):

Input: [Token Vectors]
  ↓
LayerNorm (Standardizes the float ranges so math doesn't explode)
  ↓
Multi-Head Attention (Tokens share context with each other)
  ↓
Add Residual (Output = Original Input + Attention Output. Prevents data loss)
  ↓
LayerNorm
  ↓
MLP (Standard matrix multiplication where tokens process individually)
  ↓
Add Residual
  ↓
Output: [Context-Aware Token Vectors]