# Offline vs Online Evaluation?

> The fixed test you run before release, the live checks you run after it, and why a good AI team uses both, explained for your AI interview.

**In short:** Offline evaluation tests an AI system before release, on a fixed set of questions with known good answers, while online evaluation checks real user traffic after release, usually on a sample. Teams use both, because a fixed test set can miss what real users ask.

AI and LLM interview question Q247, Evaluation and observability. Intermediate, very common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/offline-vs-online-evaluation

## Say it in 30 seconds

Offline evaluation tests my AI system before release, on a fixed set of questions with known good answers. Online evaluation checks real traffic after release, usually on a sample of chats. Offline is repeatable and runs on every change, but it only tests what someone wrote down. Online finds what users actually ask, but by then a bad answer may already have reached them. So I run both, and every real failure goes back into the test set.

## Say it in 2 minutes

Offline evaluation is the test I run before a release. I keep a fixed set of questions, each with a known good answer, and run the system on all of them. The score is repeatable, so I can compare this release with the last one. It runs on every change, like the automatic checks a developer runs before shipping code.

Online evaluation is the check after release. I take a sample of real chats, score them, and watch for failures. It shows what users really ask, which my test set can miss, such as a new fee question nobody wrote down. The cost is that a bad answer has already reached a customer before I see it.

Here is a bank's fee bot. Its test set still had the old cash advance fee, so the offline score stayed at 96 percent while the real answer was wrong. In its sample, the team found nine wrong answers in one week, which showed a real problem. I added those sampled chats to the test set, so the next release is checked for them too.

So I run both. Offline is the gate before release, and online is the alarm after it. Neither one proves the system is safe, but together they help catch drift and failures early.

## What is offline vs online evaluation, in plain words?

Evaluation means checking how well an AI system does its job. Offline evaluation checks it before users see it, using a fixed set of questions with known good answers. Online evaluation checks it after release, using real user chats or requests.

Think of a pilot's simulator session before a flight, and the incident reports from real flights. The simulator is repeatable and safe, but it cannot copy every storm. The reports show what it missed, after someone was affected. An AI system works the same way: the test set is the simulator, and live traffic is the flight.

- **Offline evaluation:** Tests run before release, on a fixed set of cases you control.
- **Online evaluation:** Checks on live traffic after release, usually on a sample.
- **Test set:** The fixed questions with known good answers, reused on every run.
- **Sample:** The small share of live chats picked for scoring, such as one in fifty.
- **Production traffic:** The real requests users send once the system is live.

The running example is a bank's fee bot, which answers customers' questions about fees.

## How do offline and online checks differ?

Offline checks run in the build, before a release, and they are cheap to repeat. The same cases go in each time, so two releases can be compared fairly. Anthropic's engineering team rates these automated evals as fully reproducible and able to run on every commit, but warns they can give false confidence if they do not match real usage.

- **Offline: Before release.** A fixed test set, the same on every run. Cheap to repeat on each change, but it only tests what someone wrote down.
- **Online: After release.** Sampled scoring of real traffic, plus user feedback and A/B tests. It finds what users really ask, but by then a bad answer may have reached someone.

LangChain's LangSmith documentation draws the same line. Offline evaluations, it says, "Offline evaluations run on datasets and examples." Its online side feeds failures back into the offline set: "Production feedback: Identify issues to add to offline datasets."

Microsoft's Foundry guidance describes two checks after launch. Continuous evaluation scores production traffic at a sampled rate. Scheduled evaluation runs a fixed test dataset again and again to spot drift, the slow change in real use that makes a test out of date. It does not fit the simple before and after split, because it runs after launch but still uses a fixed test set.

> "Continuous evaluation: Quality and safety evaluation of production traffic at a sampled rate" (Microsoft Foundry)
>
> "Scheduled evaluation: Scheduled quality and safety evaluation using test datasets to detect system drift" (Microsoft Foundry)

*Diagram, How the two checks feed each other: The fixed test runs before release. After release, a sample of real chats is scored. Each real failure goes back into the test set, so the next release is checked for it too.*
1. The same questions go into the test, every time.
2. Only a version that passes the test goes live.
3. Real users start chatting with it.
4. A small share of those chats is picked and scored.
5. Wrong answers are flagged for a person to read.
6. The real case joins the test set, so the next release is checked for it.

## How does this work for a bank's fee bot?

The bank's test set has 300 questions with approved answers. Before each release, the team runs the bot on all 300. A customer might ask "What is the cash advance fee on my card?" and the bot's answer is compared with the approved fee table.

1. **Before release:** Run the 300-question test set. 288 answers pass, which is 96 percent, so the release goes out.
2. **Two weeks later:** The cash advance fee rises. The test set still has the old fee, so the offline score stays at 96 percent.
3. **Online check:** Score every 50th live chat against today's fee table. The sample shows nine wrong cash advance answers in the first week.
4. **Fix the loop:** Put the new fee into the test set, add the nine sampled chats, and fix the bot's source before the next release.

Here is a simplified version in plain Python. It has three test questions, not 300, and the bot is only a stub that repeats its old answers.

Exact matching works for a fee figure. Free-text answers need a grader, such as a checklist of what a good answer must say, a second AI model that scores answers, or a person, because one right answer can be worded many ways.

