Contents

Foundation Model Engineering

Foundation Model Engineering

A free English and Korean textbook on training, serving, and evaluating foundation models, with browser experiments and CPU PyTorch labs.

Short reads

Model selection and cost

Explore the November 25 benchmark results in the comparison of 45 model profiles. Check how to access GLM-5.4, find the context limit in the public Ling-3.2-air checkpoint, or calculate what one extra input token can do to the GPT-6.2 Astra and Sol bill. Speech, image and video models have their own evaluation chapters.

Follow a learning path

Check your Python, linear algebra and probability prerequisites, then work through an optimizer update, a CPU training run and a release decision.

  1. Choose your learning pathDiagnose prerequisites and define evidence of mastery.
  2. Derive the training updateConnect likelihood, AdamW, token weighting and fair experiments.
  3. Train and challenge a decoderRun a CPU lab with causal checks, an ablation and exact resume.
  4. Defend an evaluation decisionCalculate paired uncertainty, retention gates and rare-event bounds.

Train a small decoder on a CPU

A decoder learns to repeat four symbols. On the held-out sequence 12 13 16 14, its first prediction is 7. Will the same error come back four steps later? Follow one prediction token by token, compare test losses with and without earlier tokens, or run it on Binder without an account. For local Jupyter, download the notebook.

About the book

Download LLM Serving in Practice (EPUB) to read three lessons offline. Revision 3 follows a measured KV cache from 990 to 1,350 KiB, shows when each request gets a turn, and traces the pause between streamed tokens. All 16 quizzes include answers.

Seongeun So maintains the book. The first Korean edition was translated from English with help from Gemini. Recent labs include code and measurements produced with Codex. Each lesson is revised in English first, with its code and worked examples updated in Korean in the same change. Browse all 108 lessons or bookmark the repository on GitHub. If an example behaves differently from the explanation, report the chapter and the inputs that reproduce it.

Last update

Table of Contents