How DoorDash Built an LLM Evaluation Flywheel That Cut Hallucinations by 90%
How DoorDash engineered simulated user chats and structured case states to run 200+ automated test scenarios in 5 minutes before deploying prompt updates.
On this page
Deploying generative AI chatbots into customer-facing operations is terrifying. A customer reports that their burrito arrived cold or an item was missing from their grocery delivery. The support bot misreads a delivery status, hallucinates a company refund policy that does not exist, and promises a credit that violates financial controls.
In traditional software engineering, regression testing is deterministic: a unit test passes or fails. But Large Language Models are non-deterministic. A slight tweak to a system prompt intended to improve politeness can unexpectedly break address verification or refund calculations.
To solve this, DoorDash engineered an automated Simulation and Evaluation Flywheel. By replacing unstructured conversation logs with structured case states and executing parallel multi-turn simulated conversations, DoorDash reduced customer support bot hallucinations by 90% while running over 200 regression scenarios in under five minutes.
The Testing Dilemma: Deploy and Pray vs Hand Testing
Engineering teams managing production LLMs typically fall into one of two dysfunctional testing patterns:
- Deploy and Pray: Developers update the prompt in staging, manually test two or three obvious happy paths, deploy to production, and monitor customer support escalations.
- Manual Regression Grinding: A team of human QA testers spends two days manually conversing with the bot across dozens of edge cases before every minor release, completely paralyzing release velocity.
DoorDash needed a continuous integration (CI) pipeline for LLMs that could run hundreds of complex, adversarial, multi-turn dialogues automatically before any prompt or model update merges to main.
Architecture of the DoorDash Evaluation Flywheel
+-----------------------------------------------------------------------+
| DoorDash LLM Evaluation Flywheel |
+-----------------------------------------------------------------------+
| |
| [ Prompt / Model Update Pull Request ] |
| | |
| v |
| [ Scenario Generator & Edge Case Corpus ] |
| | (Golden Dataset of 200+ Real Order Scenarios) |
| v |
| +-----------------------------------------------------------------+ |
| | Multi-Turn Simulation Orchestrator | |
| | | |
| | [ User Simulator Agent ] <====== Dialogue ======> [ Support Bot]| |
| | (Plays frustrated customer, (UnderTest) | |
| | injects ambiguous inputs) | |
| | | | | |
| | +-------------- Parallel Execution --------------+ | |
| | (200 Dialogues in < 5 mins) | |
| +-----------------------------------------------------------------+ |
| | |
| v |
| [ Structured Case State Tracker ] |
| | (Maintains JSON Schema of Order Status & Policy Bounds) |
| v |
| [ Evaluation Judge Ensemble (LLM-as-a-Judge + Code Assertions) ] |
| | |
| +---> Code Assertion: Did bot issue refund exceeding order cap?|
| +---> Policy Judge: Did bot follow cancellation workflows? |
| +---> Tone Judge: Was response empathetic and succinct? |
| v |
| [ CI Regression Gate: Pass (>=98% Score) -> Merge / Deploy ] |
+-----------------------------------------------------------------------+
1. User Simulator Agents
To test realistic interactions, DoorDash built a secondary LLM: the User Simulator. The simulator is initialized with a distinct customer persona and scenario goal, such as:
- “You ordered sushi 45 minutes ago. The driver is stopped 2 miles away. You are angry and want a full refund immediately.”
The simulator converses back-and-forth with the production bot under test. It reacts dynamically: if the bot asks for a photo of the damaged food, the simulator provides a mock image URL or claims their phone camera is broken. This exercises the support bot’s ability to handle stubborn, non-standard customer behavior across 5 to 10 dialogue turns.
2. Structured Case State vs Raw Dialogue Logs
A major breakthrough in DoorDash’s architecture was transitioning away from evaluating raw dialogue text strings. In early iterations, the evaluation engine passed the entire 2,000-word chat transcript to an LLM evaluator and asked: “Did the bot behave correctly?” This approach produced high variance and noisy evaluations.
Instead, DoorDash forces the bot runtime to maintain an explicit Structured Case State:
{
"order_id": "ORD_99182",
"issue_category": "MISSING_ITEM",
"missing_items": ["Guacamole", "Diet Coke"],
"delivered_timestamp": "2026-05-30T19:42:00Z",
"customer_tier": "DASHPASS",
"max_eligible_credit": 12.50,
"credit_issued": 12.50,
"resolution_status": "CREDIT_ISSUED"
}
By decoupling the structured business state from conversational prose, deterministic Python code assertions can instantly verify rules:
assert case_state["credit_issued"] <= case_state["max_eligible_credit"]
This guarantees 100% deterministic enforcement of financial and legal policies without relying on LLM vibes.
3. The LLM-as-a-Judge Tier
For subjective qualities (empathy, clarity, brand tone, brevity), DoorDash employs specialized LLM judges with strictly calibrated few-shot rubrics.
Judges score conversations on discrete 1-to-5 scales backed by clear negative and positive examples. If the bot scores below a 4 on empathy or repeats boilerplate responses, the CI pipeline fails.
Results and Velocity Gains
The simulation flywheel delivered dramatic improvements to DoorDash’s support engineering:
- Hallucinations dropped by 90%: Policy fabrications and unauthorized credit promises were practically eradicated.
- 5-Minute CI Test Cycle: 200 multi-turn simulated conversations execute in parallel across high-throughput model endpoints in under five minutes.
- Fearless Prompt Iteration: Engineers now ship daily prompt optimizations knowing automated regressions will instantly catch behavioral drifts.
Key Engineering Takeaways
- Never rely purely on LLM-as-a-Judge for hard business rules: Maintain an explicit structured case state. Use deterministic code assertions for financial limits, authorization checks, and workflow transitions.
- Simulate realistic multi-turn adversaries: Happy-path unit tests do not protect you. Test bots against adversarial simulator personas that provide contradictory information.
- Automate the regression loop in CI: Treat prompt engineering like core software engineering. Every prompt modification must run through automated regression suites before hitting production.



/* Comments */
Comments are offline right now — we reconnect automatically, nothing is lost.