Skip to main content

Generative AI Evaluation

Premium

As generative AI continues to grow rapidly, evaluating models for quality, safety, and reliability becomes increasingly important. If you are interviewing at an AI company, understanding how evaluations work and what companies consider during the process is essential.

This lesson covers what interviewers expect candidates to discuss, how top tech companies conduct evaluations, the key tradeoffs considered, and common pitfalls in evaluation.

How to show you know evals

You demonstrate strong proficiency to interviewers if you can:

  • Show breadth in your understanding of evaluation metrics
  • Explain how evaluation datasets are constructed and used
  • Clearly distinguish between offline and online evaluations

Evaluation metrics

The field of LLM evaluation is still evolving, so there are a lot of different ways that companies choose to design their evaluations. As a result, it’s important to understand multiple common approaches, as well as their pitfalls.

Scores like BLEU, ROUGE, and METEOR are some early and basic ways of understanding how a simple language model performs.

BLEU (Bilingual Evaluation Understudy) was originally used for machine translation. Technically speaking, it measures how many of the model’s n-grams match the reference text.

Pitfalls:

  • Not good at evaluating semantic quality. Words can be rearranged to convey different meanings, but BLEU score wouldn’t reflect that.
  • Has a brevity penalty that rewards short responses, but it’s not good at evaluating long, creative sentences.

Because earlier evaluation methods have notable limitations, companies often turn to benchmarks and their own internal metrics to assess LLM performance.

You are not expected to know specific benchmarks, since many are proprietary and vary across organizations, but you should understand the general categories these evaluations fall into.

For example LLaMa breaks it up as so:

Llama benchmark

In practice, many of the state of the art models (Gemini, Claude, GPT) exhibit similar performance on benchmarks. It’s not usually enough to make a difference in performance for your downstream tasks (caveats: models that are better at specific tasks e.g. coding).

As a result, companies will exhibit domain-specific evaluation metrics that are tied to their business goals.

For example, a healthcare agent that summarizes patient history cares a lot about the factuality of the response. Non-factual responses will hurt user trust and could have downstream negative effects for doctors/patients that are using the agent.

In contrast, a mental health agent might care about the underlying safety and fairness of their response. Similarly, unsafe responses will hurt the user experience and decrease usage.

Strong responses to interview questions about evaluating systems should show that you understand the tradeoffs between basic metrics, standardized benchmarks, and domain-specific metrics that are tied to the business.

Evaluation datasets

Evaluation datasets are essential for understanding how a system is tested. They consist of carefully selected inputs along with expected outputs, or ground truths, which are used to measure an AI application’s performance, accuracy, and safety.

The key questions in creating, understanding, and evaluating the evaluation datasets themselves are:

  • What is the task?
  • What do the inputs and outputs look like?
  • What guidelines did the labelers follow when creating the data?

The below is a simple example for an instruction following / utility benchmark.

Input to LLM: Sort the following numbers in ascending order: 5, 12, 1, 9 Expected output: 1, 5, 9, 12

This task is used to evaluate:

  • Instruction following. Does the LLM understand and follow the prompt? For example, does it return a list of numbers rather than something unrelated?
  • Utility. Is the result accurate? In this case, are the numbers actually sorted in ascending order?

Evaluation datasets usually include examples with a clear expected output. Practitioners then apply different evaluation metrics to compare the model’s response against that expected output. These metrics help determine how well the LLM performs on a specific task, or across many tasks.

Some common benchmarks for LLMs include:

  • MMLU (Massive Multitask Language Understanding) - general understanding
  • GPQA - multiple choice question benchmark for STEM subjects
  • EvalPlus - coding benchmark
  • SWE Bench - coding benchmark

In practice, companies often rely on their own datasets to evaluate model performance, because each company’s tasks are specific to its domain. For example, if the model is a healthcare agent, the company might create its own labeled dataset containing the correct answers or facts for each example. This allows them to measure how accurately the model performs on tasks relevant to their business.

Suppose you are training a GenAI system to detect harmful outputs from an image generation model. To do this, you would build a labeled dataset that reflects the kinds of harmful content your model is most likely to produce.

A high-quality dataset should:

  • Cover all major categories of harmful content (for example: violence, sexual content, hate symbols, self-harm), in proportions that reflect how often they actually occur.
  • Include enough examples within each category to capture real-world variation, not just obvious edge cases.
  • Contain a representative set of non-harmful images (“negative samples”) so the model learns to distinguish harmful content from normal, acceptable outputs.

