Skip to content
mentoor

Topic 2 of 5 · 5 min read

Rolling out a prompt or model change in stages

Goal: Write a staged rollout plan for a prompt or model change with metrics and pass thresholds for each stage.

Ship a prompt or model change to a few requests first, compare it with the current version on real traffic, and widen only when the numbers you set in advance say so. An offline eval catches known failures. Production traffic contains inputs you never thought of.

Check yourself · 1 of 3

What does a shadow run do with the candidate prompt's output?

Choose one answer

Why it matters

LLM changes are hard to judge by reading. A new model can be better on average and worse on your longest tickets, or cheaper and slower. A full release turns every such surprise into an incident for all users. A staged release limits the damage to a small share and gives you a control group to compare against. This is the canary idea from reliability engineering, applied to prompts.

The stages

  1. Offline eval gate. The candidate must pass the regression set before any traffic touches it. Fail here and stop.
  2. Shadow run. Send real requests to the candidate as well, but discard its output. Users see only the current version. Compare cost, latency, format errors and judged quality. Nothing user-facing can break.
  3. Small live share. Serve the candidate to a small slice, for example 5 percent, chosen by a stable hash of the user id so each person gets one version. Compare to the control that runs at the same time.
  4. Widen in steps. 25, 50, 100 percent, each step with a hold time long enough to see rare cases and a daily cycle.
  5. Retire the old version only after a hold period, so rollback stays cheap.

Decide the thresholds first

Write the pass rules before you look at results. Example: format-valid rate at least the control's, thumbs-down rate not more than 2 points above, p95 latency under 6 seconds, cost per request under budget. A hard stop on any safety metric. Without written thresholds, people argue about the numbers they happen to see.

Before and after

Weak plan: "Switch to the new model on Tuesday and watch the dashboard."

Better plan: "Eval gate passes. Shadow for 2 days on all traffic. 5 percent live for 3 days, then 25 percent. Stop if format errors exceed the control by 1 point or p95 latency passes 6 seconds. Old version stays deployable for 7 days after 100 percent."

What goes wrong

  • Comparing against last week. Traffic shifts; compare with a control served at the same time.
  • Too little traffic per stage. A rare failure at 1 in 200 needs far more than 50 requests to show up.
  • No hold time. Weekend and weekday traffic differ, and a long-tail input may take days to appear.

Examples

A rollout plan for a new model

Change: support-reply v3 -> v4 on a newer model snapshot
Gate:   eval set 240 cases; v4 must score >= v3 and 0 safety failures
Shadow: 2 days, 100% of traffic, output discarded
Live:   5% for 3 days -> 25% for 3 days -> 100%
Stop if: format-valid rate drops > 1 pt vs control,
         thumbs-down rises > 2 pts, p95 latency > 6 s
Keep v3 deployable for 7 days after 100%

Each step has a measurable stop rule, so nobody decides by feeling.

Why shadow first

A team swaps to a cheaper model. Offline evals look fine. In shadow mode on real traffic they see 4 percent of replies exceed the length cap because real users paste long emails. No customer saw it, and the prompt was fixed before the 5 percent stage.

Key points

  • Run the offline eval first, then a shadow run, then a small live share, then wider steps.
  • Shadow runs let you compare a candidate on real inputs without any user seeing its output.
  • Assign users to versions by a stable hash so each person sees one version, and compare to a control served at the same time.
  • Write pass thresholds for quality, format errors, latency, cost and safety before the rollout starts.
  • Keep the previous version deployable until a hold period after full rollout.

Common mistakes

  • Releasing to everyone because the offline eval passed.
  • Choosing success thresholds after seeing the results.
  • Comparing the candidate with last week's numbers instead of a concurrent control.
  • Moving to the next stage after a few hours, before rare inputs appear.

Check yourself · 2 of 3

Your team plans a live rollout of a new model at 5 percent of users. Which stop rule is best to write before starting?

Choose one answer

Check yourself · 3 of 3

Why assign users to the new prompt by a hash of their user id rather than per request?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic