Thomas Piacentini
← Workshop

10 · LLMs from Scratch

LLMs from Scratch

Original text · English

Build, train, and understand large language models.

Start this phase on GitHub

Prerequisites: Phase 5 NLP Foundations. Phase 7 Transformers is strongly recommended before the model-building lessons.

First lesson: Tokenizers

Run this command from the repository root:

bash
python3 phases/10-llms-from-scratch/01-tokenizers/code/main.py

Keep the command, exit code, encode/decode round-trip results, learned merge count, and compression ratios. tiktoken is an optional comparison.

Next action: Add a word the tiny corpus has not seen, inspect its pieces, then continue to Building a Tokenizer from Scratch.

Browse the full Phase 10 lesson list or the cross-phase roadmap.

Continue step by step.

Code and artifacts 1
What you take away

Saved in your notebook on this device.

Sources and limits

Reading checkpoints are self-reported. Test results are recorded separately and apply to the executed cases.

AI Engineering from Scratch · 3f9715c · MIT

Download this file ↓