How online sampled evals turn into a continuous quality signal in production
Sample 1 to 5 percent of production traffic, score with an LLM judge, write the score back as a span attribute, and alert on rolling-baseline drift to catch input-distribution shifts the golden set never anticipated.
Imagine a coffee shop that does perfect tastings every morning before opening. The tastings tell them the recipe is right. But during the day, the milk delivery might be slightly different, a new barista might pull shots differently, or customers might order new combinations the morning tasting never tried. So the shop also has the manager taste one random cup per hour all day. The morning tasting is the CI check; the hourly cup is the online sampled eval. Together they catch both the things you can rehearse for and the things only the real day reveals. The hourly cup costs a coffee each time, which is the price of catching surprises that the rehearsal missed.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
CI evals defend the gate. Online evals defend the production system after the gate. Every mature LLMOps stack in 2026 runs both because they catch fundamentally different failure modes. CI catches the regressions you can anticipate on the test cases you already wrote. Online catches the regressions that emerge when production traffic shifts in ways the test cases never modeled.
This explanation walks through the mechanics of the online evaluation loop, the reasons it is non-negotiable for any system whose input distribution is non-stationary, the design decisions that separate a useful online signal from noise, and the cost and operational trade-offs that come with the pattern.
The loop in detail
Sampling. A sampling rule decides which production requests get judged. The rule is typically configured at the gateway (LiteLLM, Portkey) or in the observability SDK (Langfuse, LangSmith, Phoenix). Sampling rate is 1 to 5 percent for high-volume workloads, higher for low-volume ones. Sampling is usually stratified by intent or tenant so rare slices keep statistical detectability.
Judging. For each sampled request, the system makes a second LLM call to a judge model. The judge gets a structured prompt containing the input, the retrieved context if applicable, and the response, plus a rubric. The rubric tells the judge what to score: faithfulness (does the response stay grounded in retrieved context), helpfulness (does it address the user's intent), refusal-correctness (did it refuse when it should have, or refuse when it should not have), task-specific scores (did it produce valid JSON, did it call the right tool, did it answer in the right tone).
Write-back. The judge's score is written as an attribute on the original request's trace span. This is the critical design choice: the score lives on the trace, alongside the latency, cost, and model attributes, so all the same querying machinery can analyze it.
Aggregation and alerting. A dashboard rolls up the score by prompt version, model, tenant, intent, or any other span dimension. Alerts fire on rolling-baseline drift (the 24-hour or 7-day rolling average drops below threshold) or on slice-level regressions (one tenant's score drops sharply while aggregate is fine).
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Langfuse online scores: a sampling rule writes Haiku-judge faithfulness scores onto a percent of RAG traces, with rolling-baseline alerts in Grafana.
- LangSmith online evals: feedback functions run on sampled production traces, with per prompt version score dashboards.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you detect that your judge model itself has drifted, not the production model?
Maintain a frozen human-labeled sample of 50 to 200 examples with known correct scores. Re-run the judge against this frozen sample weekly and compare to the historical judge scores. If the judge's scores on the frozen sample shift, the judge has drifted (model update, prompt change, vendor change). If the frozen-sample scores hold but the production rolling baseline moves, that is a real production-quality signal.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Treating CI golden-set scores as the full quality signal. CI tests the cases you anticipated; online sampled evals catch the production distribution that you did not. Without the online loop, distribution-shift regressions land in customer reports first.
60 second bullets to scan on the way to the call.
What are the five stages of the online-eval loop from sample to alert?
Why does a passing CI golden set fail to defend against production drift?
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.