Lessons
- 1TokenisationBPE and SentencePiece, and why an Arabic sentence costs more tokens.
- 2EmbeddingsMeaning as a vector and cosine similarity by hand, and where it misleads.
- 3AttentionQuery, key and value computed on paper for a four word sentence, then in code.
- 4The transformer blockMulti-head attention, layer norm, residuals and the feed-forward, together.
- 5PositionWhy a transformer needs order, and RoPE as today's common answer.
- 6PretrainingNext token prediction, and how ability emerges from so naive an objective.
- 7Build a small transformerFrom zero in PyTorch, a million parameters, ready for Arabic text.
- 8Project: a transformer on an Arabic bookTrain it on one book and generate text. It will be bad, and that is the proof.