Interview Prep

Interview: Evaluation and Benchmarking

Knowing if the model or system is actually good. Read learning notes.

Evaluation & Benchmarking

Knowing if the model/system is actually good.

What's the difference between intrinsic and extrinsic evaluation of an LLM?

Intrinsic evaluation measures properties of the model itself in isolation - perplexity, benchmark accuracy (MMLU, HellaSwag, GSM8K). Extrinsic evaluation measures how well the model performs on the actual downstream task/product it's deployed in (e.g. does it resolve support tickets correctly), which is what ultimately matters but is more expensive and slower to measure.

What is perplexity and what are its limitations as a quality metric?

Perplexity measures how "surprised" the model is by held-out text - lower means the model assigns higher probability to the actual next tokens, roughly indicating fluency/predictive power. Its limitation is that it doesn't directly measure helpfulness, correctness, or alignment with human preference - a model can have low perplexity on generic text while still being unhelpful, unsafe, or factually wrong on specific tasks.

What is LLM-as-judge and what are its pitfalls?

LLM-as-judge uses a strong LLM to score or compare outputs against criteria (helpfulness, correctness, safety) at a scale human evaluation can't match. Pitfalls include: position bias (judges tend to favor the first/second option presented, mitigated by swapping order), verbosity bias (favoring longer answers even if not better), self-preference bias (a model favoring outputs similar to its own style), and the judge inheriting the same blind spots/errors as the model being evaluated - so it should be validated against human judgments periodically, not trusted blindly.

How do you build a good evaluation set for a production LLM application?
  • Sample real (or realistic) production queries, not just easy synthetic examples.
  • Include edge cases and known failure modes deliberately, not just average-case inputs.
  • Keep it versioned and separate from any fine-tuning/training data to avoid contamination.
  • Pair automated metrics (LLM-as-judge, retrieval recall) with periodic human review to catch what automated metrics miss.
  • Re-evaluate whenever the model, prompt, or retrieval pipeline changes - evaluation isn't a one-time step.
What is contamination in benchmark evaluation and why is it a serious problem?

Contamination happens when benchmark test data (or close paraphrases of it) leaks into a model's pretraining corpus, making the model appear to "reason" well when it may just be recalling memorized answers. It inflates reported benchmark scores in ways that don't reflect real-world capability, which is why decontamination filtering during data curation and using fresh/held-out benchmarks are important for trustworthy evaluation.

Name common LLM benchmarks and what each measures.
  • MMLU - broad multiple-choice knowledge across many academic subjects.
  • GSM8K / MATH - grade-school to competition-level math reasoning.
  • HumanEval / MBPP - code generation correctness.
  • HellaSwag - commonsense sentence completion.
  • TruthfulQA - resistance to generating popular misconceptions.
  • MT-Bench / AlpacaEval / Chatbot Arena - open-ended instruction-following and conversational quality, often via human or LLM-judge preference.
What is A/B testing for LLM features?

Route a fraction of traffic to variant B (new prompt, model, or RAG pipeline), compare business and quality metrics (task success, thumbs down, latency, cost), and require statistical significance before full rollout. Always log prompt version and model ID per request so results are attributable.