LLMs, the whole thing
·
Part 11
Training GPT from Scratch: Loss, Learning, and the Next Token
Chapter 5 connects next-token loss to real parameter updates, then separates training from decoding. My notes on batches, perplexity, validation, sampling, checkpoints, and pretrained GPT-2 weights.
20 Sep 2026
·
6 min read
·85 views
LLMs, the whole thing
·
Part 10
Building GPT from Scratch: LayerNorm, GELU, Shortcuts, and the First Generated Token
Chapter 4 is the moment attention becomes a complete GPT. I build the model one inspectable component at a time, count its parameters, and trace the gloriously untrained first token.
13 Sep 2026
·
16 min read
·101 views
Maths for LLMs
GELU vs ReLU: The Smooth Gate Inside GPT
ReLU cuts every negative activation to zero. GELU computes a smooth tanh-shaped gate; I unpack the formula one real number at a time and place it inside GPT's feed-forward network.
12 Sep 2026
·
4 min read
·66 views
LLMs, the whole thing
·
Part 3
From Tokens to Token IDs
An LLM never sees your text — it sees integers. Building a tokenizer from a regex and a dictionary, hitting the out-of-vocabulary wall, and why GPT’s byte-pair encoding is the fix that needs no unknown token.
14 Aug 2026
·
8 min read
·153 views
LLMs, the whole thing
·
Part 2
The Transformer Architecture: Encoder versus Decoder
Every modern LLM is a transformer, yet BERT, GPT and T5 behave very differently. The first article in a ground-up series on LLMs: the single distinction — the attention mask — that separates an encoder from a decoder.
12 Aug 2026
·
7 min read
·172 views