Loading lesson…
Level 1 · Apprentice0 XP
Transformer blocks with residuals and LayerNorm, positions and weight tying.
Step 1 / 6
ProblemStacking attention layers trains badly and slowly. GPT adds a feed-forward network, residual connections and normalisation around every attention layer, and position information at the input.
← → step
Before this: Self-attention from scratch
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Build the GPT class, count its parameters, and check them against 12 × n_layer × n_embd² plus embeddings. Then change the config to GPT-2 small (12, 12, 768, vocab 50,257) and confirm about 124M parameters.