Zenaique

Describe a rolling baseline drift detector built on judge scores

Flashcard·Medium·4.0 · 0·~30s·Asked atNetflixPhonepeSnowflake
Attempt it
TL;DR

Compare a short rolling window of judge scores against a longer rolling baseline; alert on deviation in standard deviations. Adapts as the system drifts.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Picture a thermostat that does not just check 'is the room above 72 degrees?' but checks 'is it warmer or colder than it has been on average for the last month?' If the room has slowly warmed up, the thermostat learns the new normal and only alerts when something really changes, like a window left open. A drift detector for judge scores works the same way. Instead of saying 'alert if quality drops below 0.85,' it watches what the quality has been over the past month and alerts when today is noticeably different from that recent average. The system can drift slowly without spamming alerts, and a real shift still stands out.

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.

Drift detection on judge scores is the workhorse signal of LLM production observability. It is what tells you, between major prompt releases, whether your product is silently getting worse. A rolling-baseline detector compares a recent window of judge scores against a longer baseline window and alerts on meaningful deviation. The pattern is simple in description and load-bearing in practice.

This walkthrough explains the two-window construction, the gating math, why fixed thresholds fail on non-stationary signals, the practical refinements (per-segment baselines, hysteresis, baseline-window exclusion), and where rolling detection has blind spots that demand a complementary golden-set replay.

Mental model: judge scores are non-stationary. Comparing 'now' to 'recent history' is structurally the right question; comparing 'now' to 'a number I picked six months ago' is the wrong one.

The two-window construction

Short window: 'now'

The short window captures recent traffic. Common sizes: last 1 hour for noisy interactive products, last 24 hours for steadier batch workloads. The window should be long enough that p50 and p95 estimates are stable, typically at least 100 to 500 judged traces.

Long baseline: 'recent history'

The long baseline is the comparison anchor. Common sizes: last 7 days, last 30 days. Longer baselines smooth more but adapt slower; shorter baselines adapt fast but flag less. 30 days is a good default for most products.

Excluding the short window from the baseline

The short window must be excluded from the long baseline. If the short window is in the baseline, any change in the short window pulls the baseline along with it, biasing the comparison toward 'no change'. The common pattern is: long baseline = days T-30 to T-1, short window = day T. The 24-hour gap is the exclusion.

Statistics over each window

For each window compute:

  • p50 (median): the central judge score.
  • p95: the tail. Catches regressions concentrated in worse cases.
  • Baseline standard deviation sigma: the natural noise of the baseline.

The minimum metric is p50; p95 catches a class of regressions that hides in the median.

The alert math
Per-segment baselines
Blind spots and the golden-set complement
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • Langfuse 3.x exposes rolling-window score aggregates and alerting hooks; the standard pattern is short window plus 30-day baseline.
  • Arize Phoenix 5.x ships drift visualizations built on this exact rolling-baseline pattern for production LLM monitoring.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow do you choose the M (sigma multiplier) and the absolute-delta floor?
A

Backtest on historical data: pick the M and delta_abs that would have surfaced known incidents while keeping false-positive rate under your on-call budget (e.g. one page per week). Tune per segment.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Using one global fixed threshold across many traffic segments. Judge-score baselines differ per segment; segment-aware rolling baselines are the fix.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Short window and long baseline windows

  • Why the short window is excluded from the baseline

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Describe how end user thumbs up/down should flow back onto a trace
Flashcard·Easy