Shadow Traffic for LLM Systems: Test the New Model Without Gambling on Users
Mirror real production requests to a candidate LLM, discard its output, and measure quality, latency, safety, and cost before any user becomes your experiment.
Offline benchmarks tell you whether a model can answer questions somebody remembered to put in a dataset. Production traffic tells you what users actually ask at 2:13 a.m. with half a sentence, three typos, stale account state, and a PDF nobody expected.
Shadow traffic lets a candidate LLM see a copy of those requests without letting its answers reach users. The incumbent handles the live request. The candidate runs in parallel. You compare results later.
Done correctly, this is the safest reality check before a model migration. Done lazily, it is a privacy leak with a surprise inference bill.
What to Mirror
Do not begin at 100 percent. Start with a sampled slice stratified by route, tenant class, language, request length, and risk level. Uniform random sampling can miss the expensive or dangerous tail.
Construct the candidate request from the same normalized inputs used by production, but stop before side effects. Tool calls must target deterministic fakes, read-only mirrors, or recorded responses. A shadow agent that can send email, issue refunds, or modify records is not shadowing. It is freelancing.
Preserve the information needed for fair comparison:
- prompt and policy versions
- retrieved document IDs and versions
- model parameters
- tool definitions and simulated tool results
- route and permission context
- live response and candidate response
- latency, token usage, cache behavior, and errors
Use a stable correlation ID so the pair remains joinable without exposing unnecessary user identity.
Privacy Comes Before Evaluation
Mirroring doubles data processing. Verify that the candidate provider, region, retention settings, and contractual terms allow the traffic you plan to send. Redact secrets and unnecessary personal data before both live and shadow calls where possible.
Some routes should be excluded entirely: raw credentials, highly sensitive health or legal content, unreleased corporate data, and customer segments whose contracts forbid secondary processing.
Keep shadow outputs out of user-visible logs and support tools. They may contain hallucinated personal data or unsafe language. Restrict access, set retention limits, and log who inspects them.
Never let shadow traffic write to the same semantic cache as production. A candidate’s unapproved answer must not become a live cache hit tomorrow.
Compare More Than Vibes
The easiest metric is disagreement rate. It is also nearly useless alone. Two correct answers can differ; two wrong answers can agree.
Build route-specific evaluators. A structured extraction route can use exact fields, tolerances, and missing-value rules. A support answer can check cited policy, escalation decisions, and prohibited promises. A coding route can run tests and static analysis.
Use several layers:
- deterministic checks for schemas, citations, permissions, and business invariants
- reference-based scoring where known answers exist
- pairwise model judging with position swaps and calibrated rubrics
- human review for sampled disagreements and high-risk cases
Blind human reviewers to model identity. Otherwise brand expectations leak into quality labels.
Measure safety and refusal quality separately. A candidate that answers more questions may look helpful while crossing boundaries the incumbent respects. Track false refusals too; safety theater is not product quality.
Capture Production Economics
Quality without latency and cost is a demo. Record time to first token, total latency, input and output tokens, cache hits, retries, and tool-call counts.
Compare distributions, not averages. A model can improve median latency while creating a disastrous p99 on long-context requests. Segment by prompt length, language, tool count, and route.
Shadow load can also distort the live system. Use separate rate-limit budgets, queues, and circuit breakers. If production latency rises, shadow evaluation should shut itself down first.
Estimate cost at the rollout mix you actually plan to use. Include retries, evaluator calls, embeddings, and storage. A cheaper generation model can become more expensive when it needs more tool loops or repair passes.
Design the Rollout Gate Before Looking
Write acceptance criteria before the first results arrive. Otherwise every regression becomes negotiable because the new model is exciting.
A migration gate might require:
- no statistically meaningful drop on critical-task success
- zero new permission or side-effect violations in the reviewed sample
- refusal performance within a defined band
- p95 latency under the route budget
- total cost per successful task below a target
- no severe regression for any supported language or customer tier
Use confidence intervals. Ten cherry-picked conversations do not establish equivalence.
When the candidate passes shadow testing, move to a small canary with fast rollback. Shadow traffic cannot reveal every interactive effect because users never respond to the candidate. Multi-turn behavior, satisfaction, and downstream business outcomes require controlled live exposure.
Watch for False Confidence
Shadow evaluation inherits production blind spots. If your live retrieval system misses the correct document, both models may fail. If the evaluator rewards confident verbosity, the candidate will appear better by producing more polished nonsense.
Periodically audit the evaluator against expert labels. Track disagreement by rubric dimension. Add newly discovered failures to an enduring regression suite.
Also compare behavior over time. Providers can update model snapshots, safety layers, or routing. Pin versions where available and treat any unpinned dependency as a changing production component.
Shadow traffic does not eliminate migration risk. It converts unknown risk into measured risk while users remain protected. That is the point: let the candidate encounter reality before reality can encounter the candidate.
Sources
> Want more like this?
Get the best AI insights delivered weekly.
By subscribing, you agree to our Privacy Policy. You can unsubscribe at any time.
> Related Articles
AI Agent State Snapshots: Resume Long Jobs Without Repeating Side Effects
Durable agents need more than chat history. Snapshot plans, tool results, permissions, and idempotency state so a crash can resume safely instead of replaying the world.
Embedding Model Migration: Change Vectors Without Breaking Search
Embedding upgrades change the geometry of your index. Use versioned vectors, dual writes, shadow queries, and measured cutover instead of mixing incompatible representations.
LLM Request Coalescing: Stop Paying Twice for the Same Answer
When identical LLM requests arrive together, single-flight execution can collapse them into one upstream call—if cache keys, streaming, failures, and tenant boundaries are designed correctly.
Tags
> Stay in the loop
Weekly AI tools & insights.