In short, the dataset should be well-balanced, comprehensive, and realistic, so the classifier learns both what is harmful and what is not.

Since a lot of these tasks are subjective and difficult, labelers often have different ideas of what the expected output should be.

An important metric that measures agreement across labels is called inter-annotator agreement. The higher it is, the more “certainty” there is across labels.

When asked about evaluations in interviews, it’s a positive signal when the interviewee has nuanced ideas about how these evaluation datasets look like.

Offline & online evals

  • Offline benchmarks: Used before you deploy a model to production,
  • Online metrics: Use to evaluate a model in production.

Companies typically evaluate a model on an offline dataset before deploying it to production. This allows them to determine whether the model is performing well enough to be deployed.

Offline evaluation has its limitations because it only measures performance on data you expect to see in production, often based on historical datasets. However, historical data can differ from real production data.

Why does historical data differ from production data?

Historical datasets reflect past user behavior and controlled assumptions. In production, user behavior evolves, new user segments emerge, product changes alter inputs, and feedback loops or adversarial use introduce patterns that were not present in the original data, leading to data drift and unseen edge cases.

Evaluating a model online in production provides more accurate insights, but it is more challenging. You may not always have the expected outputs for incoming production data, depending on how your data labeling process is set up.

Understanding how companies balance both offline and online evaluation is key to giving a good response to interviewers asking about evals.

Common tradeoffs

Human labeling vs. automated labeling

As discussed above, it is important to know the expected output, or “ground truth,” when evaluating model performance. This can be provided by human labeling teams, or by automated systems, such as another LLM that is well-suited for generating labels for your task (also called LLM-as-a-judge).

Human vs automated labeling

Offline vs. online

Deciding whether to evaluate a model offline, online, or using both approaches is an important decision that should ideally be made from the very beginning.

Online vs offline evaluation

Common pitfalls

Offline evaluations not matching in-production behavior

Offline evaluations are useful, but they can only give an estimate of how the model will perform. Once a model interacts with real users, production inputs often look very different: messy formatting, ambiguous queries, missing context, or entirely new edge cases. The problem is not evaluating offline itself, but assuming that offline results will perfectly predict production performance.

A support chatbot performs well on a clean, curated offline dataset of user questions. Once deployed, users type messages like “yo my acct locked?? help asap,” and the model’s accuracy drops because the offline dataset did not reflect real-world language patterns.

Choosing metrics that don’t reflect your actual use case

The easiest trap in Gen AI evaluation is picking a metric because it exists, and not because it’s meaningful for your task. Metrics like BLEU or ROUGE measure similarity, not usefulness. If the metric doesn’t reflect what “good” looks like for your product, it’ll create the false impression of progress because you are optimizing for the wrong behavior.

You track ROUGE-L for a summarization model.

The model starts producing summaries that match the reference phrasing but are too long, too safe, and strip out important nuances.

Your ROUGE score went up, but your users are actually hating it.

Low-quality or unrepresentative evaluation datasets

Bad datasets may distort your understanding of the system entirely. If labels are inconsistent, instructions unclear, or examples too narrow, your evaluation pipeline becomes disconnected from reality. High variance in labels, in particular, makes it nearly impossible to know whether the model is wrong or the dataset is.

A dataset for evaluating email-drafting quality is labeled by different annotators with completely different style preferences.

One prefers “short and direct.” Another prefers “friendly and conversational.”

Your model will appear unstable, when the real problem is inconsistent labeling.

Slow feedback loops

If evaluation takes days or weeks due to slow labeling, large datasets, or infrastructure bottlenecks, it becomes difficult to iterate effectively. Long delays can result in outdated results, slower debugging, and a higher risk of releasing regressions that go unnoticed for too long.

Suppose you deploy a model to detect harmful outputs from an image generation feature that augments users’ photos. Over time, a new group of users begins using the app in unexpected ways, producing inputs that lead to previously unseen harmful edge cases.

Because these cases were not represented in the original training data, the model is uncertain how to classify them and may fail to flag them correctly. Often, these issues are only discovered after users report or flag the problematic outputs.

If identifying, labeling, and evaluating these new cases takes too long, updates to the model are delayed. As a result, harmful content continues to appear in production longer than necessary, increasing user risk and reducing trust in the system.