Topic 5 of 5 · 5 min read
Closing the loop from failure to shipped fix
Goal: Plan one flywheel cycle from a failure category to a measured improvement in production.
A flywheel turn is one failure category taken all the way through: pick the cheapest fix that could work, prove it on the evals, release it to a slice of traffic, and check the production signal that started the cycle. Without an owner and a rhythm, the loop quietly stops.
Check yourself · 1 of 3
A trace shows the correct policy page was never retrieved. What is the cheapest fix to try first?
Why it matters
Mining traces and writing cases only creates a backlog. Value appears when a fix ships and the same signal moves. Teams also fail the other way: they jump to fine-tuning for a problem a clearer instruction would solve.
How to do it
- Pick the category with the highest count times cost, and name an owner.
- Find the cause in the trace. Was the right document missing from retrieval? Did the prompt not say what to do? Did the tool return nothing useful? Was the model too weak for the task?
- Choose the cheapest fix that fits the cause, roughly in this order: prompt or instruction, retrieval or context, tool design or validation, a stronger model, and only last fine-tuning.
- Run the evals. The new cases must now pass, the rest of the set must not drop, and cost and latency must stay within budget.
- Roll out in stages. Shadow or canary to a small share of traffic, watch the signal, then widen. Keep a quick way back to the old version.
- Measure in production. Compare the same signal that found the failure, for example the thumbs-down rate in that category, against the old version over a fair period.
- Record and repeat. Note the result, retire or keep the cases and set the next cycle date.
Before and after
Weak: "We changed the prompt and it feels better." Better:
Cycle 12 (owner: Priya, review Fri)
Category: ungrounded-answer (21% of sampled failures)
Cause: retrieval returns the old policy page first
Fix: re-rank by document date; add 14 cases
Evals: new cases 14/14, full set 91% -> 92%, latency +40 ms
Rollout: 10% for 3 days, then 50%, then 100%
Success: category rate under 10% in sampled traces
What goes wrong
- Fixing without a baseline. You cannot show the change helped.
- Shipping to everyone at once. A regression reaches all users before you notice.
- No owner or cadence. Each cycle waits for someone to remember.
- Declaring success from evals only. Evals are a proxy. The production signal is the check.
Examples
Retrieval, not the model
A legal assistant gives outdated answers. The trace shows the retriever returned a 2022 page above the 2025 one. Re-ranking by date fixes the category. A model upgrade would have cost more and left the cause in place.
A staged rollout catches a side effect
A prompt change passes all evals. At 10% traffic, the handoff rate to humans rises from 6% to 9%. The team finds the new prompt makes the bot refuse a common request, adds cases, fixes it and widens the rollout a week later.
Key points
- Pick the failure category with the highest count times cost and give the cycle a named owner.
- Find the cause in the trace, then choose the cheapest fix that fits it, with fine-tuning last.
- Rerun the evals to confirm the new cases pass and the rest of the set does not drop, while watching cost and latency.
- Roll out in stages with a quick way back, and compare the same production signal that started the cycle.
- Run the loop on a regular cadence, because an unowned loop quietly stops.
Common mistakes
- Jumping to fine-tuning before trying instruction, retrieval and tool fixes.
- Shipping a fix to all traffic with no staged rollout or rollback.
- Declaring success from the eval score without checking the production signal.
- Running cycles with no owner or schedule.
Check yourself · 2 of 3
After a fix passes all evals, what should happen before it reaches all users?
Check yourself · 3 of 3
Which result best shows a flywheel cycle worked?
Practice items, not counted towards your mastery.
Start here
- Your AI product needs evals (Hamel Husain) (opens in a new tab)ArticleFree
Explains why looking at real traces and building evals from them is the core loop of improving an LLM product.
- A Field Guide to Rapidly Improving AI Products (Hamel Husain) (opens in a new tab)ArticleFree
Practical advice on error analysis, reading data and building a feedback loop around real failures.
- Patterns for Building LLM-based Systems and Products (Eugene Yan) (opens in a new tab)ArticleFree
Covers evals and collecting user feedback as the base of a data flywheel for LLM products.
More for this topic
- Evaluation best practices (OpenAI) (opens in a new tab)DocsFree
Guidance on building eval sets from production data and on graders and iteration.