A trained model isn't a product. A product needs a cheap way to specialize it, a cheap way to steer it per request, and a cheap way to actually serve it. This part built exactly those three things, separately. Wire them together, and that's a shipped assistant.
One backbone, fine-tuned once via LoRA (short for Low-Rank Adaptation). Two different system prompts, applied at request time with no retraining at all. The same underlying model, two different jobs.
Three mechanisms, three chapters, one pipeline:
- — the frozen pretrained backbone weight matrix.
- , — the LoRA low-rank factors whose product forms the fine-tuning update to .
- — the model's predicted output for a request's query .
- — the query for a given request.
- — the weight assigned to demonstration for this query, from the prompting mechanism.
- — the output demonstrated for example in the request's prompt.
- Fine-tune once, offline
The backbone is fine-tuned exactly once, offline, via LoRA.
- Steer per request, with no retraining
Every request reuses that same frozen backbone, steered only by whatever system prompt accompanies it.
- Serve cheaply, without shrinking the model
Serving many such requests stays cheap because each individual generation reuses its own cached attention via a KV cache (short for Key-Value cache), not because the model got any smaller.
Half the trainable parameters to reach the backbone. Two completely different behaviors from one frozen backbone, chosen purely by prompt. Fifty times less total serving work across a batch of requests. None of these three numbers depends on the other two — that's what makes them composable into one pipeline instead of one monolithic system.
Fine-tune once, prompt per request, serve 50 requests of 100 tokens each:
- Fine-tune the backbone with LoRA, once
The rank-1 update converges to loss using trainable parameters instead of — the exact result verified in this part's first chapter, unchanged here.
- Steer behavior per request with a system prompt
The same frozen backbone, for a query of :
- Prompted with "double" demonstrations, answers
- Prompted with "negate" demonstrations instead, the identical backbone answers
No retraining, no change to a single weight.
- Serve both, cheaply
requests at tokens each cost:
- units of attention work without a KV cache
- Just with one
A reduction, applied identically regardless of which prompt each request used.
Find the system prompt that makes the shipped assistant answer with a negative number.
None of these three mechanisms is new in this chapter — every number here was already verified, separately, in the three chapters that came before it. What's new is only the composition: a specialization step that happens once, a steering step that happens per request with no retraining, and a serving step that makes many such requests affordable. That gap — between a model that works in one demo and a model that can actually serve real traffic — is most of what "modern LLM engineering" means in practice. This closes Part XIII — Modern LLM Engineering, and with it, the full expansion of this course: forty-three chapters across reinforcement learning, classical ML, model evaluation, advanced architectures, explainability, multimodal systems, and the engineering that ships all of it.