```python
# A made-up bank's fee bot. The test set is old: the cash advance fee rose from 4 to 5 last month.
TEST_SET = {"late payment fee": "25", "foreign transaction fee": "3", "cash advance fee": "4"}
FEE_TABLE_TODAY = {"late payment fee": "25", "foreign transaction fee": "3", "cash advance fee": "5"}
LIVE_CHATS = [
    ("late payment fee", "25"),
    ("cash advance fee", "4"),
    ("foreign transaction fee", "3"),
    ("late payment fee", "25"),
    ("cash advance fee", "4"),
]

def bot(question):  # stands in for the model, which repeats its old answers
    return TEST_SET.get(question, "not sure")

# OFFLINE: run the fixed test set before release.
passed = sum(bot(q) == a for q, a in TEST_SET.items())
print(f"Offline: {passed} of {len(TEST_SET)} passed")

# ONLINE: score a sample of live chats (here every second one) against today's fee table.
sample = LIVE_CHATS[1::2]
wrong = [q for q, a in sample if FEE_TABLE_TODAY[q] != a]
print(f"Online: checked {len(sample)} of {len(LIVE_CHATS)} chats, {len(wrong)} wrong")
```

Output:

```text
Offline: 3 of 3 passed
Online: checked 2 of 5 chats, 1 wrong
```

## What are the limits, and what do teams add?

Neither check is enough alone. Offline checks miss what nobody wrote down. Live checks show the bad answer only after a user has seen it. Anthropic's complete picture also lists user feedback, A/B tests, transcript review and human scoring.

> "A complete picture includes production monitoring, user feedback, A/B testing, manual transcript review, and systematic human evaluation." (Anthropic)
>
> "Set up continuous evaluation (CE) to run evals on every change, monitor your app to identify new cases of nondeterminism, and grow the eval set over time." (OpenAI)

OpenAI's guide also warns about test sets that do not copy real traffic patterns, so the set itself needs checking against live use. Anthropic adds that production monitoring kicks in after launch to detect distribution drift (the slow shift in the traffic the system sees) and unanticipated real-world failures.

> **Tip:** Asked about the limits? Say offline tells you a change did not break the test, and online tells you what real users meet. Then say neither one proves the system is safe.

### How would you set up checks for a claims agent?

An agent at a mid-size insurer reads claim forms and routes each one to the right team. Before launch, I build a test set from 500 past claims, each with the adjuster's real decision, and run it on every change. A release that falls below the agreed pass rate is blocked.

- **Before launch: Fixed test set.** 500 past claims, run on every change. Below the agreed pass rate, the release is blocked.
- **After launch: Sampled live claims.** A share of new claims is scored. Low-confidence routings go to a person to check.

Every wrong route becomes a new test case, so the test set grows with the real work.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] A plain split: offline before release on a fixed test set, online on live traffic after it.
- [ ] Why both: a test set cannot copy every real user, and live checks find failures after users do.
- [ ] Sampling: score a share of live chats, so checks stay affordable.
- [ ] The loop: every real failure goes into the test set.
- [ ] Run the tests on every change, not once a quarter.
- [ ] Honest limits: neither check proves the system is safe.

**Common traps**

- Trap: "Our offline score is 96 percent, so we are fine." Better: The score only says the test passed. Check the test set against live traffic too.
- Trap: "Live checks are the real test, so we can skip the offline one." Better: Live checks find failures after users see them. Run the offline test first, so bad releases stop early.
- Trap: "A bigger test set always fixes it." Better: Coverage matters more than size. Add the real failures, and check the set matches production traffic.

## Can you spot the gap?

**Spot the gap:** A team's offline score has been 96 percent for six months, but customers keep reporting wrong fees. Which setup line is the warning sign?

A. Offline set: 300 questions with approved answers, last updated 14 months ago.
B. Live sample: every 50th chat is scored against today's fee table.
C. Release gate: a version ships only if the offline pass rate is 95 percent or more.
D. Logs: chat text is kept for 30 days and used only for scoring.

**Answer:** A. The offline set is 14 months old, so it still has old fees and passes the bot for the wrong answers. Live sampling against today's fee table is the check that would catch the gap.

**Quick check:** An agent passes its offline test set on every release, yet users report wrong answers. What should the team add first?

A. A longer system prompt
B. Sampled live checks, with each real failure added to the test set
C. A bigger model for the same test set
D. A lower temperature on the test run

**Answer:** B. The offline results are only as good as the test set. Sampled live checks show real traffic, and each failure feeds back into the test set. A longer prompt or a bigger model cannot fix a test set that misses the questions users ask.

## Can you answer these from memory?

**Flash cards**

- **Offline evaluation?** Tests before release, on a fixed set of cases with known good answers.
- **Online evaluation?** Checks on real traffic after release, usually on a sample of chats.
- **Main weakness of offline?** It only tests what someone wrote down, so it can give false confidence.
- **Main weakness of online?** A bad answer may already have reached a user before anyone sees it.
- **What is OpenAI's continuous evaluation?** Running the tests on every change, and growing the test set over time.
- **Where do real failures go?** Into the test set, so the next release is checked for them too.

## Likely follow-up questions

- Q246 How do you know your AI system actually works? https://designervenkat.online/interview/ai/how-to-know-your-ai-system-works
- Q248 What is a golden dataset, and how do you build one? https://designervenkat.online/interview/ai/what-is-a-golden-dataset
- Q249 What is LLM-as-a-judge? https://designervenkat.online/interview/ai/what-is-llm-as-a-judge
- Q251 How do you calibrate a judge against humans? https://designervenkat.online/interview/ai/how-do-you-calibrate-a-judge-against-humans
- Q264 When do you need human evaluation? https://designervenkat.online/interview/ai/when-do-you-need-human-evaluation

## Learn it in depth

- [LLM Evaluations](https://designervenkat.online/learn/ai-engineering/llm-evaluations)
- [Production monitoring](https://designervenkat.online/learn/ai-engineering/production-monitoring)
