# A/B testing

> A/B testing is a method of comparing two versions of a system, such as two prompts, models or interfaces, by showing each to a different group of real users and measuring which performs better on a chosen outcome.

Also called: split testing, A/B test, online experiment, bucket testing. Category: Delivery and quality. Source: https://aibuildindex.com/glossary/ab-testing

## In the index

- Recommendation system: median $1,850, middle half $560 to $4,700, 67 priced briefs (https://aibuildindex.com/cost/recommendation-system)
- Outbound email personalisation: median $2,000, middle half $400 to $6,850, 208 priced briefs (https://aibuildindex.com/cost/outbound-personalization)

Offline tests show whether an AI system gives correct answers. They do not always show whether it changes what users do. A/B testing answers the second question. Real traffic is split between version A and version B, and the business compares an outcome that matters: replies to an outbound email, purchases from a recommendation, tickets resolved without a human. The winning version becomes the default, and the test moves on to the next idea.

## How it works

A test needs four things:

- **One change.** Two versions that differ in one meaningful way, such as a new prompt, a different model or a new layout of suggestions.
- **A random split.** Users or requests are assigned to each version at random, so the groups are comparable.
- **A clear measure.** One main outcome, decided before the test starts, such as reply rate or conversion.
- **Enough traffic.** Small differences need many users before they can be told apart from chance.

For AI systems, A/B testing usually follows offline [evals](https://aibuildindex.com/glossary/evals). Evals filter out versions that are clearly worse; the A/B test then picks between the ones that pass. Routing a share of traffic to a new model works much like [model routing](https://aibuildindex.com/glossary/model-routing), and the results depend on good [observability](https://aibuildindex.com/glossary/observability) to record which version each user saw and what happened next.

It is most common in systems with many users and a measurable result, such as a [recommendation system](https://aibuildindex.com/glossary/recommendation-system) or personalised outreach.

## What it means for cost

Supporting A/B tests adds work to a build: a way to serve two versions at once, consistent assignment of users, logging of outcomes, and a report to compare them. For a low-traffic internal tool this is rarely worth it, because the results would take too long to become clear. For a customer-facing system where small improvements are valuable, it can be one of the better investments in the build.

Ask a builder:

- Does our traffic support A/B testing, or would results take too long?
- Which outcomes can the system measure from day one?
- How will a losing version be switched off safely?

## Common mistakes

Changing several things at once, so the cause of any difference is unclear. Stopping a test as soon as one version looks ahead. Measuring something easy, such as clicks, instead of the outcome the business cares about.

## Common questions

### Do small businesses need A/B testing for AI systems?

Often not. With low traffic, a test can take months to give a reliable answer. Careful offline evaluation and direct feedback from users usually give clearer guidance at that scale.

### Can A/B testing compare two AI models?

Yes. Sending a share of requests to each model and comparing outcomes is a common way to decide whether a newer or cheaper model is good enough. Running evals first keeps a clearly worse model away from real users.

## Related terms

- [Evals (AI evaluation)](https://aibuildindex.com/glossary/evals): Evals are structured tests that measure how well an AI system performs on a fixed set of realistic inputs, scoring its outputs so that changes to prompts, models or data can be judged by evidence rather than impression.
- [Observability](https://aibuildindex.com/glossary/observability): Observability is the ability to see what a live system is doing and why, through logs, traces and metrics, so that errors, slow responses, rising costs and poor AI outputs can be found and explained.
- [Recommendation system](https://aibuildindex.com/glossary/recommendation-system): A recommendation system is software that predicts which products, content or actions a particular user is most likely to want, based on their behaviour, the item's attributes and what similar users chose, and ranks options accordingly.
- [Deployment](https://aibuildindex.com/glossary/deployment): Deployment is the process of moving a finished build from a builder's development setup into the live environment where real users and real data reach it, including hosting, configuration, secrets and release steps.
- [Model routing](https://aibuildindex.com/glossary/model-routing): Model routing is the practice of sending each AI request to the most suitable model, for example a cheap, fast model for simple tasks and a more capable one for hard cases, based on rules or a classifier.
