How to build reliable evaluation pipelines for AI systems

Shipping an AI feature without a structured evaluation process is like deploying code with no tests — except the failures are harder to reproduce, harder to explain, and often invisible until a user surfaces them.
The core argument of this guide is simple: a reliable AI evaluation pipeline is not a single tool or a single metric. It's a repeatable process that connects your test data, your scoring logic, your review workflows, and your production experiment results into one continuous loop. Each layer depends on the one before it, and skipping any of them creates gaps that show up as production surprises.
This guide is for engineers, PMs, and data teams who are building or improving evaluation for AI systems — whether that's a RAG pipeline, an agent, or a multi-turn chatbot. Here's what you'll learn:
- How to build a representative evaluation dataset before you write a single metric
- How to define layered metrics that separately track latency, output quality, and safety
- How to use LLM-as-a-judge to scale scoring without losing interpretability
- How to build human review workflows and regression detection into the pipeline loop
- How to feed production experiment data back into your offline evaluation dataset
The guide follows that order deliberately. Each section builds on the previous one, so by the end you'll have a complete picture of how the parts fit together — not just a checklist of best practices to apply in isolation.
Start with a representative evaluation dataset before writing a single metric
Most teams building an AI evaluation pipeline reach for metrics first. It feels like the right starting point — metrics are concrete, they're technical, and they give the impression of rigor.
But a sophisticated scoring system applied to a poorly scoped dataset doesn't produce rigorous results. It produces confident, wrong answers. The dataset is the foundation everything else depends on, and AWS makes this sequencing explicit: gather your evaluation dataset before you define your metrics, not in parallel with it.
As Maxim AI puts it plainly: "Without high-quality evaluation data, teams cannot reliably assess whether their agents are improving or regressing with each iteration." That's not a tooling problem. It's a data problem, and no amount of clever metric design fixes it.
Representative means matching production distribution, including the cases you'd rather not test
"Representative" is easy to say and hard to operationalize. In practice, it means the distribution of inputs in your dataset should mirror the distribution of inputs your system will actually encounter in production — including the rare, high-stakes cases that don't show up in average traffic but matter enormously when they do.
AWS frames this as a requirement for "diverse samples" that reflect the "actual real-world use case." For a customer support system, that means your dataset can't consist only of routine queries. It needs escalation scenarios, ambiguous requests, and cases where the user is frustrated or provides incomplete context.
For a code review assistant, it needs both well-formed and malformed inputs, edge cases in language syntax, and examples where the correct answer is "this code is fine" — not just cases where something needs fixing.
The practical implication: before you write a single evaluation case, map the input space your system operates in. What are the common cases? What are the complex ones? What are the edge cases that would cause real harm if handled incorrectly? Your dataset needs coverage across all three categories.
Ground truth generation — why expert labels beat synthetic assumptions
The most common shortcut teams take is using model-generated outputs as ground truth — either from the same model being evaluated or a closely related one. This is a structural problem. You cannot reliably evaluate a model against a reference that was produced by the same class of system you're trying to assess. The errors correlate.
AWS is direct on this point: evaluation datasets should "ideally contain ground truth values generated by experts". The qualifier "ideally" is intentional — expert annotation is expensive and doesn't scale infinitely — but the underlying principle holds.
Expert-generated labels establish a reference point that is independent of the model's own tendencies and failure modes. Synthetic ground truth, by contrast, tends to reflect whatever biases and gaps the generating model already has.
For teams with limited annotation budgets, a practical middle path is to use expert labels for the highest-stakes cases and edge cases, while reserving synthetic generation for volume coverage of routine scenarios where the stakes of a labeling error are lower.
Iterative enrichment with failure cases
Dataset construction is not a one-time task. It's a lifecycle. The initial dataset gets you started; the enrichment process is what makes your AI evaluation pipeline durable over time.
Maxim AI describes this as "continuous improvement workflows" built on a combination of production traces, synthetic generation, and human-in-the-loop review. The practical cycle looks like this: run your evaluations, identify the cases where the model fails or produces unexpected outputs, add those cases to the dataset, and re-run. Each iteration makes the dataset harder to game and more representative of real failure modes.
Production logs are particularly valuable here. Actual user interactions surface failure patterns that no amount of upfront scenario planning anticipates. This is also where warehouse-native architectures become relevant — teams that store production experiment data in their own data warehouse can query that data directly to identify candidates for dataset enrichment, without routing raw user interactions through a third-party pipeline. We'll return to this feedback loop in the final section, but the architecture decision you make now determines whether that loop is possible later.
How dataset scope determines what metrics are even measurable
This is the section's central argument made concrete: your dataset is a hard constraint on your metric scope. If your dataset contains no adversarial inputs, you cannot measure robustness. If it contains no multi-turn conversations, you cannot measure coherence across turns. If every example has a single correct answer, you cannot measure how the model handles genuine ambiguity.
Teams that skip careful dataset construction and jump to metric selection often discover this constraint the hard way — they define a metric, attempt to compute it, and find that their dataset doesn't contain the evidence needed to make the metric meaningful. The metric becomes a formality rather than a signal.
On dataset size: Maxim AI cites research recommending at least 30 evaluation cases per agent, covering normal operations, complex scenarios, and edge cases. This is a floor for agent evaluation specifically, not a universal rule — AWS explicitly acknowledges that the right size depends on the application, and no published research provides equivalent benchmarks for RAG pipelines or general chatbot evaluation.
What matters more than hitting a specific number is ensuring your dataset covers the full range of scenarios your system will encounter, with enough examples in each category to detect meaningful differences in model behavior across versions.
Define layered metrics that cover latency, quality, and safety dimensions
The most common failure mode in AI evaluation pipeline design isn't bad tooling or insufficient compute — it's collapsing a multi-dimensional problem into a single score. A composite quality number feels satisfying to report, but it hides the specific failure modes that actually matter: a model that's fast but hallucinates, or faithful but dangerously biased, or accurate on single-turn queries but degraded across a multi-turn conversation. A deliberate metrics architecture forces each of those failure modes to surface at the layer where it belongs.
The LLM evaluation space has produced more than 50 research-backed metrics across system types and evaluation dimensions. The practical challenge isn't finding metrics — it's selecting the right ones for your system type and organizing them into a taxonomy that makes your pipeline actionable rather than decorative.
As a general principle, if your metrics are tracking the wrong things, you'll have garbage in and garbage out regardless of how sophisticated your scoring infrastructure becomes.
Latency is the one dimension where standard instrumentation applies directly
Latency is the one dimension where standard software engineering instrumentation applies directly to LLM systems without requiring model-level judgment. Time-to-first-token, end-to-end response time, and p95 latency are observable at the infrastructure layer and require no rubric design.
The key discipline here is tracking latency alongside quality metrics rather than in isolation. Optimizing for speed at the expense of output integrity is a real failure mode — a model configuration that cuts response time by 40% while degrading faithfulness by a comparable margin is a net regression, not an improvement. Latency metrics set the floor; quality and safety metrics determine whether you've actually stayed above it.
RAG quality failures cluster around five measurable dimensions
This is where the taxonomy gets substantive. For RAG systems specifically, the canonical output quality metrics cluster around five dimensions: Faithfulness, Answer Relevancy, Contextual Precision, Contextual Recall, and Contextual Relevancy.
Each measures a distinct failure mode — Faithfulness catches generation that contradicts the retrieved context; Contextual Precision and Recall evaluate whether the retrieval layer is surfacing the right material in the first place.
Traditional n-gram overlap metrics like BLEU and ROUGE are still in use as baselines, but they measure content similarity rather than semantic meaning. Relying on them as primary quality signals for LLM outputs is a well-documented mistake — they can't distinguish between a response that's factually correct and one that uses similar vocabulary while getting the substance wrong.
Beyond the RAG metric cluster, three metrics stand out as particularly strong predictors of real-world reliability: faithfulness, pass at k (which measures whether a model can reliably produce a correct answer across multiple attempts), and prompt sensitivity (how much output varies with small changes to the input prompt). If a model's outputs shift dramatically with minor prompt variations, that instability is a quality signal that accuracy alone won't surface.
Safety metrics fail silently when folded into quality scoring
Safety metrics operate at the foundational model layer and include Hallucination, Toxicity, and Bias as the primary dimensions. The reason these deserve their own layer — rather than being folded into quality scoring — is that they require different evaluation methods and have different consequences when they fail silently.
The stakes are particularly high for agent systems. Research from Kili Technology found that single-run accuracy masks reliability drops of up to 75% in sustained agent operation. That's not a marginal degradation — it means a system that appears to pass evaluation can fail catastrophically under real workload conditions.
Prompt sensitivity belongs in this layer as well: a model that produces wildly different outputs in response to semantically equivalent prompts is exhibiting a reliability failure that's also a safety concern in high-stakes applications. Red teaming, as a complement to automated safety scoring, is the mechanism for stress-testing these dimensions against adversarial inputs that standard test sets don't cover.
Choosing the right scoring method per metric
Not all metrics can or should be scored the same way. The design decision is matching scoring method to metric type. Latency metrics are instrumented automatically at the infrastructure layer — no judgment required. Output quality metrics like Faithfulness and Contextual Relevancy require semantic understanding, which is why LLM-as-a-judge with structured rubrics (using frameworks like G-Eval) is the most reliable scoring method for this layer.
Safety metrics warrant LLM-judge scoring combined with human spot-checks, particularly for Bias and Toxicity where the failure modes are high-consequence and context-dependent.
The practitioner insight that anchors this design decision is that most LLM outputs aren't binary — they exist on a spectrum of partial correctness, partial faithfulness, partial safety. A pass/fail threshold on a single score can't represent that spectrum. Graduated, rubric-based scoring at each layer is what makes the evaluation signal interpretable enough to act on.
RAG, agent, and chatbot systems each require a distinct metric configuration
The three primary system types — RAG pipelines, agents, and chatbots — each require a distinct metric configuration, not a generic quality score applied uniformly.
For RAG systems, metrics are needed at both the retrieval layer (Contextual Precision, Contextual Recall) and the generation layer (Faithfulness, Answer Relevancy). Evaluating only the generated output without measuring retrieval quality means you can't diagnose whether a faithfulness failure is a generation problem or a retrieval problem.
The architecture is entirely different for agent systems. Action-layer metrics — Tool Correctness, Task Completion — measure whether the agent is doing the right things. Reasoning-layer metrics — Plan Quality, Plan Adherence, Step Efficiency, Argument Correctness — measure whether the agent is thinking about the problem correctly. These two layers can fail independently, which is why they need to be evaluated separately.
Where chatbot systems diverge from both is in the multi-turn structure. Turn Faithfulness, Turn Relevancy, and Turn Contextual Precision apply the same quality dimensions as RAG but across conversation turns — because a model that's coherent on turn one may drift significantly by turn five, and single-turn metrics won't catch that degradation.
The practical constraint on all of this is that more metrics isn't always better. A focused set of metrics that directly maps to your system's failure modes will produce more actionable signal than an exhaustive taxonomy that no one has bandwidth to review. The discipline is in the selection, not the enumeration.
LLM-as-a-judge resolves the scaling problem human review creates in AI evaluation pipelines
Human review is the gold standard for evaluating AI outputs, but it doesn't scale. And as established in the metrics section, the automated alternatives that do scale — BLEU, ROUGE, n-gram overlap — can't evaluate semantic correctness.
LLM-as-a-judge resolves this tension by applying human-like semantic judgment programmatically — at CI/CD speed, across every output, with per-case reasoning you can inspect and act on.
The empirical case for this approach is strong: LLM judges agree with human reviewers approximately 85% of the time, which is actually higher than the rate at which two humans agree with each other on the same evaluation tasks. That single data point reframes the conversation. The question isn't whether LLM-as-a-judge is good enough to replace human review in bulk — it's how to configure it so it stays calibrated.
The mechanism is straightforward; the configuration is where most teams go wrong
The mechanism is straightforward. A judge model receives a structured prompt containing four elements: an evaluation rubric defining the quality criteria, the original user input, the model output being evaluated, and optionally a reference answer to score against. It returns a structured score plus a natural-language explanation of its reasoning — not just a number.
That reasoning component is what separates LLM-as-a-judge from opaque heuristics. When a test case fails, you can read why the judge flagged it, which makes the score actionable rather than just a signal to investigate further.
Use LLM-as-a-judge when outputs are open-ended, subjective, or require semantic understanding — helpfulness, factual alignment, tone, completeness. Use deterministic checks for binary or rule-based outputs where a regex or exact match is sufficient. The two approaches are complementary, not competing.
Configuring judges for different output types
The highest-leverage configuration decision is criteria definition. Vague rubrics produce inconsistent scores; precise rubrics that define what "correct" or "grounded" actually means for your specific system produce reliable ones.
Beyond the rubric, you need to choose a score type. Numeric scores (e.g., helpfulness on a 0–1 scale) work for continuous judgments. Categorical labels (e.g., correct, partially_correct, incorrect) are better when you need explicit classification. Boolean outputs (e.g., does this response violate policy?) suit binary decisions. Each maps to a different downstream workflow — numeric scores aggregate into distributions, categoricals feed regression detection, booleans trigger hard blocks.
You also need to choose a judge mode. A referenceless judge scores an output without a ground truth — useful when correct answers are genuinely open-ended. A reference-based judge scores against a known correct answer, which tightens the evaluation considerably when ground truth exists. Pairwise comparison judges evaluate two outputs head-to-head and select the better one, which is useful for prompt iteration but introduces ordering considerations that need to be managed carefully.
Chain-of-thought and reference-based scoring are the two highest-leverage accuracy improvements
A naive LLM-as-a-judge prompt — just asking the model to rate a response — produces unreliable results. Several techniques meaningfully improve accuracy. Chain-of-thought prompting asks the judge to reason through its evaluation before committing to a score, which reduces arbitrary variation. Few-shot prompting provides labeled examples that anchor the judge's interpretation of your rubric. Reference-based scoring, where applicable, gives the judge a concrete target to compare against rather than relying entirely on its priors.
For structured scoring tasks, G-Eval uses chain-of-thought reasoning as a formal scoring method rather than an informal prompt addition. For complex criteria that involve multiple sub-dimensions — say, evaluating both the accuracy and the tone of a multi-turn response — you can decompose the evaluation into a sequence of sub-scores, each judged independently, then combined into a final result.
This staged approach (sometimes called DAG-based evaluation) prevents a failure on one dimension from distorting the score on another, which is particularly useful when outputs have several independent quality requirements.
Known failure modes and calibration requirements
LLM judges are not plug-and-play. As Confident AI puts it directly: "The wrong scoring method, the wrong prompt, the wrong rubric, and your eval scores end up just as flaky as the model you're testing." The failure modes are specific and addressable, but only if you anticipate them.
Position bias is the most documented issue in pairwise comparisons — judges tend to favor whichever output appears first or second in a consistent pattern. The mitigation is straightforward: run each comparison twice with positions swapped and reconcile disagreements. Prompt sensitivity is subtler; small changes to rubric wording can shift score distributions in ways that aren't visible until you validate against a human-labeled calibration set.
That calibration step is non-negotiable before deploying a judge in CI/CD. Run your judge against a set of cases where you have human ground truth labels, measure agreement, and iterate on the rubric until agreement reaches an acceptable threshold for your use case.
A judge that hasn't been validated against human labels is a liability, not an asset — it will give you confidence in scores that may not reflect reality. Once calibrated, even well-performing judges will surface edge cases that require human review, which is exactly what the review workflow layer of the pipeline is designed to handle.
Build human review workflows and regression detection into the evaluation pipeline loop
Automated scoring gives you numbers. Review workflows give you decisions. The distinction matters more than most teams realize until they've spent months building a metric architecture, only to discover they have no structured process for acting on what those metrics surface.
According to research cited by Kili Technology, most AI teams spend roughly 90% of their effort on model architecture, training data, and hyperparameter tuning — and about 10% on evaluation. The failure rates that follow from that imbalance are not subtle: more than 80% of AI projects fail, at roughly twice the rate of non-AI IT projects, with bad data foundations and evaluation gaps consistently identified as the root cause.
The teams that avoid this outcome don't just have better metrics. They treat human review and regression detection as first-class engineering concerns, not afterthoughts bolted on after the pipeline is already running.
Surfacing failing test cases to domain experts
When an automated score flags a failing case, the score itself rarely tells a domain expert what they need to know: whether the failure is consequential, whether it reflects a systematic problem, or whether the rubric that produced the score is even calibrated correctly. This is why the hybrid evaluation model — benchmarks combined with LLM-as-a-judge and structured human expert review — consistently produces more reliable signal than any single layer alone.
The practical implication is that your AI evaluation pipeline needs a routing mechanism, not just a dashboard. Flagged outputs need to reach the people with subject-matter knowledge to adjudicate them, and those people need enough context — the input, the expected output, the score, and the scoring rationale — to make a meaningful judgment.
Kili Technology's research is direct on this point: evaluation quality is fundamentally a data quality problem, and calibrated annotators working from behaviorally anchored rubrics are what determine signal reliability. Automated scoring can scale the first pass; expert review is what makes the signal trustworthy.
Tracking regressions across model and prompt changes
The most insidious regressions in AI systems are the ones that look like improvements. A prompt change that tightens tone might simultaneously break accuracy on a specific input class. A model update that improves average performance might degrade reliability on the edge cases your users care about most. As Braintrust notes, these failures happen specifically because teams deploy changes without measuring their impact on output quality across the full evaluation set.
Catching regressions requires a stable baseline to compare against, which means dataset versioning is a prerequisite — not an optional enhancement. Label Studio frames this as a question every team should be able to answer at any point in their evaluation history: "Did the model change, or did the benchmark change?" Without explicit versioning, that question becomes unanswerable, and long-term performance trends become noise.
The operational pattern that works is maintaining two evaluation sets in parallel: a stable core set used consistently for trend tracking, and a rotating set that incorporates newer data and emerging failure modes. Automated evaluation runs should trigger on every model or prompt change, comparing results against the versioned baseline so regressions are visible immediately rather than discovered in production.
Keeping evaluation datasets synchronized with the codebase
Evaluation datasets drift out of sync with production systems when they are treated as static artifacts. The test cases that covered your system six months ago may not cover the inputs your users are actually sending today.
Label Studio's guidance is that dataset changes should be done intentionally and tracked explicitly — following a versioning discipline similar to code, tied to specific model or prompt changes, with documented rationale for what was added, removed, or modified.
This discipline is what allows a team to reconstruct the evaluation history of a system and understand whether a performance change reflects genuine improvement or a shift in what the benchmark is measuring.
Enabling cross-functional collaboration without engineering bottlenecks
A review workflow that requires an engineer to add every new test case, adjust every scoring threshold, or route every flagged output will eventually stop functioning as a continuous process and collapse into a periodic engineering task. Product managers, QA teams, and domain experts need to participate in the evaluation loop without filing tickets to do it.
This is where tooling architecture matters. Platforms designed around role-based access and transparent workflows — warehouse-native experimentation platforms, for instance — reduce the collaboration friction that causes review workflows to atrophy.
The broader principle applies regardless of tooling choice: if non-engineers can't update test sets, review flagged outputs, or inspect evaluation results without engineering involvement, the feedback loop will be slower than the pace of model changes, and the pipeline will consistently lag behind the system it's supposed to evaluate.
Close the loop by feeding production experiment data back into your AI evaluation pipeline
Every section of a mature AI evaluation pipeline — the dataset, the metrics, the judges, the review workflows — ultimately feeds a pre-deployment gate. That gate is necessary, but it is not sufficient.
The teams that discover this the hard way are the ones who ship a model with strong offline scores and then watch user satisfaction metrics flatline. The architectural step that prevents this is a production feedback loop: connecting live experiment results back to the evaluation dataset so that each offline test cycle is informed by what actually happened in the real world.
Why offline evaluation alone creates a prediction gap
The dataset construction principles in the first section of this guide address the failure modes you can anticipate. They don't address the ones you can't. Static evaluation datasets, no matter how carefully constructed, cannot update themselves when your user population shifts or when the model's behavior changes in ways that interact with real usage patterns in unexpected ways.
Label Studio's research on evaluation dataset management makes this structural problem explicit: metric changes can reflect changes in the data rather than genuine improvements or regressions in the model. When your offline dataset drifts from production reality, your scores drift with it — and you lose the ability to distinguish between a model getting better and a test set getting stale.
Braintrust frames the cost of this gap as "production surprises" — the incidents that happen after deployment that a well-constructed offline eval should have caught but didn't. The shift to CI/CD-integrated evals reduces the frequency of surprises by running evaluations continuously, but even automated pre-deployment checks are still pre-deployment. They can only validate against what the eval dataset already contains. Production data closes the remaining gap.
Connecting A/B experiment results to offline metric validation
The validation loop works like this: you run an offline evaluation, deploy the winning variant through a controlled experiment, measure user-facing outcomes, and then check whether the offline metrics that predicted the win actually correlated with what happened in production. If they didn't, the metrics need recalibration — not the model.
This is where experimentation infrastructure becomes a direct input to the evaluation program, not just a deployment mechanism. GrowthBook tracks the cumulative impact of experiments across time, which matters because individual AI model changes often have modest per-experiment effects that only become meaningful in aggregate.
Tracking North Star metrics across an entire sequence of model iterations lets teams validate whether offline improvements are compounding into real business outcomes or canceling each other out.
Landon Smith, Head of Post-Training at Character.AI, describes this orientation directly: "We can compare different modeling techniques from the perspective of our users — guiding our research in the direction that best serves our product." That framing — user perspective as the validation layer — is exactly what offline eval datasets cannot provide on their own.
Warehouse-native experimentation for AI systems
The data architecture of your experimentation platform matters more for AI evaluation pipelines than it does for traditional feature experiments. AI model evaluation requires customized metrics — engagement depth, task completion, model cost per session, downstream conversion — that don't map cleanly to a vendor's predefined event schema.
If your experiment analysis runs against data that has been routed through a third-party pipeline, two problems follow: you're limited to whatever metrics that vendor's pipeline supports, and your raw user interaction data is leaving your infrastructure. For AI teams specifically, that second problem is concrete — user interaction data that flows through external servers could potentially be used to train external models, which is a model contamination risk, not an abstract compliance concern.
Warehouse-native experimentation resolves this by running analysis directly against data that already lives in your warehouse — Snowflake, BigQuery, Redshift, Postgres — using SQL-defined metrics that you control. GrowthBook operates this way: production event data never leaves your infrastructure, metrics can be defined or added retroactively, and any calculation can be reproduced and audited.
Using production traffic to enrich the evaluation dataset
The feedback loop closes here. Production experiments surface the inputs where your model underperformed on user-facing metrics — the cases that weren't in your original evaluation dataset because you didn't know they existed. Those cases are the highest-value additions to the next offline test cycle, because they represent real failure modes rather than anticipated ones.
Label Studio describes maintaining a "rotating set that reflects newer data or emerging risks" alongside a stable core evaluation set. The rotating set is implicitly populated from production observations. GrowthBook's experiment history and results tracking captures which experiments worked and which didn't, so that production experiment history informs future dataset construction and metric prioritization rather than being lost between release cycles.
The warehouse-native architecture is what makes this practical rather than aspirational: because production data stays in your warehouse and metrics are defined in SQL, constructing an evaluation dataset from production query results is a query, not a data pipeline project. The eval program becomes self-reinforcing — each deployment cycle generates the evidence that improves the next one.
The five components only produce reliable signal when connected in the right sequence
A reliable AI evaluation pipeline is not a single tool or a single decision — it's five components that only work when they're connected in the right sequence. The dataset constrains what metrics are measurable. The metrics determine what the judge needs to score. The judge's output feeds the review workflow. The review workflow closes the loop back to the dataset. Skip a layer, and the gap shows up as a production surprise you didn't see coming.
Sequence the five components in the right order to avoid rework
The most expensive mistake teams make is building in the wrong order — standing up a judge before the rubric is calibrated, or defining metrics before the dataset covers the failure modes those metrics are supposed to detect.
Start with the dataset. Map your input space, get expert labels on the high-stakes cases, and only then define the metrics that your dataset can actually support. Everything downstream — scoring, review, production feedback — is more stable when the foundation is right.
The data architecture decision matters more than the tooling brand
A small team evaluating a single RAG pipeline doesn't need the same infrastructure as a team running agents across multiple product surfaces. What every team does need, regardless of size, is a data architecture that keeps production experiment data accessible — not locked in a vendor pipeline.
If your experiment results live in your own warehouse, enriching your evaluation dataset from production queries is a SQL problem. If they don't, it becomes a data engineering project every time you want to close the loop. That architectural decision is worth making deliberately early, not revisiting after the pipeline is already running.
Treat evaluation as a living system, not a one-time checklist
The evaluation dataset you build today will drift from production reality within months. The judge rubric that's calibrated now will need adjustment after the next major model update. Regression detection only works if someone is actually reviewing the diffs.
None of this is a reason to delay — it's a reason to build the pipeline with iteration in mind from the start, not treat the first version as the final one.
If this guide helps you avoid even one production incident that a structured eval process would have caught, it's done its job.
What to do next
Your starting point determines your first move. If you don't have an evaluation dataset yet, stop and build one before touching metrics or tooling — map your input space, identify your highest-stakes edge cases, and get expert labels on those first.
If you have a dataset but no structured metrics, audit it against the layered framework in this guide: does it contain enough adversarial inputs to measure safety? Enough multi-turn examples to measure coherence? Fill the gaps before adding scoring infrastructure.
For teams that have metrics but no production feedback loop, the immediate question is whether your experiment data lives somewhere you can query it directly — if it does, your next step is writing the query that surfaces underperforming cases from your last deployment cycle and adding them to your eval set. That single action turns your AI evaluation pipeline from a pre-deployment gate into a self-improving system.
Related insights
- AI Evals vs. A/B Testing: Why You Need Both to Ship GenAI
- A/B testing in the age of AI: evolution or revolution?
Related Articles
CLI vs MCP: TLDR, it doesn’t matter as much as you think
Your agent should know how to do the job whichever interface it uses.
Your coding agent can already run terminal commands. Your product manager's assistant can connect to remote tools. Both need to inspect the same experiment, understand the same metric, and prepare changes to the same feature flag.
That creates a familiar question: should you give them a CLI or an MCP server?
The usual answers mix several concerns. A CLI is easy to compose with scripts. MCP gives compatible clients a standard way to discover and invoke tools. Skills can supply the instructions that make either route useful. None of those statements tells you whether the agent knows your release process or can distinguish a draft from a live change.
For GrowthBook, the choice has become smaller. We've built the agent layer around a REST API and reusable workflow skills, then made those available through different interfaces. Your choice of CLI or MCP no longer needs to determine which product workflow your agent can understand.
It still determines how the agent connects, executes requests, and handles credentials. This article explains that distinction, shows the same disabled-flag operation through both routes, and gives you a way to evaluate the integration you actually intend to use.
The debate combines three different questions
Start with a specific job: prepare a release control for a new checkout flow. The agent needs to know which project owns checkout, which environments exist, what the default behavior should be, and whether the proposed flag key already exists.
Choosing an interface answers only part of that job.
How can the agent reach the product?
A command-line interface lets an agent invoke a program in an environment where it has shell access. That program can make authenticated API requests and return data. You can also run the same commands yourself, put them in scripts, and preserve output for inspection.
The Model Context Protocol architecture connects a host application to servers through clients. An MCP server exposes capabilities that a compatible host can discover and call. The host might be a coding environment, a desktop assistant, or another agent application.
These categories overlap. A terminal-based agent can also be an MCP client. A local MCP server can be a process launched by that client. A remote MCP connection can work without the host giving the model a general-purpose shell.
So “terminal agent” doesn't automatically mean “use the CLI,” and “MCP” doesn't automatically mean “remote service.” Ask what access the runtime provides before choosing the adapter.
What procedure should the agent follow?
An API can expose a create operation without teaching an agent when to use it. A syntactically valid feature flag might still have the wrong project, an ambiguous key, or a default value that doesn't match the application.
That's the job of a skill: reusable instructions for a recognizable task. The Agent Skills format gives those instructions a portable structure, including a skill entry point and supporting references. A workflow can describe the context to inspect, the sequence to follow, and the evidence to return.
For the checkout example, useful guidance says to resolve environments, check the permanent key, choose a value type, and create the flag disabled. Merely exposing a create command leaves those decisions to the agent's general knowledge.
Skills are also useful when the right answer is to take no action yet. “Create a flag” and “design an experiment” are related requests, but they can require different objects and sequencing. An agent needs enough product guidance to make that distinction.
What context makes the procedure relevant?
Even a good playbook needs the current product state. The agent should inspect the objects in your GrowthBook organization and, when it is changing application code, the repository's SDK initialization and tests.
Those are different sources of context. GrowthBook supplies flags, experiments, metric definitions, and other authorized product resources. Your coding runtime supplies the application files it can access. An MCP connection doesn't by itself grant repository access, and a CLI doesn't by itself explain your metric definitions.
Evaluate the combination: access to the product, a maintained procedure, and enough context to apply that procedure. A comparison that changes all three at once cannot isolate the effect of CLI versus MCP.
GrowthBook puts the durable parts below the interface
We separated the agent layer into responsibilities that can be reused. The product API exposes operations. Skills explain workflows. The interface connects the agent to those two layers.
This is the architectural shift behind GrowthBook's agent experience. Instead of making every client integration carry its own interpretation of experimentation, we can share the interpretation and change how it is delivered.
The API provides the operations
GrowthBook's REST API makes product objects addressable. An agent can inspect a project, retrieve a flag, or perform an authorized operation against those objects.
The rebuilt API described in GrowthBook 4.4 uses shared schemas to support types, validation, and API documentation. The CLI is generated from the API definition. That reduces the amount of separately maintained command logic needed to expose product operations.
The OpenAPI specification explains the underlying principle: a machine-readable description can represent an HTTP API's paths, operations, inputs, and responses. Generation is useful because it derives another interface from that contract.
Generation doesn't mean any installed binary knows every future endpoint. The generated client still has a version, and your GrowthBook server still has a version. A self-hosted instance can lag behind the public documentation. Treat API compatibility as a deployment fact you verify.
Skills provide the workflow guidance
GrowthBook's feature-flags skill routes requests to more specific workflows. Creating a flag, inspecting dependencies, changing targeting, requesting review, and publishing a revision are separate procedures.
That structure lets the agent load the guidance relevant to the current job. The skill authoring guidance on progressive disclosure supports this approach: keep the entry point focused and place detail in references that are loaded as needed.
The benefit is maintainability as well as context management. A correction to a flag workflow can be made in the maintained skill rather than repeated across a series of tool descriptions and client-specific prompts.
There are two shell concepts to keep distinct. The generated growthbook CLI is a terminal interface to the product API. The skills repository also includes a small gb-call helper for making REST requests. Installing a skill doesn't make that helper a globally available command; its location depends on the installation. Both can reach the API, but their configuration and invocation are different.
MCP provides a thin bridge
The current GrowthBook MCP implementation exposes four tools: growthbook_list_skills, growthbook_read_skill, growthbook_api_read, and growthbook_api_write.
An agent discovers a domain, reads the relevant workflow, then makes API calls. It doesn't need a dedicated MCP tool for every product endpoint. Calls described as gb-call GET in a skill map to the read tool; mutating methods map to the write tool with the same path and body.
The bridge does not run the shell helper. It forwards authenticated requests. Product-side permissions and validation remain important because a small tool surface can still reach many operations.
Shared guidance also has a delivery boundary: the MCP server bundles skills when it is built, using a pinned source revision. A newly edited skill in the repository needs to be included in a subsequent server build before that server supplies it. “Shared source” is a maintainability claim, not a promise of instant synchronization.
Explore the shared flag workflows
Open the feature-flags skill to see the procedures that guide creation, targeting, reviews, and publishing. Bring the same workflow knowledge to the agent interface your team uses.
View the Flag SkillThe same disabled flag can use either route
The practical question is whether the interface changes the job. Let's create a Boolean flag called checkout-redesign, with a false default and every environment disabled.
This is an API example for a sandbox project, not an application integration tutorial. It creates a control object; your application still needs a correctly configured GrowthBook SDK to evaluate it. The feature flag documentation covers the product concepts behind that integration.
Connect and verify before preparing the write
For the terminal route, install the current GrowthBook CLI, configure a Personal Access Token through its interactive setup, and inspect the available command syntax:
Check that the active server and identity are the ones you intend to use. Prefer a tested, pinned CLI version in repeatable automation. Don't include a live token in a command you plan to share.
For an MCP route, the GrowthBook Cloud setup uses the hosted endpoint and browser OAuth. In a client using the documented mcpServers configuration shape, such as Cursor, add:
Complete the browser authorization and confirm tool discovery. Other clients can use a different configuration shape. Self-hosted GrowthBook users should follow the local stdio or self-hosted HTTP instructions rather than point a private instance at the Cloud service.
Next, let the connected agent discover the flag-creation workflow. These are tool-call parameters, shown separately in the order to invoke them:
The returned guidance should describe the prerequisites for creating the flag. If the workflow isn't present, resolve the server's bundled skill version before substituting instructions from an older integration.
Resolve real IDs and construct one payload
The flag-creation workflow checks existing keys, lists projects, and resolves environments. In the MCP client, invoke the read tool with each of these argument objects:
For the CLI route, perform that discovery with the corresponding command groups documented in the CLI command catalog:
Inspect each command's help if your installed version differs. The returned keys, project IDs, and environment IDs are the inputs to the payload below. In MCP, the equivalent read-tool arguments are:
Verify that checkout-redesign isn't taken, identify the sandbox project's ID, and enumerate every actual environment. These read responses determine the payload; don't treat example environment names as a complete inventory of your organization.
Save the following as flag.json, replacing <PROJECT_ID> and the environment keys with the discovered values. This example assumes the only environments are staging and production:
The API represents defaultValue as a string, even for a Boolean flag. Explicitly disabling each environment avoids relying on the organization's default state for newly created flags. Use a PAT for this example so the caller has a user identity for attribution.
Review the permanent key, project, value, and disabled states before submitting. If the intended job is an experiment, route to experiment design first instead of creating an unrelated flag and hoping to connect it later.
Submit once, then read the object back
With the CLI, the create command accepts a JSON body. In a Bash-compatible shell, inspect the request with dry run before submitting:
The first command previews a request; it doesn't prove the server will accept it. Run the second only after checking the preview and approving this creation. In PowerShell, use that shell's file-reading syntax rather than paste the Bash substitution unchanged.
The PowerShell equivalent, using the same reviewed file, is:
The same distinction applies: preview first, approve the specific creation, then submit. Neither command changes the application's deployed code.
Through MCP, call growthbook_api_write with the same payload serialized into its body string. Substitute the same resolved project and environment names:
Choose one creation route. Don't run both against the same key; they target the same product object, and the second creation should encounter an existing key.
Verify through the CLI get command:
Or invoke growthbook_api_read with:
Check the returned key, project, value type, default value, disabled state of every environment, and absence of unintended rules. Report those facts rather than “success.” No targeting or exposure change is included in this example.
Choose the route that fits the runtime
Once the procedure and API operation are shared, the remaining choice is operational. Where does the agent run? What can it execute? How does it authenticate? What does your team need to inspect afterward?
Shell access favors terminal composition
A shell-capable agent can run the CLI alongside repository tools, save structured output, and combine product inspection with local checks. That is useful when the job includes code changes, generated files, or a reproducible script.
For example, a flag audit can produce an inventory file while an engineer separately checks code references. The agent should preserve the association between the GrowthBook key and each repository reference. The final artifact can include both the product state and the proposed code diff.
The shell makes composition available; it doesn't make a workflow safe by default. A script can select the wrong profile or swallow an error. Decide which failures stop the workflow, where outputs are stored, and which steps need a reviewable artifact.
Remote tool access favors MCP clients
MCP is useful when the host already provides a tool connection but doesn't expose a terminal. A PM can inspect an experiment through a compatible assistant without installing a product CLI inside that assistant's runtime.
The MCP authorization specification defines an authorization framework for HTTP transports. GrowthBook Cloud uses browser OAuth, while local stdio configurations use credentials supplied to the process. Those are distinct deployment paths.
MCP also gives hosts a structured description of tools. The tool specification includes annotations such as read-only and destructive hints. Hosts can use those signals in their interaction design, but the signals are not an access-control boundary. The product must still enforce the caller's actual permissions.
Use a small decision table
| Your immediate requirement | Route to consider | What to verify |
|---|---|---|
| Combine product operations with local files and scripts | CLI plus maintained skills | Shell access, profile, installed version, structured output |
| Connect a compatible assistant without a shell | Hosted MCP | HTTP/OAuth support, identity, tools, bundled workflow |
| Keep requests inside a self-hosted deployment | CLI or self-hosted MCP | Network reachability, server version, credentials, trusted app origin |
| Reuse a procedure across different team clients | Shared skills through either route | Workflow revision, API compatibility, expected review artifact |
You can support more than one row. An engineer's CLI and a PM's MCP connection can operate on the same objects with different identities and permissions. Standardizing the workflow is often more useful than standardizing everyone's client.
Compare actual outcomes, not tool counts
Four MCP tools can address a large API. A large CLI command catalog can expose the same operations. Counting entries tells you little about whether an agent completed the intended job correctly.
Likewise, there is no universal token or speed result implied by the architecture. The client, model, instructions, response size, pagination, and number of requests all affect a real run. Measure the work you need instead of importing a result from an unrelated integration.
Keep the evaluation task constant
Use one sandbox project and one bounded task. For a read test, ask each route to find a named flag and identify its enabled environments, current revision, and relevant dependencies. For a write test, use separate temporary keys with the same reviewed disabled-flag requirements.
Give both runs the same expected output. Record whether each identified the correct objects, loaded the relevant workflow, handled missing data, and preserved the boundary between creation and exposure. Measure elapsed time and context consumption only alongside those correctness checks.
If one run gets rich workflow guidance and the other gets only a command name, you're testing the guidance as well as the interface. That can still be a useful product evaluation, but describe what changed.
Test failure behavior deliberately
Try a nonexistent object, an existing key, and a credential without the required permission. The agent should identify the failure and stop the dependent action. It should not invent an ID, silently pick another environment, or reinterpret a permission error as permission to retry with a broader credential.
The revision workflow adds another important test: multiple open drafts. When a chain of changes belongs in one revision, the agent must preserve its version rather than repeatedly ask for whichever draft is latest.
A creation receipt and a publication receipt are different artifacts. If your evaluation only checks that a request returned without error, it can miss the point where a proposed change became live or where a draft failed to include the intended edits.
Record the versions behind the result
Capture the CLI version, server version when available, client configuration, and the skill text or revision used. With MCP, inspect the guidance actually returned by the connected server. With installed skills, inspect the local instructions actually loaded.
That record makes a later regression diagnosable. A changed result may come from new guidance, a client update, a changed API, or different product state. “MCP became worse” is too broad to help you fix it.
Build workflows that survive the next client
The most useful consequence of GrowthBook's design is organizational. Engineers, PMs, and analysts can choose the agent surface that fits their work while referring to the same flags, experiments, and metrics.
An engineer can prepare a disabled flag from a terminal. A reviewer can inspect its draft in the app. An assistant connected through MCP can retrieve the same object and explain its state. The handoff should carry an ID, a revision where applicable, the proposed behavior, and the decision still required.
This is where the CLI-versus-MCP question loses much of its importance. Your release procedure doesn't need to be rewritten around each client. The product holds state; the API exposes operations; skills explain the work; the chosen interface delivers access.
Start with one inspection or sandbox creation. Require the agent to return a concrete object and its verified state. Then add the next workflow only when the current one is reliable enough for your team to review.
GrowthBook's feature flag platform gives that work a common place to live. The durable choice is how you connect release control and measurement to your team's process. CLI and MCP are ways to carry that process into the tools people already use.
Start with a common foundation
Set up GrowthBook for the flags, experiments, and metrics your agents will share. Then choose the CLI or MCP connection that fits each team member's work.
Get Started With GrowthBookStandard deviation vs variance: Key differences for A/B testers
A metric can have wide user-to-user variation and still yield a precise experiment estimate.
That is why confusing standard deviation with standard error creates bad A/B testing decisions. A dashboard may show that users differ substantially while the average effect is estimated closely enough to guide a release. Those statements can both be true.
Variance and standard deviation describe spread. Variance works on a squared scale; standard deviation takes its square root to return to the metric's original units. Neither is automatically the uncertainty around an experiment result.
For A/B testers, the useful distinction is practical: use standard deviation to communicate outcome variability, use variance in the calculations that combine uncertainty, and inspect the standard error or interval for the treatment effect. Start by making sure all three describe the correct unit of analysis.
Understand the difference in units
Variance uses squared distances
Outcomes above and below a mean have deviations with opposite signs. Simply averaging those signed deviations gives zero. Variance avoids that cancellation by squaring each deviation before combining them.
The sample variance formula is s² = Σ(xᵢ − x̄)² / (n − 1), where x̄ is the sample mean and n is the number of observations. The symbol Σ means to add the terms across observations.
If the outcome is measured in seconds, variance is measured in seconds squared. That is mathematically useful but less intuitive for explaining a product experience. “Variance is 4 seconds squared” does not mean users differ by 4 seconds.
Standard deviation returns to the original scale
Standard deviation is s = √s². A variance of 4 seconds squared corresponds to a standard deviation of 2 seconds. Both describe the same dispersion, expressed on different scales.
Do not define standard deviation as the average absolute distance from the mean. That is a different measure. Squaring deviations gives large deviations more influence, and taking the square root afterward does not undo that weighting.
| Quantity | What it describes | Units for task time |
|---|---|---|
| Variance | Squared dispersion in outcomes | Seconds squared |
| Standard deviation | Outcome dispersion on the original scale | Seconds |
| Standard error of the mean | Sampling variability of an estimated mean | Seconds |
Neither variance nor standard deviation requires a normally distributed population merely to be calculated. Normality matters for particular interpretations and inferential procedures, not for the existence of these summaries when the required moments are finite.
Calculate both from the same observations
Work through a small dataset
Use four synthetic task times: 2, 4, 4, and 6 seconds. This tiny dataset is for arithmetic, not evidence about a real product or a basis for confident inference.
The mean is (2 + 4 + 4 + 6) / 4 = 4 seconds. Deviations from the mean are −2, 0, 0, and 2 seconds. Their squares are 4, 0, 0, and 4 seconds squared, totaling 8.
Treating these observations as a sample, the usual sample variance is 8 / (4 − 1) = 8/3, or about 2.667 seconds squared. The sample standard deviation is √(8/3), or about 1.633 seconds.
This is a useful check on a report. If someone describes the same sample's variance as 1.633, they have probably substituted the standard deviation. If the units are missing, the mistake is much harder to spot.
Choose sample or population formulas deliberately
If those four observations constitute the entire finite population you want to describe, population variance divides by 4: 8/4 = 2 seconds squared. Population standard deviation is √2, or about 1.414 seconds.
The population and sample distinction depends on what you are estimating. Having every recorded event from an experiment does not necessarily make those events the full population of future users or future conditions you care about.
The n − 1 denominator makes the usual sample variance an unbiased estimator of population variance under independent, identically distributed sampling with finite variance. It does not make the square root exactly unbiased for population standard deviation. Nor does it correct biased sampling or dependence between observations.
Verify the calculation with explicit function names
Python's statistics functions distinguish sample calculations from population calculations. With Python 3 installed, this standalone example requires no external packages or data:
The first line of output is 2.667 1.633; the second is 2 1.414. The different denominators explain the difference. Before comparing statistics from two tools, check their sample/population defaults and handling of missing values.
Find the noise you can reduce
Explore practical variance reduction methods, including metric design and CUPED, and the conditions that make each approach useful.
Read the Variance Reduction GuideUse standard errors for experiment uncertainty
Distinguish users from estimated means
Standard deviation describes how users' outcomes vary. Standard error describes how an estimator would vary across repeated samples. For an independent sample, the estimated standard error of its mean is s / √n.
Suppose a user-level task-time metric has a sample standard deviation of 20 seconds among 10,000 independent users. The estimated standard error of the mean is 20/√10,000 = 0.2 seconds. Large differences between users coexist with a much smaller uncertainty around their average.
Collecting four times as many independent users would halve this standard error if the outcome variance stayed similar. It would not mechanically halve user-level standard deviation. The individual experience remains variable even as the estimated mean becomes more precise.
Combine arm variances before taking the square root
For independent treatment and control groups, a simple unadjusted difference in means has estimated variance s²ₜ/nₜ + s²꜀/n꜀. Its standard error is the square root of that sum. You do not add the two arm standard deviations and call the result the experiment's uncertainty.
Take a separate synthetic summary with 10,000 independent users in each arm and a 20-second standard deviation in both. The variance of the estimated difference is 400/10,000 + 400/10,000 = 0.08 seconds squared. Its standard error is √0.08, about 0.283 seconds.
If the observed treatment-minus-control difference is −1 second, an illustrative large-sample, unadjusted 95% normal interval is −1 ± 1.96 × 0.283, approximately −1.554 to −0.446 seconds. Negative values mean faster completion under this metric definition.
This example assumes independent groups and an appropriate large-sample approximation. It is not the exact output of GrowthBook's relative-lift, sequential, covariate-adjusted, or ratio-metric methods. GrowthBook's statistical details describe how the platform estimates effects and their uncertainty.
Avoid interpreting intervals as outcome ranges
That interval concerns the mean treatment effect. It does not say that 95% of individual users improved by between 0.446 and 1.554 seconds. An individual user's causal effect is a different quantity, and the experiment does not observe both potential outcomes for the same person.
Likewise, mean ± one standard deviation is not a universal statement about where 68% of users fall. That familiar interpretation depends on an approximately normal distribution. Skewed task times or revenue can look very different.
The frequentist confidence level describes the repeated-sampling coverage of the interval procedure under its assumptions. It is not a posterior probability assigned to a fixed realized interval.
Check what your metric actually measures
Match the variance to the randomization unit
If users are randomized and each contributes many requests, request rows are not automatically independent experimental units. Treating 100 requests from one person as 100 unrelated users can make uncertainty look smaller than it should.
Define the outcome at the intended unit or use a method that accounts for clustering. GrowthBook's aggregate data requirements are relevant when supplying precomputed summaries: the sample size, sum, and dispersion must correspond to the statistic and analysis method.
Two teams can report different standard deviations without either making an arithmetic mistake. One may summarize per-request latency while the other summarizes each user's average latency. They are describing different outcome distributions. Clarify the grain before comparing their numbers.
Paired measurements need another distinction. If the same users provide before-and-after outcomes, the measurements within each pair can be correlated. Analyze each user's difference or use an appropriate paired method; do not apply the independent-arm formula automatically. The paired-means framework treats those differences as the observations of interest. Pairing also does not remove time trends or establish causality by itself; the design still determines which comparison is defensible.
Inspect tails instead of deleting them casually
Large observations influence both variance and standard deviation. A few unusually long tasks can dominate a time metric; a few large purchasers can dominate revenue. Determine whether those values reflect valid behavior, instrumentation defects, retries, or unit errors.
A valid expensive user is not automatically an outlier to discard. Removing high values after seeing an experiment result can change the estimand and introduce selective analysis. Decide justified exclusions or transformations before interpreting the test.
Report complementary summaries when they answer useful questions: a histogram, median, or a relevant tail percentile can show what a single spread measure hides. Those summaries do not replace the mean effect if the mean remains the decision metric.
Keep units consistent across pipelines
Converting seconds to milliseconds multiplies every value by 1,000. Standard deviation also multiplies by 1,000, but variance multiplies by 1,000,000. A dramatic numerical variance increase can therefore be a unit conversion rather than a product regression.
For the four-value example, sample standard deviation becomes approximately 1,633 milliseconds and variance becomes approximately 2,666,667 milliseconds squared. The underlying task times have not changed. Store units with metric definitions and inspect them when comparing dashboards.
A lower variance caused solely by rescaling a metric does not create more statistical information. The effect size rescales too. Separate a numerical change in units from an actual improvement in the precision of your estimate.
Also avoid averaging standard deviations from daily reports and labeling the result a weekly standard deviation. The complete-period spread depends on both variation within days and differences between daily means. Keep the underlying observations or sufficient summaries that support the intended calculation. A simple average of displayed daily values generally loses information needed to reconstruct the full distribution.
Turn spread into a better testing plan
Define the outcome before planning the sample
Start with the metric definition: population, identity, aggregation, window, units, exclusions, and desired effect. Estimate variability from representative historical data at that same grain.
Historical variance is an input, not a guarantee. New traffic, a different user mix, or a changed measurement window can alter it. Explore plausible variance and effect-size assumptions rather than treating one historical number as exact.
Keep the two arm variances separate when appropriate. A treatment can change variability as well as its mean. The simple equal-standard-deviation illustration above is a teaching assumption, not a requirement that production groups have identical spread.
Reduce estimation noise without hiding behavior
CUPED and post-stratification use suitable pre-experiment information and covariates to improve effect estimation. CUPED stands for Controlled-experiment Using Pre-Experiment Data. Its value depends on useful predictive information and a valid implementation.
Adjustment can reduce uncertainty in the treatment effect without making real users' outcomes less variable. That distinction prevents a reporting error: a narrower adjusted interval is not evidence that customers now experience a more consistent product.
Also separate missing data from genuine zeros. A user with no purchase may correctly contribute zero revenue; a missing instrumentation event might represent an unknown outcome. Treating both identically can distort the mean and its variance before any statistical engine sees the data.
Report the right quantity for the decision
| Reader's question | Useful quantity |
|---|---|
| How much do individual outcomes differ? | Standard deviation, with distribution context |
| What enters this uncertainty calculation? | Variance at the correct analysis unit |
| How precisely is the effect estimated? | Standard error and an appropriate interval |
| Is the measured difference worth acting on? | Effect size, uncertainty, guardrails, and decision context |
For a clear experiment readout, show the metric's unit and analysis grain, the estimated effect, and its appropriate uncertainty interval. Add outcome spread when it helps readers understand the population or diagnose a noisy metric.
GrowthBook's experimentation platform brings defined metrics and statistical analysis together. A trustworthy interpretation still starts with your measurement choices: describe spread with standard deviation, calculate with variance where required, and judge precision using the estimator's uncertainty.
Build a clearer experiment readout
Connect your metrics to GrowthBook and evaluate effects with the analysis method and measurement definitions your team has chosen.
Get Started With ExperimentationCatching 80 defects means little until you know how many defects existed.
Suppose a detector flags 125 suspicious software changes. Engineers inspect them and confirm 80 real defects. That tells you something about alert quality, but it does not tell you how many defects the detector missed. To calculate true positive rate, you need the actual positives outside the alert queue too.
True positive rate, or TPR, measures the share of actual positive cases that a system correctly identifies. It is also called recall or sensitivity. The formula is TP / (TP + FN), where TP means true positives and FN means false negatives.
The arithmetic is simple. Choosing the right population, labels, threshold, and denominator is the difficult part. This guide works through an engineering example, distinguishes neighboring metrics, and explains what changes when the “test” is an A/B experiment rather than an item classifier.
Start with actual positives, not alerts
Define the positive class
“Positive” means the condition you want to detect. It does not necessarily mean a good outcome. In a defect detector, positive means a real defect. In a spam filter, it means spam. Write that definition before calculating anything.
A true positive is an item that is actually positive and predicted positive. A false negative is actually positive but predicted negative. Those two groups together form the denominator: all actual positives in the evaluation sample.
The recall definition is therefore conditional on actual class membership. TPR asks, “Among the real defects, what proportion did we catch?” It does not ask, “Among the alerts, what proportion were real?”
Fix the unit and observation window
Choose a consistent evaluation unit. A code change, an individual finding, and a repository are different units. If one change generates 12 duplicate alerts, counting alerts in the numerator and changes in the denominator produces a meaningless rate.
For the example, each unit is one code change, evaluated once by one fixed detector version at one fixed threshold. An independent review process eventually labels each change as defective or not defective. The observation window is long enough for those labels to mature.
This resembles the discipline needed when defining experiment metrics: the event, identity, time window, and denominator must describe the same question. A correct formula applied to incompatible counts still gives the wrong answer.
Calculate TPR from the confusion matrix
Put every evaluated item in one cell
Consider an original synthetic evaluation of 1,000 code changes. Reviewers establish that 100 contain a defect and 900 do not. The detector catches 80 defects, misses 20, and incorrectly flags 45 nondefective changes.
| Actual label | Predicted positive | Predicted negative | Total |
|---|---|---|---|
| Defective | 80 true positives | 20 false negatives | 100 |
| Not defective | 45 false positives | 855 true negatives | 900 |
| Total | 125 | 875 | 1,000 |
Read the labels rather than relying on cell position. Libraries and reports can arrange axes differently. The scikit-learn confusion matrix convention uses actual classes on rows and predicted classes on columns, with class order also affecting where each value appears.
Check the totals before calculating rates. The four cells sum to 1,000. True positives plus false negatives sum to 100 actual defects. Predicted positives total 125, which is a different denominator.
Divide detected positives by all actual positives
The calculation is:
TPR = TP / (TP + FN) = 80 / (80 + 20) = 80 / 100 = 0.80 = 80%.
Interpret it in words: the detector caught 80% of the actual defects in this evaluation sample. It missed 20%, so the false negative rate is 20%. For a binary task with complete labels, TPR and false negative rate sum to 100%.
Do not divide 80 by 1,000. That would measure true positives as a share of all evaluated changes, not recall. Do not divide 80 by 125 either. That is precision, which answers the alert-quality question.
The result describes this sample and threshold. It does not establish that every future workload will have the same recall, or that all defect categories are equally detectable. Keep the counts beside the percentage so readers can see the support behind it.
Handle zero positive support explicitly
If the sample contains no actual defects, TP + FN equals zero. Sample TPR is undefined. Returning 0% would imply the detector missed known defects; returning 100% would imply it successfully found them. Neither interpretation is supported.
Software libraries need a practical zero-division convention. That convention can return a placeholder or warning, but it does not create evidence. Report “TPR unavailable: zero actual positives” and preserve the support count. A pipeline can then distinguish an unevaluable slice from measured poor performance.
Check the experiment error risks
See how power, repeated checks, and multiple comparisons affect the reliability of experimental decisions beyond a single classifier score.
Read the False Positives GuideCompare TPR with precision and false positives
Keep the denominators visible
For the same 1,000 changes, the other common metrics tell different stories:
| Metric | Calculation | Result |
|---|---|---|
| True positive rate / recall | 80 / 100 actual positives | 80% |
| Precision | 80 / 125 predicted positives | 64% |
| False positive rate | 45 / 900 actual negatives | 5% |
| Specificity | 855 / 900 actual negatives | 95% |
| Accuracy | (80 + 855) / 1,000 changes | 93.5% |
The classification metric definitions differ because they condition on different populations. Here, 36% of alerts are false, but the false positive rate is 5%. Calling both numbers “the false positive rate” hides the operational distinction.
Accuracy can also look reassuring in an imbalanced population. A detector that labels all 1,000 changes nondefective would be 90% accurate while detecting none of the 100 defects. TPR exposes that failure, though it still needs the false-positive side of the picture.
Choose a threshold for the decision
Suppose a stricter threshold, evaluated on the same labeled changes, catches 60 defects and incorrectly flags 10 nondefective changes. Its TPR is 60%, its precision is about 85.7%, and its false positive rate is about 1.11%.
This threshold reduces the review queue from 125 changes to 70. It also misses 40 defects instead of 20. Whether that tradeoff is acceptable depends on the consequences of a missed defect, the review team's capacity, and what action follows an alert.
A ROC curve plots TPR against false positive rate across thresholds. It helps compare operating points. It does not pick the operational threshold for you, and an area-under-curve summary does not specify the queue size at the threshold you intend to deploy.
If you tune thresholds using the same labels you later report as a final evaluation, the score can be optimistic. Use separate validation and held-out evaluation data, or another defensible evaluation design, and freeze the decision rule before the final assessment.
Specify the action at each threshold too. A low-confidence finding might create a suggestion, while a high-confidence finding might block a merge. Those are different interventions with different error costs. One aggregate recall figure should not imply that every detected item received the same treatment.
Make sure the labels can support the claim
Audit predicted negatives too
If engineers review only alerts, you can estimate precision within the reviewed alert population. You cannot directly count missed defects among unreviewed negatives. Assuming those changes are clean makes FN artificially small and TPR artificially high.
An evaluation may need independent review of a representative sample of predicted negatives, delayed incident labels, or a curated benchmark with known defects. Each approach has limits. Incident labels miss undetected failures; curated examples can differ from ordinary production work.
If the evaluation oversamples suspicious changes or certain repositories, report that design. Use appropriate weighting when estimating performance for the real workload. A simple unweighted confusion matrix describes the sampled dataset, which may not represent the deployed population.
Preserve uncertainty and segment support
An 80% estimate based on 4 detected defects out of 5 is much less precise than one based on 800 out of 1,000. The important sample size for recall is the count of actual positives, not just the total number of changes evaluated.
Report positive support by important slices, such as language, defect category, or repository type. A high pooled TPR can hide weak performance on a rare but expensive failure mode. At the same time, avoid declaring tiny slices definitively better or worse from a few examples.
Counts alone do not make observations independent. Many similar changes from one repository can share a common pattern. Use uncertainty methods that fit the evaluation design rather than assuming every row is an unrelated trial.
Separate label delay from label absence
A recently deployed change might appear nondefective because nobody has had time to find the bug. Treating it as a confirmed negative gives the newest cohort a different labeling standard from older cohorts.
Define when an item becomes eligible for evaluation and track unresolved labels separately. Keep model version, threshold, label version, and observation dates with the result. That makes a later score change interpretable: you can tell whether the detector changed, the workload changed, or the labels matured.
For a warehouse-native measurement workflow, these definitions belong in the underlying data model. Joining model decisions to review outcomes still requires identity and time alignment; a queryable warehouse does not automatically resolve ambiguous ground truth.
Keep comparable populations together
When comparing detector versions, evaluate them on the same held-out cases where possible. Otherwise, an apparent recall improvement could come from an easier mix of defects. Preserve a breakdown of new, removed, and unchanged cases so reviewers can see what changed between evaluations.
When combining reports, add the underlying TP and FN counts for nonoverlapping, consistently defined populations, then calculate the pooled rate. An unweighted average of repository percentages answers a different question because it gives a tiny repository the same influence as a large one. Either summary can be useful, but label the weighting explicitly.
If the same change appears in several reports, deduplicate or model that repeated observation before pooling. Repeated scans do not create additional independent defects. Keep an audit trail from the final counts back to the evaluated item identifiers so a suspicious rate can be investigated.
Connect detection quality to product decisions
Distinguish classifier recall from statistical power
In hypothesis testing, statistical power is the probability that a testing procedure rejects the null when a specified alternative is true. It is a repeated-test detection probability, depending on assumptions such as effect size, variance, sample size, and decision rule.
That is related to the idea of detecting a real signal, but it is not the same dataset as a labeled-item confusion matrix. In an ordinary A/B program, you do not observe the true causal effect of every experiment with certainty. Dividing declared winners by all experiments does not reveal a ground-truth TPR.
Power planning asks how often your procedure would detect a particular real effect under its assumptions. A classifier evaluation asks how many labeled positives were detected in the evaluated sample. Keep those questions separate when discussing GrowthBook's statistical methods.
Evaluate the intervention as well as the detector
An improved offline detector can still create a worse product workflow. More alerts might overwhelm engineers, delay releases, or catch defects too late to matter. Conversely, a modest recall change might be valuable if it catches the failures with the highest operational cost.
When appropriate, use randomized experiments to evaluate the downstream intervention: which review experience helps teams resolve defects, with what delay and cost? Keep detector recall, review workload, and product outcomes as separate measures.
GrowthBook's experimentation platform can analyze defined outcomes from such tests. Your team supplies reliable assignment, exposure, labels, and metric definitions. Neither a high TPR nor a significant product result eliminates the need to inspect the other evidence.
Use a repeatable reporting checklist
Before sharing a TPR number, state the positive class, evaluation unit, detector version, threshold, and label process. Show TP and FN beside the rate. Include precision or false positive rate so readers can assess the workload created by detection.
Then ask whether predicted negatives were evaluated, whether labels had time to mature, and whether the sample reflects the population where you will act. Mark zero-support slices unavailable and explain material gaps in coverage.
The useful result is a statement someone can audit: “At this threshold, the detector found 80 of 100 labeled defects in these 1,000 evaluated changes, while producing 45 false alerts.” That is a clearer basis for a decision than “our model is 80% accurate.”
Measure what the change delivers
Connect your data and defined metrics to GrowthBook to evaluate how a product or workflow change affects the outcomes your team cares about.
Start Measuring With GrowthBookReady to ship faster?
No credit card required. Start with feature flags, experimentation, and product analytics—free.





