Small model · from scratch
From a folder of text to a model I can talk to
The whole experiment is one loop: prepare the right data, build a small prediction machine, watch it learn, then teach it the shape of a conversation.
The map
Six stops. Each one leaves a useful thing for the next.
-
01 · DEFINE
Pick one job
Write the test before the training.
-
02 · PREPARE
Curate licensed text
Clean, deduplicate, split, record rights.
-
03 · BUILD
Tokenizer + transformer
Choose the vocabulary and model shape.
-
04 · PRE-TRAIN
Predict the next token
Guess, score, adjust—many times.
-
05 · SHAPE
Fine-tune for chat
Imitate reviewed conversations.
-
06 · CHECK
Evaluate and repeat
Keep the best checkpoint; fix the weakest stage.
Two datasets teach two different lessons
License gate: permission to read something is not automatically permission to train on it or redistribute the result.
What I am actually building
A tokenizer turns text into pieces. A randomly initialized transformer repeatedly mixes those pieces and predicts what comes next.
BPE tokenizer: starts with tiny pieces, then joins common neighbors—such as train + ing. The model sees token IDs, not raw words.
One training step, drawn out
8 sequences × 256 tokens = 2,048 training tokens per step · 10,000 steps ≈ 20.5M token positions
The loss chart tells me when to keep going—and when to stop
Base model → useful chat model
Sample the base
Continue unfinished prose; do not expect chat yet.
Supervised fine-tune
Imitate role-labeled conversations in JSONL.
Optional preference pass
Learn from chosen vs. rejected answers.
Evaluate + iterate
Fixed prompts, held-out text, failure review.
- 01Goal + fixed testsdefine success first
- 02Rights + provenanceknow every source
- 03Frozen validation splitnever train on the exam
- 04Tiny pipeline testprove the loop works
- 05Record each rundata, settings, checkpoint
- 06Scale one thingdata, model, context, or time