From text to a working model

Build an LLM from first principles

Follow small, executable examples until tensors, attention, training, and generation fit together as one Rust program.

Learn by running code

Every concept begins with a tiny Rust example and deterministic output.

Connect code to the formula

Symbols are introduced only when they explain the behavior you can observe.

See what came before

Each chapter contrasts the modern component with the historical approach it replaced.