LLM Evaluation
Measuring whether an LLM-based system actually works, given that outputs are open-ended and hard to score automatically.
Try answering in your head first, then click a question to check the model answer.
Q1.Why is evaluating an LLM-based system fundamentally different from evaluating a classifier with clear ground-truth labels?(show answer)
Classifiers have a single correct label to check predictions against, giving an unambiguous accuracy metric. LLM outputs are open-ended free text where multiple different responses can be equally valid, so "correctness" itself requires a judgment call — via reference comparison, a rubric, an LLM-judge, or human review — rather than a simple equality check.
Q2.Explain BLEU/ROUGE and why they correlate only loosely with human judgments of quality.(show answer)
BLEU and ROUGE measure n-gram or word overlap between generated text and one or more reference texts. Because they reward surface-level textual overlap rather than semantic correctness or quality, a generated response can be semantically excellent but score poorly if phrased differently from the reference, or score well while being subtly wrong if it happens to reuse reference wording.
Q3.Describe LLM-as-judge evaluation and its main known biases.(show answer)
A typically stronger or differently trained LLM scores or compares responses against a rubric. Known biases include favoring longer or more confident-sounding responses, positional bias in pairwise comparisons (favoring whichever response is presented first or second), and self-preference bias if the judge shares training lineage or style with the model being evaluated.
Q4.Why is it risky to use the same model to both generate answers and evaluate them?(show answer)
The judge may systematically prefer outputs that match its own generation style and quirks, since it's essentially judging by "does this look like what I'd produce." This inflates scores for the generating model's own patterns rather than reflecting true quality — a different, ideally stronger, model is generally preferred as judge to reduce this self-preference bias.
Q5.Explain the difference between faithfulness and answer relevance as RAG-specific evaluation dimensions.(show answer)
Faithfulness checks whether the answer's claims are actually supported by the retrieved context, not fabricated or extrapolated beyond it. Answer relevance checks whether the answer actually addresses the user's question. An answer can be perfectly faithful to context yet fail to actually answer what was asked, or vice versa, so both need to be measured separately.
Q6.Why does a held-out, representative test set matter more than the specific metric chosen?(show answer)
Even a well-designed metric produces a misleading, falsely confident signal if it's computed over unrepresentative examples, such as easy hand-picked cases that don't reflect real usage. The test set's representativeness determines whether a good score actually predicts real-world performance, which no amount of metric sophistication can fix on its own.
Q7.Describe how you'd design a golden dataset for evaluating a customer-support LLM assistant.(show answer)
Sample real or realistic representative user queries spanning common and edge cases, pair each with an expected or ideal response or a set of acceptable criteria written or reviewed by domain experts, and periodically refresh it to reflect evolving product or support scenarios so it doesn't go stale relative to actual usage.
Q8.What is pairwise comparison evaluation, and why might it be more reliable than absolute scoring for subjective quality?(show answer)
Two candidate responses are shown side by side and a judge, human or LLM, picks the better one, rather than independently scoring each on an absolute scale. Relative judgments ("which is better") tend to be more consistent and reliable than absolute scores ("rate this 1-10"), since absolute scales are prone to drifting calibration across different raters or sessions.
Q9.Explain red-teaming as an evaluation practice, and give an example of what it might surface.(show answer)
Red-teaming deliberately crafts adversarial inputs designed to elicit undesired behavior — harmful content, jailbreaks, policy violations, leaking system prompts — to proactively find failure modes before real users or bad actors do. For example, it might find that a rephrased or obfuscated harmful request bypasses a safety filter that catches the direct phrasing.
Q10.Why is regression testing important when iterating on prompts or swapping models in production?(show answer)
A prompt tweak or model upgrade intended to fix one issue can silently break previously-working behavior elsewhere. Re-running a fixed, comprehensive evaluation set after every change catches such regressions before they reach users, rather than relying on spot-checking only the specific case that motivated the change.
Q11.Why might a strong score on a general benchmark like MMLU not predict good performance on a specific production application?(show answer)
General benchmarks test broad academic or knowledge coverage across many domains in a fixed format, which may not resemble the actual domain, task structure, or input distribution of a specific application. A model can excel at broad benchmarks while still performing poorly on a narrow, differently-formatted real task it wasn't specifically evaluated against.
Q12.What is calibration, and why does it matter for an LLM used in a decision-support context?(show answer)
Calibration is whether a model's expressed confidence matches its actual accuracy — among answers it states with 90% confidence, roughly 90% should actually be correct. In decision-support contexts, poor calibration is dangerous because users may over-trust confidently-stated wrong answers or under-trust correct hedged ones, undermining the value of confidence signals entirely.
Q13.Describe a process for validating an LLM-as-judge before relying on it at scale.(show answer)
Collect a sample of responses, have humans independently rate them against the same rubric the judge will use, then compare the judge's scores or rankings to the human ratings, such as agreement rate or correlation. Only adopt the judge for large-scale evaluation once it shows sufficiently strong agreement with human judgment on this validation sample, and periodically re-check as the model or task evolves.
Q14.Why are task-specific grounded metrics (like retrieval precision/recall for RAG) useful beyond generic quality metrics?(show answer)
They isolate which part of a compound system is failing — a low answer-quality score alone doesn't say whether the problem is retrieval (wrong or missing chunks) or generation (the model ignoring good context). Grounded, component-specific metrics let you diagnose and fix the actual failing stage rather than guessing.
Q15.What is the danger of shipping prompt/model changes based purely on "the demo looks better" without a formal evaluation set?(show answer)
A demo is typically a handful of hand-picked or lucky examples, which doesn't reveal how the change performs across the full distribution of real inputs. A change can look impressive in a demo while introducing regressions or failing on common but less flashy cases that were never checked, giving false confidence in the change.
Q16.How would you design an evaluation pipeline for hallucination detection specifically?(show answer)
For each generated claim, check whether it's supported by a trusted reference — retrieved context, a knowledge base, or ground truth — using either an NLI/entailment-style automated check or an LLM-judge prompted specifically to verify claim-by-claim support, flagging any unsupported claim as a potential hallucination rather than scoring the answer only holistically.
Q17.Explain why A/B testing in production complements, rather than replaces, offline evaluation.(show answer)
Offline evaluation is fast, repeatable, and catches regressions before deployment, but it can't fully capture real user behavior, satisfaction, or downstream business metrics. A/B testing measures actual impact on real users and traffic, catching effects offline metrics might miss or get wrong, while still needing offline evaluation as a cheaper first gate before committing to a live experiment.
Q18.What's a good approach to writing rubric criteria for an LLM-as-judge evaluating customer support responses?(show answer)
Break "quality" into concrete, separately-scoreable dimensions — factual accuracy, tone appropriateness, whether it fully answers the question, policy compliance — rather than one vague "rate this response" prompt. Specific criteria are both easier for the judge to apply consistently and easier to validate against human agreement per-dimension.
Q19.Why is human evaluation typically reserved for validating automated metrics and high-stakes launches rather than every iteration?(show answer)
Human evaluation is slow and expensive relative to automated or LLM-judge scoring, making it impractical to run on every prompt tweak or frequent iteration. It's instead used strategically — to validate that cheaper automated signals track real quality, and for critical launch decisions where the cost is justified by the stakes.
Q20.Describe a scenario where retrieval precision is high but overall RAG answer quality is still poor, and what that implies for where to focus improvement.(show answer)
Retrieved chunks are all genuinely relevant (high precision) but the LLM still produces a poor answer — for example, misreading the context, failing to synthesize across multiple relevant chunks, or ignoring context in favor of its own prior knowledge. This implies the fix belongs in generation (prompting, context formatting, or model choice), not retrieval, since retrieval is already doing its job.
Q21.Why might an evaluation metric that looked reliable months ago need to be revisited over time?(show answer)
Production input distributions, model versions, and user behavior can drift over time, so a metric or an LLM-judge validated against human judgment on an earlier sample may no longer track quality as reliably on newer traffic or tasks. Periodic re-validation catches this drift before decisions are made on a stale, no-longer-trustworthy signal.
Q22.What's an example of a metric that's easy to compute but a poor proxy for what actually matters to users?(show answer)
Response length or fluency scores are easy to compute automatically but don't measure whether the response is actually correct, helpful, or relevant. Optimizing for such easy-to-compute proxies without checking they correlate with real user satisfaction risks improving the metric while the actual user experience stays flat or worsens.
Q23.Explain positional bias in pairwise LLM-as-judge evaluation and how you'd mitigate it.(show answer)
The judge may systematically favor whichever response appears first or second in the prompt, regardless of actual quality. Mitigate by running each comparison twice with the response order swapped and checking for consistent judgments, or averaging across both orderings to cancel out the positional effect.
Q24.Why does an evaluation set need periodic refreshing rather than being fixed forever?(show answer)
As the product, user base, or model capabilities evolve, a static evaluation set can become unrepresentative of current real-world usage, missing new query types, edge cases, or failure modes that have since emerged. A stale test set can keep reporting good scores while missing genuinely new problems users are actually hitting.
Q25.How would you structure an evaluation that distinguishes "the system got the facts right" from "the system explained them well"?(show answer)
Score factual correctness or faithfulness separately from a distinct dimension like clarity, completeness, or tone — either via separate rubric criteria within one LLM-judge pass, or entirely separate evaluation passes. Conflating them into one holistic score obscures which dimension actually needs improvement when quality is judged unsatisfactory.
