Skip to content

Chapter 4 · GPT Model

Chapter 4 assembles the pieces — normalization, feed-forward, and attention — into a transformer block, then stacks blocks into the full GPT.

  1. LayerNorm & GELU feed-forward
  2. The transformer block
  3. The full GPT model
  • @node-llm/core → src/model/block.ts, src/model/gpt.ts (GPT_CONFIG_124M)
  • Runnable: pnpm ch04