Offline vs. Online Evals: How to Keep Evaluating Your AI App After It Goes Live
From the publisher’s feed, collected in the ZeroLabs newsroom.
LLM Evaluation 106: Offline vs Online Evals — How to Keep Evaluating Your AI App After It Goes LivePart 6 of the LLM Evaluation series, picking up right where “LLM Evaluation 105” left off.Offline evals check your app before it ships. Online evals keep watching it after it ships (Image by the author)TL;DREverything we’ve done so far in this series is offline evaluation: testing an LLM app on a golden dataset before you deploy it. Offline evals give you three big wins: a release gate, version comparison, and regression testing. But once the app is live, three new risks appear that no golden dataset can catch: unexpected user inputs, failures that only show up at scale, and drift. That’s where online evaluation comes in. It evaluates live production traffic, with no answer key. This post covers the difference between the two, the idea of correctness vs. normalcy, and how to build an online eval pipeline step by step: logging → (sampling → evaluator) → dashboard → alerts. It ends with the self-improving loop that ties offline and online evals together.A quick recap firstHere’s what we’ve covered in this series so far:Why we need evals: LLM Evaluation 101What evals are: model evals vs. application evals, in LLM Evaluation 102What an eval pipeline looks like: LLM Evaluation 103Why one app needs multiple eval pipelines: LLM Evaluation 104. There were two reasons. First, there are multiple failure points: things can break at the component level, the workflow level, or the whole application level. Second, there are different risk categories: quality, safety, and operations (latency and similar metrics).The three eval methods: programmatic, human, and LLM-as-a-Judge, in LLM Evaluation 105.Today’s topic is a very important one: offline evals vs. online evals. First we’ll see what offline evals are, then what online evals are, and then how the two differ. You’ll pick up a lot along the way.Part 1: Offline evalsWhat is an offline eval?Good news: there’s nothing new to learn here. You already know offline evals. Every eval pipeline we built in the previous parts of this series was an offline eval.Here’s the simple definition:An offline eval is any eval you run on your LLM application before you deploy it.Remember the AI exam grader from Part 5? We built an LLM app that grades written civil services mock-test answers just like a human expert would. We built a golden dataset, used LLM-as-a-Judge as the method, and ran the eval. All of that happened after the software was built, but before it was deployed. That makes it an offline eval.So, in plain words: whenever you have an LLM app and you want to fully test it to see whether it’s ready to deploy, the evals you run are called offline evals. That’s it. We didn’t learn anything new. We just gave a name to what we already know.Why do we need offline evals at all?Why not just build the LLM app and deploy it straight away?Because if you deploy without testing, you have no idea how it will behave in production, and anything can go wrong.Offline evals give you three big benefits.Benefit 1: Pre-release testing (and a release gate)The first and most obvious benefit: you can test the app properly before you release it.But it gets better. In real teams, this whole process (build → test → deploy) is automated with CI/CD. You can set up a simple gate:If the eval score is above 95% → deploy the new version.If it’s below 95% → don’t deploy, and send a notification that the eval failed. The app stays on (or rolls back to) the previous version.Here’s how it works step by step:You make some changes to your app.You push your code to Git.A CI job is triggered (for example, with GitHub Actions).The CI job runs your eval script, which gives you a score.If the score is above the threshold, the deployment pipeline starts automatically. If it’s below, you get a notification that the eval tests failed.So the offline eval isn’t just a test. Used properly, it works as a release gate.Benefit 2: Comparing versionsThe second big benefit: offline evals let you compare different versions of your app.Say you’re building the exam grader and you can’t decide between a Claude model and an OpenAI model. Everything else in the code is the same. Only the model is different. Which one gives better results for your use case?Easy. Build two versions of the app and run the same eval on both. Since the eval is the same and the golden dataset is the same, the playing field is level. If Claude scores higher, you go with Claude.You can do this for anything:Different promptsDifferent modelsDifferent rerankersDifferent vector databasesDifferent architectures of your whole applicationWhenever you’re stuck between two or more options, your eval tells you which one to pick, by running it on each version of the software.Benefit 3: Regression testingThe third benefit is regression testing, a well-known term in software.Regression testing means checking that a change didn’t break something that used to work.Here’s an example. Version 1 of our ed-tech platform’s chatbot is already live, and students are chatting with it. In production, we notice a pattern: whenever students ask about refunds, the chatbot answers in a slightly cold tone.We want it to always talk to students in a warm tone. So we go into the system prompt and add an instruction like: “You have to be very kind and very polite. Answer nicely.”After that change, the chatbot’s personality becomes too soft. Someone asks, “What does the premium plan cost?” The real price is 19,500, but to sound nice, the chatbot says “It’s around 19,000.”It’s not a perfect example, but it shows the point. In a complex system, when you improve one thing, something else breaks. Performance goes up in one place and drops somewhere else. That’s called a regression.So whenever you improve your app, you have to make sure that:the thing you’re improving actually improves, andnothing else gets worse.Offline evals help here too. Your golden dataset has all kinds of cases: refund questions, pricing questions, course curriculum questions, and so on. You run the eval on every type and check the results per type.If your success rate on refund questions was 90% before the prompt change, it should stay around 90% after it. If it drops to 80%, that’s a sign of regression, and you shouldn’t ship that change.The idea is simple: whenever you make a small change anywhere (the system prompt, the model, the vector database, anything), nothing else should break.Offline evals in a nutshellWhat they are: everything we’ve studied so far, run before deployment.Benefit 1: test before release (and use it as a release gate).Benefit 2: compare two or more versions when you’re in doubt.Benefit 3: when you change your existing app, check that nothing else breaks.These three benefits are why offline evals are so important. You can’t do without them.Part 2: What can go wrong in production?Say you’ve built your LLM app, run your offline evals, and everything passed. The app is deployed. Now what?Once your app is live, you’ll face three major risks.Three risks that only show up once real users start using your app (Image by the author)Risk 1: Unanticipated user inputsTake our ed-tech chatbot. When we tested it offline, we built a golden dataset of 200–500 questions that we thought users might ask. We tested the chatbot only on those questions.But when we deploy it, we open it up to the real world. Now students can ask anything, including things we never tested for:People suddenly start chatting in a mix of Hindi and English, but we mostly tested in English because we expected English.Ambiguous, half-written questions where you can’t tell what the user wants.Angry rants, with the real question hidden behind a lot of anger.Adversarial prompt injections, where people try to trick the chatbot into giving answers it shouldn’t.Lots of other edge cases.In production, your chatbot faces a much bigger superset of inputs than what you tested it on. That’s the first risk.Risk 2: Emergent and systematic failuresThere are small failures you’ll never see in an offline setup. They only show up once the app is deployed.Problems that only happen at scale. Say the platform launches a new course. Suddenly, lots of people arrive at once, and the chatbot has thousands of concurrent users. Latency shoots up. You could never have tested this offline, because you can’t bring thousands of users into an offline test.Subtle bias that only becomes visible across thousands of conversations. Maybe the chatbot is slightly biased against people from non-technical backgrounds. You’ll only spot this after it has chatted with thousands of people. With enough data, a pattern appears: it talks well with people from technical backgrounds, but something is off when it talks to non-technical people. You can’t catch this in advance.Many systematic failures like these can happen in production that you never anticipated.Risk 3: DriftThis is the most technical of the three. Drift means your offline eval (the one you used to test and approve the deployment) slowly becomes obsolete.Here’s how. Today, we built the chatbot with all our current documents: pricing, course pages, curriculum pages, lecture transcripts.Over the year, things change:A course price changes.A curriculum gets updated.A policy changes.As a business runs, its documents keep changing. A year later, the documents feeding the RAG chatbot may look very different from the ones we started with.But our test cases and golden dataset were built for today’s data. A year later, the whole data and its distribution have changed, so the golden dataset and the whole eval pipeline become kind of obsolete.The result: when we test offline, the eval pipeline still gives good results. But in production, we see lots of negative feedback from users, because they don’t like how the chatbot behaves. It’s all happening because we keep changing things, but we’re not changing our eval setup.So, can offline evals cover these risks?No. And here’s the simple reason.Offline evals need a golden dataset with correct answers, and the evaluation is based on those answers. Once you’re in production, there’s no golden dataset. A user can ask anything, and you don’t have the correct answers. You don’t know which student will ask what tomorrow, or what the right answer to that question is.Conclusion: even after testing with offline evals and deploying, there are many risks in production, and you can’t evaluate them with offline evals.That’s why we need online evals.Part 3: Online evalsWhat is an online eval?Here’s the simplest definition:Online evaluation means evaluating your system on live production traffic, after deployment, as real users interact with it.It’s a different type of evaluation that runs in production, after your software is deployed.Its biggest feature: it works without an answer key. It works without a golden dataset.That’s why it’s so critical. It keeps your deployed software running properly, and it tells you when something is going wrong in production.Offline vs. online: side by side| Aspect | Offline Eval | Online Eval ||-----------------|----------------------------------------|----------------------------------------------|| When | Before deployment | After deployment || Data | Fixed golden dataset you create | Live production traffic || Answer key | Usually yes (the golden dataset) | No. You estimate quality on the go || Timing | Runs before each release | Runs continuously after deployment || Inputs | Only what you anticipated | Anything can come in || Catches | Regressions | Drift, surprises, emergent bugs || Best used for | Release gating, version comparison, CI | Drift detection, real-world performance || Cost & speed | Fast, cheap, repeatable | Can be costly at scale, so you use sampling |A few notes on this table:Cost & speed: offline evals are fast and cheap because you’re running some code and maybe an LLM on a small dataset. Online evals can run at huge scale. If your chatbot has 50,000 conversations a day, judging every one of them gets expensive. So instead of evaluating all 50,000, you sample, say 1,000 of them. That keeps costs down. (More on sampling soon.)Best used for: “gating” here means the release gate from Benefit 1: if the offline score is above the threshold, CI pushes and deploys the code.They are not rivalsThe most important thing to understand here: offline and online evals are not rivals. Online evals don’t replace offline evals. They always run together. They’re complementary, and you need both.Here’s a line worth remembering:Offline evals check whether your application works correctly. Online evals check whether your application is running normally in production.That’s the main purpose of each. You can’t use one in place of the other.Correctness vs. normalcy: the exam grader exampleLet’s make that line concrete with the AI exam grader from Part 5.Offline: we checked correctnessIn the offline eval, what were we trying to do? We wanted to check whether the grader marks answers the same way a human expert does.So correctness there meant: the marks our grader gives should be close to the marks a human gave. We measured that with MAE against human-graded answers.Online: can we still check correctness?Now say we’re happy with the offline results and we deploy the grader. In production, can we measure whether it’s grading correctly right now?No. Because for the answer the grader is marking right now, we don’t know what a human would have given it. There’s no golden dataset for that answer. No human has graded it. Our system is grading it for the very first time.So in production, we can’t measure correctness.Online: but we can check normalcyWhat we can check is: is the system running normally?Here’s a simple way. Store the total score of every paper the grader marks. Then plot the distribution of scores over a one-week window.Say each paper is out of 1,000. In a typical week:Most students score around 500.Quite a few score around 700.Very few score around 200.You look at week 1, week 2, week 3, and week 4. Every week, the distribution looks about the same. This becomes your baseline: “This is what my grader’s scores normally look like.” From now on, you keep comparing production against this baseline.Then, in week 5, the graph suddenly looks very different. Most students are now scoring around 800, and very few are getting 200, 300, or 500.Same grader, same exam, very different score distribution. Something changed in week 5 (Image by the author)Comparing week by week, you can tell something is different this week. Why is the software suddenly giving such high marks?Is that proof of a bug? Not necessarily. The shift could be due to some other trend. Maybe a batch of very strong students took the test that week. But the point is, you’ve been alerted. Something evaluated the system and told you to look. You go and investigate where the problem is.That’s what an online eval does. It can’t always guarantee correctness (sometimes it can, often it can’t). Mostly, it tells you whether your app is running normally.Don’t hold on to this example too tightly. It’s built just to explain the difference between correctness and normalcy. It won’t apply everywhere.Here’s how you could check this in code. A two-sample Kolmogorov–Smirnov test is one simple way to ask “do these two distributions look the same?”:import numpy as npfrom scipy.stats import ks_2samp# Total marks (out of 1000) the grader gave, pulled from your logsbaseline_scores = np.array(load_scores(weeks=[1, 2, 3, 4]))this_week_scores = np.array(load_scores(weeks=[5]))print(f"Baseline mean: {baseline_scores.mean():.0f}")print(f"This week mean: {this_week_scores.mean():.0f}")stat, p_value = ks_2samp(baseline_scores, this_week_scores)if p_value print(f"Score distribution has shifted (KS={stat:.2f}). Investigate!")else: print("Scores look normal compared with the baseline.")“But if there’s no answer key, how do we estimate quality at all?”Good question. There are a few ways.1. Use metrics that don’t need a correct answer. Take a RAG chatbot. You can measure faithfulness: was the answer generated only from the retrieved context? To check that, you don’t need the correct answer. You have the context, and you have the generated answer. Ask an LLM whether the answer comes from that context, and you get a faithfulness score.2. When a metric does need a correct answer, find a clever proxy. In the exam grader example, we didn’t have the right marks, so we compared against a baseline distribution instead.Here’s another one. You want to measure your chatbot’s correctness in production. Every question is new, and you don’t have the right answers. So how can you tell if the chatbot is making mistakes? Is there some other signal you can use in place of the answer key?Yes: user feedback. Say your chatbot has a 👍 / 👎 button. If you suddenly see lots of thumbs-down ratings in the last hour, something has gone wrong. The chatbot is probably giving wrong answers. So here, user feedback becomes the stand-in for correctness.Part 4: Building an online eval pipelineThis is the most important part of the post. Let’s see what an online evaluation pipeline actually looks like.Step 1: LoggingThe first step is logging.Your chatbot is live, and people are talking to it. Before you can evaluate anything, you need to record every conversation that’s happening. If you don’t record it, it’s lost. And if it’s lost, what will you evaluate?The idea behind logging is simple: capture a structured, replayable record of every conversation turn.Say the chatbot is on the platform’s website and has 50,000 conversations a day. You store all 50,000 properly. What exactly do you store?Identifiersconversation_id: one ID per conversationturn_id: one ID per turn (you speak, the bot speaks, you speak, the bot speaks...)user_id: who the user issession_id: the sessiontimestamp: when it happenedContentThe user’s questionThe retrieved context generated while answering (for a RAG chatbot)The chatbot’s outputOperational dataLatency in millisecondsPrompt tokens usedCompletion tokens usedTotal costAny error and its status codeBehavioral signals from the userDid they press 👍 or 👎 during the conversation?Did they escalate? (“I don’t want to talk to you. Connect me to a human.” or “Give me your email ID, I want to email you.”)Are they repeating or rephrasing the same question again and again, because they feel the bot isn’t helping?Everything gets stored.Which tool do you use for this? A popular choice is LangSmith. In LangSmith you create projects, and every conversation your app has is stored there as a trace: what the user sent, what your app returned, and lots of metadata.The engineering properties of good loggingThere are a few engineering properties your logging must have:1. Non-blocking. Logging is an operation too. Your chatbot has to answer, and you also have to log. These two shouldn’t get in each other’s way. Running both together must not increase latency. The conversation happens normally on one side, and logging happens on its own in the background (Tracing tools like LangSmith already send traces in the background for you).2. Durable and queryable. Store logs in something like a data warehouse or an observability tool like LangSmith, in a structured way. The best part: you can fetch them back any time in the future.3. Late signal attachment. Some user signals don’t come during the conversation. They come later. Say a user chats with the bot, doesn’t get help, and the next day emails your support address to complain. That escalation happened a day after the conversation, but you still need to record it. How? You have the conversation ID, so you link the escalation back to that conversation.4. PII handling. If a user shares personal, sensitive information in a conversation (phone number, address, card number, date of birth, national ID number), you mask it before storing it in LangSmith. That way, no teammate or employee can later pull that information out of your logs. Privacy has to be maintained. Since it’s text, masking is the usual approach (PII = Personally Identifiable Information).(Regex is just a starting point. Real systems often use a dedicated PII detection library or service.)So, step 1: before evaluating anything, log everything. Usually in a data warehouse or an observability tool like LangSmith.Captured vs. computed signalsBefore step 2, we need to know what to pay attention to in production. Which signals tell you whether your chatbot is working properly?There are two kinds:1. Captured signals: signals that already exist. You just store them.👍 / 👎: the user gives it to you. You store it as is. Nothing to calculate.Latency: how long did the bot take to answer? Just store it.Cost per conversation: how many tokens, and how much money? Your LLM provider tells you, or you calculate it ahead of time. No real-time calculation needed.Token usage: simple counting.2. Computed signals: signals you have to calculate or figure out. Just storing the chat doesn’t give you these. You need an evaluator (an online evaluator) that takes the chat and computes the score.FaithfulnessAnswer relevanceCorrectnessHallucinationToxicityBias and fairnessMany captured signals (latency, errors, cost) are general software metrics that any normal app tracks. There’s nothing LLM-specific about them.| Signal | Type | Needs an evaluator? ||--------------------------------|----------|---------------------|| Thumbs up / down | Captured | No || Latency | Captured | No || Cost per conversation | Captured | No || Token usage | Captured | No || Faithfulness | Computed | Yes || Answer relevance | Computed | Yes || Correctness | Computed | Yes || Hallucination | Computed | Yes || Toxicity | Computed | Yes || Bias and fairness | Computed | Yes |The pipeline is different for each kind.Captured signals go straight to a dashboard. Computed signals need sampling and an evaluator first (Image by the author)Pipeline A: captured signals (log → dashboard → alert)Let’s take a captured signal like latency. There’s nothing to calculate, so after logging, you go straight to the next step: dashboarding.DashboardingEvery production setup has a dashboard that shows these quantities over time:Latency over the last 1 hourOver the last 24 hoursOver the last weekOver the last 6 monthsThe graph tells you whether the system is working normally.Example: the platform launches a course, and 500 people come to the website at once and start chatting with the bot. Suddenly, the bot’s reply time goes up. The latency graph, flat until now, spikes. That tells you something is wrong.So you quickly add resources. If you’re on AWS, you start more EC2 instances, add more load balancers, and manage the traffic somehow. After a while, latency comes back down.LangSmith has this built in. Under Monitoring, you pick your project and get a ready-made dashboard with charts for trace latency, error rate, LLM call count, LLM latency, and cost. You can choose the time window: last 1 hour, 3 hours, 6 hours, and so on.Here’s an important point: you always look at aggregated numbers. The latency of the current chat doesn’t matter much. In a single conversation, latency can go up and down. What matters is the aggregated latency over the last hour. If the average latency across lots of conversations is rising, something has gone wrong at the system level.AlertingThe next stage after dashboarding is alerting.Nobody watches graphs all day. Your engineer won’t stare at the dashboard 24 hours a day. They might be on leave, asleep, or busy. So you set up alerts: if a quantity crosses a threshold, an alert is sent on Slack, email, or even WhatsApp (less common). For example: “Latency is above 4 seconds.” The engineer jumps in and gets things back to normal.In LangSmith, there’s an Alerts section right next to Monitoring. You can:Select a projectGive the alert a nameChoose the metric to alert onSet the rule, like “alert when [metric] is above X in the last 5 minutes”Send it to Slack, PagerDuty, a platform like Dynatrace, or your own API/webhookSo dashboarding and alerting come together.To tie it together in LangSmith: a single trace might record a latency of 2.03 seconds. That same number shows up on the Monitoring dashboard, aggregated with all other traces. If the hourly number suddenly rises, the alert fires so you can take action.So for any captured quantity, the flow is:Log → Dashboard → AlertNo computation and no evaluator needed.Pipeline B: computed signals (log → sample → evaluator → dashboard → alert)Now the most interesting part: tracking a computed quantity in production.Let’s take hallucination. We want to check, in real time, whether our chatbot is hallucinating.Step 1: LogSame as before. If your chatbot has 50,000 conversations a day, log every one of them with a tool like LangSmith.Step 2: Set up an evaluatorNext, you create an evaluator. And this evaluator is reference-free.Remember reference-based vs. reference-free from Part 5?Reference-based: your golden dataset has the correct answer (like the exam grader).Reference-free: no golden dataset, no correct answer.We want the hallucination rate: is the chatbot hallucinating on a given question? Do we have a golden dataset? A correct answer? No. The user asked something, the bot answered, and we have nothing that tells us whether that answer is a hallucination. So this is a reference-free evaluation.But we still need to evaluate. So we use LLM-as-a-Judge. We bring in a more powerful LLM and show it three things:The retrieved contextThe question the user askedThe output our chatbot generatedThen we ask: “Is the chatbot hallucinating or not?” We give it a detailed rubric that guides the judge on how to decide.The problem: can we run this on everything?Here’s a big problem. If the chatbot has 50,000 conversations a day, should we run this LLM judge on all 50,000?Obviously not. It would be very expensive. You’re already paying to run the chatbot for 50,000 conversations. If you also pay to evaluate every one, your cost could more than double.The fix: samplingSo there’s an extra step in the middle: sampling. Out of 50,000 conversations a day, you randomly select about 1,000 and run your evaluator (the LLM judge) only on those 1,000.The evaluator gives you a number: the hallucination rate. You send that number to your dashboard, just like the captured quantities, and from the dashboard you create alerts.So the flow is the same as before, with two extra steps: sampling (to save cost) and evaluation (to compute the metric).Is random sampling the best strategy?Picking 1,000 conversations at random out of 50,000 works. But is it the best strategy?Not really. Not all conversations are the same. Think about it:Ignore (or downweight) conversations with a 👍. If a student gave a thumbs-up, they were most likely happy, so a hallucination probably didn’t happen there. It’s not a guaranteed fact, but it’s a good signal. Judging those conversations won’t teach you much.Focus more on conversations with a 👎.Focus on conversations that ended abruptly.Focus on conversations where there was an escalation.Focus on conversations where the user asks the same question again and again in different ways.Focus on conversations about money: refunds, admissions, fees.This is called stratified sampling:First, divide all your conversations into categories.Then take more samples from the problematic categories (like money-related or thumbs-down chats), and fewer from the normal ones.The sample you get has a much better chance of catching hallucinations. You can think of the categorizing step as a kind of clustering. To do it, you’ll usually need a small model that detects which conversation has a thumbs down, which one is about refunds, and so on.Random sampling mostly picks normal chats. Stratified sampling spends your evaluation budget where problems are likely (Image by the author)One caution: because stratified sampling over-represents risky chats, the raw hallucination rate on this sample will be higher than the true rate across all traffic. That’s fine if you use it as an early-warning signal and compare it with its own baseline. If you need the true overall rate, weight each stratum by its real share of traffic.The full online eval flowPutting it all together:Log everything.Sample conversations (stratified, not just random).Run your evaluator on the sampled conversations to compute a metric.Aggregate that metric over a time period and show it on a dashboard.If a threshold is crossed, trigger the alerting system.That’s the entire flow for one online eval pipeline. In practice, you set up multiple evaluators and multiple eval pipelines like this.A tour of LangSmith’s evaluatorsHere’s how this looks in a real tool. In LangSmith, there’s an Evaluators section, with a “Get started with evaluators” option. Click Show all templates and you’ll see many ready-made evaluators, each one marked LLM-as-a-Judge:Security: PII leakage (is the chatbot leaking anyone’s personal information?), prompt injection detection, code injection detectionSafety: toxicity, bias and fairnessQuality: hallucination, correctness, and conversation-quality checks like assertions and concisenessTrajectory: for agents, not chatbotsImage-based chatbotsVoice-based chatbotsFor example, the PII leakage evaluator checks whether your chatbot is leaking personal information. Behind the scenes, an LLM-as-a-Judge is doing the work.Setting up a hallucination evaluatorClick the hallucination template, then:Name the evaluator.Select the application you want to run it on. (Your organization may have more than one.)Pick the judge model: OpenAI, Claude, or another provider. Add your API key and set things like temperature.Write the prompt for the judge. This is where you define your rubric for detecting hallucinations, plus any instructions, reminders, or context. (We’ll go deep on writing these later in the series.)Define the output format you want the judge to return.Online or offline? It depends on what you run it onThen you get two options. You can run this evaluator on:Tracing (your logged production conversations), ora DatasetWhat’s the difference?If you run it on tracing / logs, it becomes an online evaluator.If you run it on a dataset, it becomes an offline evaluator, because datasets live in the offline setup.So LangSmith is a complete evaluation platform: you can do both online and offline evaluation there.You can create datasets too. Go to Datasets & Experiments, click New dataset, and keep adding examples. Select that dataset in your evaluator, and it becomes an offline eval. If you have no dataset yet, you’ll see two options: Create a dataset and Run an experiment. Click New experiment, and LangSmith gives you the code to run offline experiments.So in LangSmith you can:Create datasetsRun offline experimentsLog (trace) everythingMonitor with dashboardsSet up alertsRun online and offline evaluators(Treat this as a starting sketch. Check LangSmith’s current docs for the exact evaluator signatures.)The self-improving loopRemember the eval workflow from Part 3? Its last step was to deploy and monitor, and we said: when something fails in production, take that case and add it to your offline dataset.We do the same thing here.Say you’re looking at your traces and your team spots a conversation where something went wrong. In LangSmith, there’s an “Add to dataset” button at the top of the trace. Click it, and that conversation becomes part of your offline dataset. The next time you run offline evals, you run them on the updated dataset.You can also add a conversation to an annotation queue, where someone marks what went right and what went wrong. So you keep annotating online data and adding it to your offline data.This forms a circle:Run offline evals.Deploy to production.Online evals find failures in production.Add those failures back to the offline dataset.Run offline evals again, deploy again, find new failures…Production failures become tomorrow’s test cases. That’s how offline and online evals stay in sync (Image by the author)This is the self-improving loop. Online failures go into the offline dataset, and once they’re in the offline dataset, they’re part of every future offline eval. That’s how you close the loop. Offline and online evals keep working together, in sync, the whole time.Q&A: two questions worth answeringQ: Say my dashboard shows faithfulness 0.87, plus some toxicity and latency numbers. Is my bot good?Every metric needs a baseline, and that baseline usually comes from your offline evaluation. You compare against it.Say your baseline faithfulness is 0.85. A live score of 0.87 is better than the baseline, so you’re happy. But if, over the last 24 hours, faithfulness suddenly drops to 0.75, that’s concerning against a 0.85 baseline. An alert fires, or you go in and fix the system.Q: In offline evals, my score went from 92 to 99. Does that mean it’ll be good in production?It depends. Which quantity went from 92 to 99? And did other quantities drop while this one went up? If everything is improving, great. But improving one thing should never make another thing worse. In LLM-based systems, this happens all the time: you improve one thing, you get a regression, and other things drop. That’s exactly what you need to watch for.A shift in mindsetWhen you start, you think: “I need to build a chatbot. A RAG chatbot. Get an API key, build it, done.”After learning this, you start thinking differently: “How will my chatbot work properly for thousands, even millions of people?” You’re not just building it anymore. You’re learning to run it properly. That’s what sets you apart, because not many people are learning this yet.Putting it all together| Topic | Key idea ||----------------------------|----------------------------------------------------------------|| Offline eval | Evals run before deployment, on a golden dataset || Offline benefits | Release gate (CI/CD), version comparison, regression testing || Production risks | Unanticipated inputs, emergent/systematic failures, drift || Online eval | Evals on live traffic after deployment, no answer key || Offline vs. online | Offline checks CORRECTNESS, online checks NORMALCY || Signals | Captured (latency, cost, 👍/👎) vs. computed (hallucination...) || Captured pipeline | Log → Dashboard → Alert || Computed pipeline | Log → Sample → Evaluator → Dashboard → Alert || Sampling | Stratified beats random: sample more from risky chats || Logging must be | Non-blocking, durable & queryable, late signals, PII masked || Self-improving loop | Production failures → offline dataset → better offline evals |Offline and online evals are not rivals. You need both, all the time.Offline evals tell you whether your app works correctly before you ship it.Online evals tell you whether your app is running normally after you ship it, even without an answer key.When you can’t measure correctness in production, use reference-free metrics (like faithfulness), baselines (like score distributions), or user signals (like 👍/👎) as a stand-in.Log first. You can’t evaluate what you didn’t record.Sample smart. Spend your evaluation budget on the conversations most likely to have problems.Quick self-check before you move onAsk yourself about your own AI project:Do you have an offline eval that blocks a bad release automatically, or does every change go straight to production?When you change a prompt, do you check scores per category to catch regressions?Are you logging every conversation in production, with context, latency, cost, and user feedback? Is PII masked?Do you know what “normal” looks like for your app (latency, scores, thumbs-down rate), so you’d notice if it changed?When something breaks in production, does that case end up in your offline dataset?If the honest answer to any of these is “no” or “not sure,” that’s the gap this post is pointing at.So far, everything in this series has been about application-level evals. Over the next posts, we’ll put all of this into practice: how to build a golden dataset, how to run offline evals, and how to run online evals, using tools like LangSmith, DeepEval, and RAGAS.Next up in this series: Model-level evals and benchmarks: how LLMs themselves are evaluated, before we move back to application evals.If you missed the earlier parts of this series:LLM Evaluation 101: Why You Can’t Test an LLM the Way You Test Your CodeLLM Evaluation 102: Model Evals vs. Application Evals — Are You Evaluating the Right Thing?LLM Evaluation 103: How to Actually Evaluate an LLM Application from Start to FinishLLM Evaluation 104: Why Your AI Application Needs Multiple Eval PipelinesLLM Evaluation 105: Who Actually Grades Your LLM? Programmatic, Human, and LLM-as-a-Judge Eval MethodsOffline vs. Online Evals: How to Keep Evaluating Your AI App After It Goes Live was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.