Transformers & LLMs
Build a real understanding of the transformer architecture, then train and fine-tune LLMs — theory and practice.
Chapter 01
The Transformer Architecture
- The Big Picture: What a Transformer DoesComing soon
- Tokenization: Text → IntegersComing soon
- Embeddings: Tokens → VectorsComing soon
- Positional Information: Order MattersComing soon
- Attention I: Query, Key, ValueComing soon
- Attention II: Scale, Mask, Softmax → WeightsComing soon
- Multi-Head AttentionComing soon
- The Feed-Forward Network (MLP)Coming soon
- Residual Connections & NormalizationComing soon
- The Full Transformer BlockComing soon
- The Output Head: Logits → Next TokenComing soon
- Putting It Together: A Forward Pass, End to EndComing soon
- Chapter examComing soon
Chapter 02
Building & Training a Small LLM
- Next-Token Prediction as ClassificationComing soon
- The Data Pipeline: Text → BatchesComing soon
- Backprop Through the TransformerComing soon
- The Optimizer: AdamW in PracticeComing soon
- Initialization & Numerical StabilityComing soon
- The Training LoopComing soon
- Watching a Model LearnComing soon
- Sampling & Generation RevisitedComing soon
- Scaling Laws: Predicting Loss Before You TrainComing soon
- Capstone: Your Tiny LLMComing soon
- Chapter examComing soon
Chapter 03
Fine-Tuning
- Why Fine-Tune?Coming soon
- Full Fine-TuningComing soon
- PEFT: The IdeaComing soon
- LoRA: Low-Rank AdaptationComing soon
- QLoRA & Quantization (intro)Coming soon
- Instruction Tuning & Chat TemplatesComing soon
- Preference Data & Reward ModelingComing soon
- RLHF, DPO & GRPO in PracticeComing soon
- Fine-Tuning Gemma / Qwen (capstone)Coming soon
- Evaluation: Did It Work?Coming soon
- Chapter examComing soon
Chapter 04
Modern Architectures
- RoPE: Rotary Position EmbeddingsComing soon
- Grouped-Query & Multi-Query AttentionComing soon
- The KV Cache & InferenceComing soon
- FlashAttentionComing soon
- Mixture of ExpertsComing soon
- DeepSeek MLA: Low-Rank KV CompressionComing soon
- Multi-Token PredictionComing soon
- Quantization: int8, int4, and BeyondComing soon
- State Space Models & MambaComing soon
- Speculative DecodingComing soon
- The Modern Stack AssembledComing soon
- Chapter examComing soon