Module deck
Evaluation and model adaptation flashcards
Reviewing needs JavaScript. You can read every card in the list below.
Loading your cards...
Back to the module21 cards in this deck
Read all 21 cards as a list
Evaluating LLM systems
- Front
- Why can't a public benchmark pick your model?
- Back
- Contamination, saturation and domain mismatch. Use benchmarks to shortlist; decide on your product eval.
- Front
- How do you validate an LLM judge before trusting it?
- Back
- Label a sample by humans, compute Cohen's kappa against the judge (not raw percent agreement), report the label balance, and re-check periodically.
- Front
- Why can high percent agreement between judge and humans mislead?
- Back
- When one label dominates, guessing it already agrees often. With 95% passes, chance agreement is about 0.905, so 90% observed is no better than chance. Use kappa and look at the rare class.
- Front
- What is the difference between a dev set and a held-out set?
- Back
- Iterate on the dev set. Use the held-out set only to gate releases. Tuning against it turns it into a second dev set and its score stops meaning anything.
- Front
- What should you do before choosing evaluation metrics?
- Back
- Error analysis: read 50 to 100 real failing traces, sort them into failure categories, and measure the top categories.
- Front
- Why is a +3 point gain on 100 cases weak evidence?
- Back
- Sampling noise: at a pass rate near 0.8, one score is uncertain by roughly 8 points either way (illustrative). Compare variants paired on the same cases, with a bootstrap interval, or add cases.
Fine-tuning vs RAG vs prompting
- Front
- When is fine-tuning the right choice over RAG?
- Back
- When you need consistent style, format or behaviour at scale, have labelled examples, and prompting has hit its limit. Not for injecting facts or current knowledge.
- Front
- Does fine-tuning fix hallucination?
- Back
- Not by itself. It does not supply correct facts, and one 2024 study found hallucination rose as new facts were absorbed. Training on correct refusals can improve abstention (R-Tuning, NAACL 2024). Facts still need grounding via RAG.
- Front
- What does each lever change: prompting, RAG, fine-tuning?
- Back
- Prompting changes the instructions. RAG changes the information in the prompt at answer time. Fine-tuning changes the weights, to teach a consistent pattern of behaviour.
- Front
- Three things fine-tuning does poorly compared with RAG?
- Back
- Keeping facts current (needs retraining), giving citations (no source passage), and per-user access control (weights are shared by every user).
- Front
- What must exist before you start a fine-tune?
- Back
- Labelled examples, a strong baseline (best prompt, plus RAG if facts matter), an eval with a held-out set, a reason prompting cannot meet, and a plan to retrain when the base model changes.
Fine-tuning methods: SFT, LoRA, QLoRA and DPO
- Front
- Explain LoRA in two sentences.
- Back
- Freeze the weights W and learn a low-rank update B x A (rank r much smaller than d), a tiny fraction of the parameters. Adapters are small, swappable and mergeable into W.
- Front
- RLHF vs DPO?
- Back
- RLHF trains a reward model then optimises with RL. DPO trains directly on preference pairs with a classification-style loss: no separate reward model or RL loop, though it still uses a frozen reference model.
- Front
- How many trainable weights does a rank-r LoRA adapter add to a d x d layer?
- Back
- 2 x d x r (A is r x d, B is d x r). For d = 4096, r = 8: 65,536, about 0.39% of the layer's 16.8 million weights.
- Front
- What does QLoRA add to LoRA?
- Back
- The frozen base is held in 4-bit (NF4) while adapters train in higher precision, with double quantisation and paged optimisers. It cuts memory a lot, with slower steps; check quality on your task.
- Front
- Which data does SFT use, and which does preference tuning use?
- Back
- SFT: prompt and ideal-response pairs. Preference tuning: a prompt with a preferred and a rejected response.
Fine-tuning data, risks and shipping
- Front
- A tuned model looks fine offline but worse in production. First suspect?
- Back
- A prompt-format mismatch: training used a different system prompt or chat template than production. Train on the exact serving format.
- Front
- Name four risks of fine-tuning.
- Back
- Forgetting (general abilities regress), overfitting (memorises training examples), safety regression (weaker safety behaviour, even with benign data) and leakage (training data overlaps your evals).
- Front
- What do you compare a fine-tuned model against before shipping?
- Back
- The base model with the best prompt, plus RAG if facts matter. If the tune does not clearly beat that baseline, stay with the baseline.
- Front
- What do you need in place so a bad adapter can be reversed quickly?
- Back
- Adapters versioned together with their data and hyperparameters, a canary release, and a rollback path to the previous adapter or the base model.
- Front
- What is decontamination and why does it matter?
- Back
- Removing training examples that overlap your eval data. If they overlap, the scores measure memorisation and mean little.