← Learning Portal

LLM From Scratch

A complete technical textbook covering everything from mathematical foundations to frontier model architectures, reinforcement learning, and beyond.

30
Chapters
1.8 MB
Content
~2000
Pages

Part I: Foundations

Mathematical prerequisites, neural network fundamentals, and the path to Transformers

Part II: Language Model Training

From raw text to pretrained language models

Companion Guide

A standalone walkthrough that keeps every major RL and RLHF quantity tied to one toy LLM answer tree

Part III: Reinforcement Learning & Alignment

From RL fundamentals to RLHF, DPO, and modern alignment techniques

Part IV: Model Families

The evolution of frontier LLMs from GPT to DeepSeek

Part V: Efficiency & Optimization

Making large models practical: attention, quantization, sparsity, and adaptation

Part VI: Advanced Capabilities

Multimodal understanding, reasoning, agents, and tool use

Part VII: Safety, Interpretability & the Future

Understanding, aligning, and evolving language models

Part VIII: Practice & Production

Data pipelines, inference systems, evaluation, prompt engineering, and synthetic data

Essays by the Author

Opinionated perspectives on the future of AI

Research Notes

Deep dives into open questions and emerging ideas