Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

LLM & AI Applications

A working textbook on large language models and the applications built on top of them — from why self-attention works, through how a model is aligned with reinforcement learning, to how you assemble a retrieval pipeline or an agent and prove that it works.

What this section is for

Most interview material stops at the definition. That is not enough. An interviewer who knows the field will immediately ask why — and the answer to “why” is almost always a constraint: a memory limit, a gradient problem, a failure that showed up in production. This section is written so that every topic lands on:

  1. Why it exists — the problem it solves, and what breaks without it.
  2. How it works — the mechanism, with the math.
  3. How you would build it — runnable code, and the knobs that matter.
  4. What it costs — memory, compute, latency, quality, with numbers.
  5. How it fails — the pitfalls, and the symptom of each.
  6. When not to use it — the decision framing that matters more than the definition.

How to use it

If you have an interview in a few days. Read the TL;DR block at the top of each chapter, then the Interview drill at the bottom. Then work the Question Index, which collects all 255 drill questions in one place, so you can see at a glance which ones you cannot answer.

If you are preparing properly. Work the chapters in order — later material assumes earlier material. Part 03 (alignment and RL) in particular is not readable without SFT, and it builds the policy/value vocabulary it needs in its own first three chapters rather than assuming it from Part 01.

If you are building something. Jump straight to the part you need — 05 for agents, 06 for RAG, 07 for applications — and read the Using it in a project section of each chapter first.

A note on numbers

Every concrete figure in this section is either derived (a calculation you can check), cited (from a paper or official doc, with a link) or labelled (example). Nothing is written as if it were a measured result from a project that does not exist. When you have your own numbers, replace the examples — that is the point of labelling them.

Contents

Part 01 — Foundations

How the model is built.

Part 02 — Pretraining and Fine-Tuning

How it is trained.

Part 03 — Alignment and Reinforcement Learning

How it is made to behave.

Part 04 — Inference and Serving

How it is run.

Part 05 — Agents

How it is used to do things.

Part 06 — Retrieval-Augmented Generation

How it is grounded in facts.

Part 07 — Applications

What you actually ship.

Part 08 — Handwritten Code

What you write on a whiteboard.

Part 09 — Interview

How to deploy all of the above.


Status. Complete. All 39 leaf chapters across Parts 01–09 are written, each to the same eight-section template, and every relative link resolves. Research notes for the material live in docs/research/; the writing rules are in docs/AUTHORING.md.