Series
LLMs, the whole thing
Working through large language models from the ground up — turning text into tokens, embeddings and the geometry of meaning, the transformer architecture, attention, how these models are trained, and what separates one generation from the next.
6 posts
·
45 min total
·
updated 18 Aug 2026
Part 1
Large Language Models, From the Ground Up - Part I: The Geometry of Meaning
The opening part of a series building LLMs from first principles. We start where every model starts: turning language into vectors and meaning into geometry, with a runnable script and its real numbers.
12 Aug 2026
·
9 min read
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
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
Part 4
The Sliding Window: How One Story Becomes Thousands of Training Examples
I printed my first training batch, saw shape [8, 4], and could not say what the two numbers counted. Untangling it - one short story sliced into 1,286 windows, grabbed 8 at a time - made the whole GPT input pipeline finally go transparent.
16 Aug 2026
·
6 min read
Part 5
The Lookup Table That Learns: Token Embeddings and the Order-Blind Trap
The finale of chapter 2: how meaningless token IDs become the tensor attention actually consumes. It comes down to two lookup tables and one addition - a learnable embedding table for meaning, and a second, position-indexed table for order.
16 Aug 2026
·
6 min read
Part 6
Self-attention, from scratch: a context vector is a weighted average
The first attention mechanism in Raschka's LLM book, explained the way it finally clicked for me, a Java dev who bounces off dense maths: self-attention is just three operations, a dot product, a softmax, and a weighted average.
18 Aug 2026
·
9 min read
Next in this series: Trainable self-attention: query, key and value — coming soon.