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
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. 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.