Lesson deck
When to tune, and what it costs flashcards
Reviewing needs JavaScript. You can read every card in the list below.
Loading your cards...
Back to the lesson12 cards in this deck
Read all 12 cards as a list
- Front
- Retrieval or tuning: which fits a changing fact, and which fits a behaviour?
- Back
- Retrieval for what the model should know (current, citable, permissioned). Tuning for how it should behave (format, tone, routine, cost). Weights cannot cite a source or be edited by changing one document.
- Front
- Name three sound reasons to fine-tune.
- Back
- A format or routine that a strong prompt still gets wrong at volume; a small model matching a large one on a narrow task; a consistent tone or policy at scale. Also: baking in a long fixed prefix, or running an open model you host.
- Front
- What must a tuned model beat before it ships?
- Back
- The best prompt plus retrieval, on a held-out set, using the newest base model you could use. Beating a first-draft prompt proves little.
- Front
- Break-even for a tuning project?
- Back
- Payback = one-off cost (data, training, evaluation) ÷ (gross saving per day − hosting per day − maintenance per day). Maintenance is the re-tune cost spread over its interval.
- Front
- How can a cheaper alternative cancel a tune's saving?
- Back
- The baseline moves. If prefix caching already makes a repeated prefix cheap, baking it in can save at most what is still being paid, which may be less than the tuned model's hosting.
- Front
- What is the model treadmill?
- Back
- A tune is tied to one base model, and bases improve every few months. Budget for re-tuning, and re-run the prompt and retrieval baseline on the newest base before re-investing.
- Front
- Bytes per parameter for full fine-tuning with Adam in mixed precision?
- Back
- About 16: 2 (16-bit weights) + 2 (gradients) + 12 (32-bit master copy, momentum and variance at 4 each). This is model states only.
- Front
- Why do LoRA and QLoRA need so much less memory?
- Back
- The base is frozen, so it needs no gradients or optimiser state, only storage: 2 bytes per parameter in 16-bit, about 0.5 in 4-bit. Only the small adapter pays the 16 bytes.
- Front
- What does a model-state memory estimate leave out?
- Back
- Activations (grow with batch and sequence length), the logits tensor (tokens × vocabulary × bytes), framework overhead and 4-bit quantisation constants. Treat the estimate as a floor.
- Front
- Training compute for a dense model?
- Back
- About 6 × N × D FLOPs: roughly 2 forward plus 4 backward per parameter per token. Time = FLOPs ÷ sustained FLOP/s. N is approximately non-embedding parameters.
- Front
- How much compute does LoRA save?
- Back
- About a third: frozen layers skip weight gradients but still compute the gradients that reach the adapters, so roughly 4ND instead of 6ND. The big saving is memory.
- Front
- Why not divide by a vendor's headline teraFLOPS to get training time?
- Back
- Headline figures can be marked 'with sparsity' and are peaks. Use the rate your job sustains, or an assumed round figure that you state. The share of peak reached is model FLOPs utilisation.