At DoorDash, one challenge we face when deploying automated voice agents in support and food ordering roles is how to evaluate the overall quality of a model. Testing a model against pre-recorded conversations doesn’t tell you what happens when the conversation deviates from the recording, and having two agents simulate conversations doesn’t capture all the nuances of real human speech. To address these gaps, we built OrderUp-Bench, an evaluation benchmark of food-ordering scenarios with known target order carts. In our harness, a router agent simulating a customer is given access to a set of real human audio recordings that it can choose dynamically to interact with the order-taking agent and place an order.
The benchmark measures how accurately the agent captures the order within the scenario’s clip sequence, how compliant it is with the order-taking policy given to it, and the total duration of each ordering session. In our experiments, we compared the performance of three commercial speech-to-speech models — GPT Realtime 2, Gemini Flash Live 3.1, and Grok Voice 1.0. We used Whisper with GPT-5.5 as a cascaded baseline. All settings used the same prompt, which instructed the agent to take the customer’s order and follow the same rules for seeking options and follow-ups.
Our key finding: Turn-level accuracy and compliance are weak proxies for expected overall success rate. As shown in Figure 1, GPT Realtime 2 had the highest clean pass rate of any model we tested (66.4%, vs. 28.5–62.9% for the others), meaning it most often ended with exactly the right cart without the simulated customer having to step in and correct it. It was also the model most likely to fail silently (8.9% of tasks, vs. 2.0–4.0% for the others), giving the customer no signal that anything went wrong. Once we account for failures that a customer could plausibly catch and correct mid-conversation, the 37.9-point spread in overall success rate shrinks to under 5 points (79.6–84.4%). Mistakes that are verbalized and then corrected still carry a penalty, but their effect shows up by increasing the conversation’s duration, with recovered runs taking about 35% longer than clean passes. This better reflects the trade-offs in real production settings where customers may take time to correct an agent, which produces a degraded customer experience rather than a failed result.
Figure 1: Models vary significantly in their ability to follow the exact intended trajectory in a conversation. But when we allow the model to make harmless deviations and give partial credit for verbalized mistakes a customer could correct, the range narrows into a 79.6-84.4% success rate across all models.
From our experience with voice agents, we have observed that improving metrics focused on individual conversation turns like accuracy or response latency doesn’t always move the needle on downstream business metrics such as success rate and task completion time. An agent that records the customer’s order perfectly and responds quickly can still fail to drive the conversation in the right way. Before rolling out a new agent version, we would often be unable to answer questions like:
If we change the agent to provide more succinct responses, do conversations actually complete faster?
How often are customers working harder to interact with the agent because they’re unsure if they were heard correctly?
Is the agent asking too many unnecessary clarifying questions? What happens if we direct it to make informed guesses more often?
To try and answer any of these questions in an offline setting, we needed to model how a customer might respond to the way a voice agent phrases its responses and questions. Informed by real customer interactions, we designed a smart customer clip router which can play clips extracted from human audio sessions to answer follow-up questions, offer corrections, and repeat or rephrase orders in response to the agent.
For each sample scenario, we record whether each agent trajectory was:
Correct: The agent was fully compliant with its standard operating procedure (SOP) and recorded the expected order by the end of the session, or
Recovered: The agent goes off-policy at some point — such as asking a superfluous question or recording the wrong order — but the customer corrects the agent and steers the trajectory back to the expected result, or
Recoverable: The agent recorded the wrong order at the end, but clearly conveyed what they were doing in a way that, in theory, a customer could have heard and corrected the order, even if the customer in the sample didn’t, or
Unrecoverable: The agent silently recorded a partially incorrect order. A customer would have no opportunity to correct it.
Effective success rate credits a fraction of the recoverable failures as if a human had caught and fixed them. Figure 2 reports two additional anchors beyond the 50% assumed correction rate, using a 100% and a 0% correction rate to show the extreme ranges between motivated and inattentive users. GPT Realtime has a significant clean pass margin over the other models, measuring both for a correct output and full policy compliance. But the results appear to be much closer when all recovered runs are counted as correct but assuming all recoverable runs failed. Many of the compliance failures which penalize the clean run rate can be harmless issues such as asking an unexpected question about non-required options. A real customer would be able to answer the question and the extra time would be captured by the duration metric; consequently, the effective success rate @X metrics would be more representative of a real deployment success rate.
Figure 2: Effective Success Rates @0 includes all clean passes and every task we were able to recover with our trajectory correction flow. Effective Success Rate @100 represents the theoretical limit on how many conversations would succeed. A lower Effective @100 score means there were more tasks where the model failed silently in a way a customer wouldn’t have an opportunity to correct. Silently adding or removing the wrong item or option counts against this while reading back an order wrong does not.
Effective duration applies the same idea to timing; it’s the average time cost per task if recoverable failures were corrected during the conversation, with recoverable runs scaled up by a time penalty relative to a clean pass on the same task. Averaging over a set of tasks where repeated evaluations produced at least one recovered trajectory and one correct one, we derived a 1.37X time scaling factor which we use to estimate how long a recovery could take. A model is penalized more for an unrecoverable failure than a recoverable one, and is penalized in duration for producing a wrong run compared to a correct one. Figure 3 shows how the effective duration for each model compares against the average time spent by the model per turn. Driving down response latency doesn’t always translate to a faster interaction for the customer, as we can see by comparing GPT against Gemini. Any edge Gemini has in response latency is eaten up in extra turns answering superfluous questions or correcting mistakes, demonstrating how the lower clean pass rate from Figure 1 compared to GPT manifests itself as extra duration. See our technical report for a full breakdown of failure severity and the recovery-time-factor methodology behind effective duration.
Figure 3: Effective duration and average time per turn across models. Average turn time is broken into latency and response duration, showing how a verbose response can contribute more to conversation duration than model latency in some cases.
Our evaluation harness
We built an evaluation harness to measure how well a voice agent might perform in a real production setting. This harness can reproduce problems that make the audio domain uniquely challenging. The evaluation framework includes such features as:
An evaluator that streams audio to an examinee agent, which then calls a set of tools to record user intent in a structured form before streaming audio back to the evaluator to ask clarifying or required follow-up questions.
The evaluator agent includes a smart clip router, which plays audio clips collected from real human conversations.
The agent responds to the examinee by choosing an audio clip from a pre-defined pool of clips specific to the given scenario.
We record the conversation’s length and compare its intents against an expected result.
Instead of just playing the clips in a pre-defined sequence, the clip router has a decision tree it can use when the agent doesn’t follow the exact trajectory of the original human conversation. The router uses a goal state to try to choose a clip that best matches what a human would say to reach that goal in response to the agent’s questions. Figure 4 demonstrates some sample flows through different conversation trajectories, with branches for common agent failure modes like missing a required question, asking a superfluous one, or duplicating an item.
Figure 4: Sample clip trajectories followed by the router. Based on the response from the agent, the router chooses the most relevant branch and plays the next clip. The router only gives options or restatements when explicitly asked, so an agent will be penalized for skipping required questions or making bad guesses. The third column demonstrates how the router models a customer who makes sure their entire order was heard with the right quantity
This design allows us to:
Minimize the variability introduced by letting the evaluator give free-form responses;
Test the examinee agent’s response to known challenging speech patterns, such as accents, disfluencies, and mispronunciations;
Stress the examinee’s ability to comply with its SOPs over multiple turns while extracting the correct information from the evaluator; and
Most importantly, test the combined capability of multi-turn response chains to challenging speech. When the speech is genuinely hard to understand, we determine whether the agent can recover the conversation with a targeted clarifying question, extending it by an extra turn, or whether it instead silently makes its best guess, risking recording the wrong intent. Ultimately, we seek to determine the accuracy versus time tradeoff for different models and different prompting biases.
Scenario design
In this evaluation benchmark, scenarios consist of conversations in which the evaluator is ordering food from the examinee. The examinee has access to a menu with exact names for items and the options that apply to them. Additionally, the menu indicates which options are required, meaning that the order can’t be completed without collecting a response to a required option question.
In turn, the evaluator has access to a set of clips in which the simulated customer can:
Refer to items with a name other than their canonical name, or which can refer to two or more possible menu items.
Omit required options.
Ask for multiple items in a single utterance.
Correct or modify previous requests.
In response to each clip, the examinee has to make a judgement call about whether to ask a disambiguating or option question or whether to instead make a best guess and move the conversation forward. If the examinee asks another question, the evaluator is ready with a clip to answer it, but it won’t offer the extra information on its own; an examinee that speeds through to the conversation’s end without follow-up questions risks missing a required option or recording an incorrect item name, which subjects it to penalties related to accuracy.
Modeling customer trajectories
A good agent goes beyond understanding and processing a user’s intent to drive the conversation to its next defined step. It also communicates understanding and acknowledgement, asking for clarification when a genuine acknowledgement is not warranted. Often a user-agent conversation devolves into a failure when the user repeats their intent after an ambiguous acknowledgement. Silent duplication of recorded intents or confusing responses lead to increasing divergence between the user’s understanding of what the agent is saying and what the agent is actually doing, resulting in frustration and an inevitable request to speak to a human.
To model this, the evaluator has an additional task: to record whether the agent acknowledged every item it has been asked for during the conversation. When an intent isn’t acknowledged, the evaluator automatically repeats it before moving on to additional items or closing the conversation, as demonstrated in Figure 5. This design forces the evaluator to maintain a model of its partner’s mental state so that it can actively work to try to close any gaps between what it tried to say and what it thinks was understood.
Figure 5: Demonstration of the rules our router uses to keep track of what it thinks the agent heard. If the agent explicitly acknowledges only part of their order, the router will attempt to re-order what it thinks the agent missed.
Given that audio clips are collected from a single conversation, if a sample trajectory diverges too far from the original conversation, there may not be a clip that would correspond exactly to the examinee’s response. Because of our scenario design, an ideal agent would follow the expected trajectory in the exact sequence as the original conversation. In practice, however, we also care about whether the examinee/evaluator pair can return to the expected trajectory after a divergence and record the correct final customer intent. In general:
To support this hierarchy, we generated a few universal fallback clips via text-to-speech so that the clip router could address common failure modes. Fallback clips like “yes,” “no,” “just the defaults,” or “I only want one” can be used to address some agent responses which don’t have a close analog in the original recording. The examinee can use these to handle common agent failure modes like asking about a non-required option or adding additional quantity. We found that using these universal clips instead of allowing unconstrained speech generation strikes a good balance. It allows a common set of trajectory divergences to recover gracefully without risking generating speech when playing a recorded human clip is desired.
Dataset Creation
To ensure our dataset represented the kinds of speech our agent to which our agent would be exposed, we collected data from different devices with variations across accents, background noise, and disfluencies, including such things as pauses, umms and ahhs, and mid-sentence corrections. Participants were not given an explicit script on how to order, leading to variation in order grouping, such as asking for an item with all options, offering options as a question response, and changing or rephrasing items after an initial ask.
What’s next
While our harness allows us to reliably surface complex agent failures that we couldn’t otherwise reproduce, we don’t yet have a single numerical score that could confidently say Agent A performs better than Agent B. In order to construct a binary pass/fail decision that could promote a better agent, we still need:
Weight calibration: The assumed 50% recovery rate in the effective success rate calculation was chosen for simplicity, not based on measurement. Additionally, different failure modes have different likelihoods of customer correction. A fully representative effective success rate would make use of calibrated recovery rates for different error types derived from data. Ultimately, we would want to calibrate our offline success and duration metrics against online success and acceptance metrics to understand how to optimize an agent for our product goals.
Further variance reduction: Because our evaluation harness deals directly with streaming audio, its results are sensitive to differences in streaming latency from run to run. Our evaluation harness streams sampled background noise in between selected clips; any difference in the time taken to select a clip results in the examinee experiencing a different stretch of background noise. More fundamentally, the semantic meaning of a response can change based on when it’s perceived by the listener. If a speaker asks two questions with time between them, and their partner responds to the first question, the meaning can change based on whether that response is heard before or after the second question. Of the 248 samples evaluated across the four models, when the same model is run three times on the same sample, its correctness label stays consistent only 53.3% of the time. While variation averages out over three sweeps, it remains difficult to say whether any given scenario is improved when testing a new agent.
Driving model improvements
Our evaluation framework allows us to reproduce complex failure modes for voice agents. We hope the release of this benchmark and framework will drive further development of native speech-to-speech models to increase their compliance and robustness in challenging deployment domains.
Subscribe to our Engineering blog to get regular updates on all the
coolest projects our team is working on
Please enter a valid email
address.
Thank you for Subscribing!
TL;DR — DoorDash’s store ranker is a core model behind our personalized homepage. It works across a marketplace to connect customers, merchants, and Dashers by combining customer preferences with store availability and delivery context. We explain here how the ranker works, its features, and the iterations over the past year that led to DoorDash’s first production transformer. Adding the transformer has improved recommendation quality and customer engagement, showing the strongest gains among customers who use DoorDash less frequently.
When a consumer opens the DoorDash homepage, the system has only milliseconds to turn thousands of nearby options into a small set of useful recommendations. Understanding a user’s baseline preferences is only part of the problem. The same person may want a familiar weekday lunch, groceries on a weekend afternoon, or something new for dinner. The homepage must recognize these shifts in intent while operating within a strict latency budget.
For years, DoorDash’s store ranker relied on a mature, multi-tasking deep neural network (DNN). It combined consumer behavior, consumer/store affinity, store attributes, and real-time context to predict outcomes such as engagement and conversion. While reliable and efficient, the model used consumer histories that entered it as aggregate features: counts, recency buckets, and pooled embeddings. These summaries captured general preferences but often lost the order and timing of individual interactions. A model might know that someone likes coffee and tacos, for example, without learning that coffee is exclusively a weekend morning habit and tacos are a recurring weekday dinner choice.
In Mid 2025, we launched DoorDash’s first production Transformer for Homepage Store Ranking. Rather than replace the established architecture, we added a transformer module that encodes ordered consumer interactions and their temporal contexts. We then combined this sequence representation with candidate-store and request features inside the existing multi-task system.
This post describes that journey, including the starting foundation, the data and architecture built for sequence modeling, the production constraints that shaped the design, the lessons learned while launching at homepage scale, and follow-up iterations and future opportunities.
DoorDash’s multi-stage homepage recommendation system
Although consumers see a single homepage, no one model determines everything that appears on it. The experience is assembled through multiple stages that retrieve candidates, score stores, and construct carousels that are then arranged across the page.
Figure 1.DoorDash’s homepage recommendation pipeline retrieves candidate stores, scores their relevance, and assembles the page. Horizontal ranking orders stores within each carousel, while vertical ranking orders carousel rows down the homepage.
The full system includes specialized paths for restaurants, grocery and retail, ads, merchandising, and new content. Figure 1 follows the store-centric path, showing how five stages work together to select and rank on the homepage:
Store retriever narrows the nearby catalog to a manageable set of eligible candidates for each carousel.
Store ranker evaluates each candidate for the current consumer within a temporal and carousel context. Using behavioral, affinity, store, and contextual signals, it predicts outcomes such as engagement and conversion. It answers the question: How relevant is this store to this consumer right now?
Horizontal blender combines calibrated ranking predictions with business objectives.
Vertical ranker evaluates completed carousels within related content or objective groups.
Vertical blender combines carousel groups into the final homepage list. It balances signals such as session intent, engagement, diversity, exploration, long-term value, and page-level constraints.
Store ranker sits between retrieval and page composition, estimating the relevance of each candidate for the consumer’s current request. Its predictions provide the primary personalized signals used to order stores within store-based carousels.
The starting point: A multi-task DNN
Earlier versions of LightGBM and basic DNN rankers performed well on static features, but typically required separate models for different objectives and could not fully share learning across related outcomes. Multi-task DNNs address this by learning a common representation while preserving task-specific behavior, improving data efficiency, consistency, and the ability to balance multiple business goals in one model.
We organized the Store Ranker’s inputs into five broad groups:
Customer behavior: Such as historical views, clicks, orders, and conversion rates.
Context: Including time and day of the week.
Customer/store cross features: Previous interactions, purchase patterns, store preference, and embedding similarities.
Store quality and operations: Delivery time, distance, ratings, uptime, menu quality, market share, and pricing signals.
Behavioral sequences: These are drawn from a consumer’s interaction history.
These features provide a strong foundation for the transformer iteration; aggregated signals preserve stable customer and store context, while behavioral sequences expose the order and temporal interactions, allowing the model to learn how customer intent evolves.
Model architecture
Our baseline ranker used a multi-task multi-label (MTML) architecture built around two well-established components:
MMoE (multi-gate mixture-of-experts): A set of shared expert networks with per-task gates that allow related tasks like click and conversion to share capacity while still routing signals differently.
DCN (deep and cross network): An architecture that explicitly models feature crosses — interactions among customer, store, context, and promotion features — alongside standard dense layers.
The baseline architecture combines customer, store, and contextual features to support multiple prediction tasks. However, its aggregated behavioral inputs make it difficult to distinguish histories with similar overall activity but different sequences of events. Addressing this limitation required both richer sequence data and a model that could learn from it.
From foundation to production
Getting a transformer into production took two stages over several quarters. First, we strengthened the foundation with full-journey attribution, richer behavioral sequences, and robust feature representations. Then, we integrated the transformer into the existing ranker and adapted its architecture to meet production serving constraints.
Building the foundation
Before a transformer could add value, the data and the ranker around it had to be ready. Among the required steps were:
Full-journey data: We rebuilt attribution so the model could learn from a customer’s entire journey — impression, click, add-to-cart, checkout, and delivery. This data was collected across the app rather than just from the homepage. This enriched the labels available to the ranker, spanning positive milestones and allowing it to learn the underlying behavior patterns of a full customer journey.
Sequence features: We restructured click and conversion histories into sequence features enriched with temporal context — signals describing when each interaction occurred. We capped click histories at 500 interactions to limit feature-fetching latency. Conversion histories were substantially shorter and remained uncapped.
Robust feature representation: Continuous features are noisier and less predictable online than in training, so a model that fits raw offline values can degrade in production. We instead map each one to a percentile bucket — about a hundred buckets, each a small learned embedding — to create a stable representation that still captures nonlinear differences, as shown in Figure 3. Two practical lessons stood out:
Skip the zero-fill: Many engagement features are zero for most customers; computing percentiles over the non-default values keeps the buckets from collapsing onto that zero mass.
Convert selectively: Each converted feature enlarges the model’s input, so we apply it only to the highest-importance features, gaining the accuracy benefit without the full latency cost.
Figure 3: Percentile bucketing of a heavily zero-valued feature. Before (in blue), nearly all values collapse onto the zero-fill; after computing percentiles over the non-default values (in green), the informative range is resolved.
Transformers
Transformers can learn relationships among interactions separated by many steps in a behavioral sequence. This allows a ranker to preserve the order, timing, and context of customer actions instead of compressing them into fixed summaries. Industry work such as Meta’s HSTU and Pinterest’s PinnerFormer and TransAct demonstrate the value of learning from long, context-rich interaction histories.
For store ranking, this offered three key advantages:
Richer behavioral sequences: Each interaction can combine the store, customer action, and temporal context. Modeling these events in order helps the ranker recognize recency, repetition, routines, and shifts in intent that aggregate features may obscure.
Context-dependent interpretation of history: Fixed pooling treats a customer’s past interactions as a static summary. A sequence model can instead emphasize different parts of that history depending on the surrounding behavior
End-to-end, task-aligned representations: Store, action, and temporal embeddings are learned jointly with the sequence encoder and ranking objectives.
Figure 2.The baseline store ranker architecture with the new transformer branch added to encode customer interaction sequences. MMoE shares learning across prediction tasks, while DCN models feature interactions.
As shown in Figure 2, we introduced the transformer as a sequence-encoding branch within the existing multi-task architecture. Its customer-history representation was combined with candidate-store and contextual features before the established task heads, preserving the homepage objectives
Applying self-attention in store ranker
Customer histories mix recurring habits with one-off decisions. We wanted our store ranker to tell the two apart and to understand how they vary with context, such as time of day and location. Applying self-attention to click and conversion histories lets the model read each interaction in light of the others. Every action is enriched with context from the rest of the history, so what it means reflects the broader pattern it belongs to rather than the single event. Together, these contextualized actions form a holistic representation of the customer’s interests, and recurring preferences emerge from otherwise noisy behavior.
Imagine a customer has three past interactions:
Ordered from Sushi A
Ordered from Sushi B
Clicked on Pizza C
In this example, the attention layer gives the two sushi orders more influence than the pizza click when updating the Sushi A representation:
This shows how related interactions can reinforce a recurring preference in the customer’s history. This richer history representation became an input for store ranker’s click and conversion predictions alongside the candidate store and current request context. Figure 4 expands on this idea.
Figure 4: In this attention-weight visualization for an example customer, the line’s weight shows how strongly the model attends from one past interaction to another, and color denotes the attention head.
Adapting the architecture to serving constraints
The most difficult constraint was the requirement that our first transformer run on the existing serving infrastructure. On the upside, that pushed us toward higher quality and more efficient architecture choices, including:
A modernized Transformer block: We adopted SwiGLU (Swish gate linear unit) activations, RMSNorm (root mean square normalization), and pre-normalization in place of GELU (Gaussian error linear unit), LayerNorm, and post-normalization. Together, these updates improved offline ranking quality, raising the model’s relative AUC lift by 0.08%.
Taming the vocabulary: Store IDs span millions of values. Frequency-based hashing and shared embedding tables reduced the model from around 160 million parameters to 10 million — a whopping 94% reduction — while improving relative offline area under the curve (AUC) over the previous ranker from 0.88% to 1.15%.
Impact
The transformer produced a 1.15% relative offline AUC lift over the previous store ranker baseline, a substantially larger result than what was seen in recent architectural iterations. More importantly, it translated into online wins in a roughly three-week global A/B test of:
Order rate overall, driven especially by lower-frequency customers
Merchant trial rate — customers ordering from a new-to-them merchant — with trial rates up specifically in newer categories.
Together these drove a material annualized order value impact; (because of proprietary interests, we are omitting the absolute figure from this public discussion). The biggest gains came for data-sparse customers, low-frequency customers and those new to a category who are precisely the people for whom aggregate features carry the least signal and for whom sequence modeling helps the most.
Beyond the initial launch
Scaling toward generative recommendation: Our current ranker is a pointwise multi-task model that uses a transformer to encode and pool a customer’s interaction history, then predicts click and conversion probabilities for each customer/candidate pair. That objective imposes three structural limits:
First, because candidates are scored independently, the objective gives the model little reason to represent the order of interactions.
Second, the pointwise objective draws a single training label from each example, whereas a customer’s history is a sequence of many ordered decisions — a signal the current setup leaves largely unused as a prediction target.
Third, the model can only score candidates supplied by an upstream stage; it cannot propose them.
A generative formulation addresses these limits while preserving what already works. Rather than discarding the dense cross-features the current ranker depends on, it tokenizes them and combines them with the behavior sequence in a single representation, which adds sequential signals without giving up the set-level features that drive much of today’s accuracy. Reframing the objective as an autoregressive next-action prediction then turns each customer trajectory into a target at every step rather than a single label.
We adapted a similar variation to the hierarchical sequential transduction unit (HSTU) and the Meituan generative recommendation as described in this paper: MTGR: Industrial-Scale Generative Recommendation Framework. This applies HSTU-based generative modeling to industrial ranking while retaining the cross-features on which conventional recommenders rely. We are actively developing this direction and have seen encouraging offline gains.
Improving store identity understanding: Raw store IDs carry no inherent semantic information, so each ranker must learn representations from interactions, with limited signal for new or rarely visited stores and little transfer across rankers. We therefore explored hierarchical semantic IDs derived from store content as a common identity vocabulary across rankers. As a second, lighter-weight approach, we enriched existing hashed store embeddings with a content-cluster embedding.
We trained an RQ-VAE over content embeddings of stores on Doordash. Each store received four hierarchical codes, with 512 choices per level. We compared a single shared codebook with separate codebooks and built hierarchical category-alignment, coverage, and cardinality evaluations. Our results:
The first code captured a broad category structure; some codes grouped 10,000+ stores within a relatively narrow set of categories.
Our approximately 100 primary category labels could validate broad semantics but not the finer distinctions learned at deeper levels.
Our lesson: Separate codebooks produce a stronger hierarchy, but downstream ranking tests and richer labels are still needed to measure the value of fine-grained semantics.
Cluster-enriched store embeddings
For a lighter-weight approach, we added a learnable content-cluster embedding to the existing hashed store embedding and tested K-means configurations with 100, 500, and 1,000 clusters.
Our lesson: Coarse semantic grouping adds more ranking value than finer clustering. Cluster embeddings offer a low-cost incremental path, while hierarchical semantic IDs remain the richer long-term representation.
Conclusion and future work
Shipping DoorDash’s first transformer ranker at homepage scale was as much a systems achievement as a modeling one. Richer behavioral signals, context-sensitive matching, and robust feature representations delivered meaningful gains, especially for customers whose preferences were harder to capture with aggregate features. These results showed how transformers could learn connections across the marketplace to improve personalization for those customers with less data. Every gain had to fit within strict latency and cost budgets, shaping the architecture, features, and serving path.
This launch is a critical step toward generative recommendation on the homepage. The full-journey data and sequence features lay the foundation for a unified, near-real-time record of what each customer searched for, browsed, added to cart, and was shown. Building on this success, we are working toward a generative recommender that combines customer interaction sequences with the cross-features that drive today’s ranking quality. With the next-action objective and semantic IDs explored above, models can learn from every step of a customer’s history and generate candidates, supporting cold-start recommendations and discovery of new content across the app. Our goal is a state-of-the-art homepage that delivers a personalized, responsive, and diverse experience by understanding the customer’s full journey and generating the homepage slate as a whole.
Acknowledgments
We are indebted to the contributions of Da Long, Di Li,Shan Zhong, Yilin Li, Medhanie Irgau, Daniel Fonyo, Rui Hu, Parul Khurana, Colin Salter, Mauricio Barrera, Chunlei Li, Chun-Wei Lee, and Eric Gu.
Stay Informed with Weekly
Updates
Subscribe to our Engineering blog to get regular updates on all the
coolest projects our team is working on
Please enter a valid email
address.
Thank you for Subscribing!
Engineers using a machine learning (ML) platform need help debugging failed jobs, deploying models, and understanding platform behavior. Answering these questions often requires piecing together documentation, logs, and live system state, along with knowledge held by platform engineers.
DoorDash built an internal artificial intelligence (AI) support agent catering to engineers using the ML platform. From one conversational interface, it can retrieve guidance, inspect live state, run diagnostic tools, and suggest next steps.
For example, an engineer received a warning that a test model deployment would be scaled down because it had little traffic. Its calling service was still under development, so the engineer asked how to temporarily exempt it from cleanup. The agent explained the cleanup policy but could not provide the exemption procedure. A platform engineer supplied the missing guidance.
That gap exposes the harder engineering problem: building a system that repeatedly finds unresolved cases, classifies their causes, applies appropriate fixes, and measures whether support improves.
Creating the support agent marks only the beginning of the process. The systems the agent supports are constantly evolving, which requires the agent to evolve alongside them to remain viable. To ensure the support agent continues working as intended, we created an automated improvement harness to constantly evaluate the agent and keep it up to date so that it remains a helpful tool for our engineers.
The resulting harness is benchmark-driven, automated, and aligned with the judgment of platform domain experts. Together, these properties turn usage into a controlled improvement signal without assuming that the agent learns on its own. In this post, we explain how we benchmark support outcomes, turn recurring gaps into targeted improvements, and align automated workflows with our team’s judgment.
Choose an outcome metric, then make failures actionable
Figure 1: The harness repeatedly observes support outcomes, measures performance, classifies gaps, applies targeted fixes, and verifies improvements against a chosen outcome metric.
An improvement harness needs an outcome metric that reflects the agent’s job. For our support agent, success means fully resolving engineers’ questions. Reactions and broad quality scores are useful signals, but they do not tell us whether a response contained the information that resolved an issue.
Because of this, we built a live benchmark around resolution. For each eligible support case, it identifies the material facts behind the eventual resolution and asks whether the agent supplied them:
Full: The response supplied the material information required to resolve the question.
Partial: The response advanced the investigation but omitted something material.
Missed: The response did not materially advance the resolution.
Our top-line metric is the full resolution rate, the share of evaluated questions the agent fully resolves. Other agents may optimize for verified task completion, diagnostic accuracy, successful handoff, or time to resolution. The reusable principle is to choose a measurable outcome and connect observed gaps to fixes that can be tested against it. Figure 1 shows how the harness connects observed gaps, targeted fixes, and verification to the chosen outcome metric.
In this case, the benchmark rated the response Partial. Explaining why cleanup happens did not answer how to prevent it temporarily. The missing exemption procedure gave the harness a specific gap to address. A human-provided resolution can include temporary workarounds or incorrect assumptions. Before adding facts from a support thread to shared documentation, the harness checks that they apply beyond the incident and verifies them against authoritative sources.
Let usage reveal gaps, then classify each gap by its remedy
Greater usage exposes a broader, more current sample of the agent’s behavior, including such things as new question shapes, repeated failure modes, and human-confirmed resolutions that contain facts or diagnostic paths the agent missed. Usage supplies evidence; the harness turns selected evidence into improvements.
That conversion begins by classifying each unresolved response by the remedy it needs, as shown in Figure 2:
Knowledge gap: A durable resolution fact is absent from authoritative documentation.
Capability gap: The agent lacks the tool, data source, or workflow needed to obtain evidence.
Utilization gap: The capability exists, but routing, retrieval, invocation, or synthesis failed to use it.
Correctness gap: Documentation exists, but a relevant claim is stale, ambiguous, or contradicted by the underlying system.
Figure 2: Classifying gaps by their cause directs each one to the appropriate remedy: updating knowledge, adding capabilities, improving utilization, or correcting stale documentation.
This classification prevents attractive but ineffective fixes. For instance, documentation cannot repair a failed live lookup, a new tool is unnecessary when routing fails to select an existing one, and copying an old workaround could make the knowledge base worse. The category should identify the required system change.
A completeness loop adds missing facts to shared documentation, while a correctness loop repairs stale claims. Capability and utilization gaps require changes to tools or agent behavior
Keep one authoritative knowledge source through two loops
Domain teams keep designated upstream documentation as the source of truth, while the agent serves a synchronized snapshot. This prevents the agent from becoming an independent knowledge authority that drifts from the documentation that engineers use. Humans and the agent rely on the same durable explanations.
Figure 3 shows how two independent loops keep shared documentation complete and correct:
Completeness loop: For partial or missed responses, the workflow identifies missing facts, checks them against existing documentation and authoritative evidence, and updates the owning document. In the cleanup case, the update documented how to add a deployment to the exemption list, record an owner and reason, and remove the exemption once real traffic starts. Some cases need no documentation change because the advice is incident-specific, unsupported, already documented, or requires a capability fix.
Correctness loop: Support outcomes reveal only the topics engineers happen to ask about. An independent correctness loop starts from the documentation: it samples concrete claims and checks them against authoritative implementation or configuration evidence. When evidence contradicts a claim, the workflow applies a focused correction through the same source-of-truth path.
Figure 3: Two complementary loops keep shared documentation complete and correct. Support outcomes reveal missing knowledge, while independent fact-checking identifies stale claims.
Completeness asks: “What did the human resolver know that the agent could not find?” Correctness asks: “Is what the agent found still true?” Retrieval quality cannot compensate for a corpus that is incomplete or wrong.
Automate recurrence with versioned workflows and deterministic scripts
Scheduled workflows run the recurring benchmarking, knowledge maintenance, synchronization, and replay work. Each combines versioned skills with deterministic scripts that define the process, validation, and expected outputs. At DoorDash, we automate these workflows through cron-triggered playbooks on Flux, our cloud-based agent platform.
Deterministic scripts control execution through selecting eligible inputs, validating structured outputs and evidence, bounding retries and timeouts, detecting duplicates and no-op cases, and returning labeled outcomes. Language models handle bounded interpretation, such as extracting candidate facts, classifying a gap, or comparing a claim with supplied evidence. Free-form model prose never controls workflow state.
This boundary lets the harness run frequently without redefining its controls. It gathers evidence, applies targeted changes, and leaves replayable artifacts; domain experts tune the governing rules between runs.
Figure 4: Scheduled workflows execute automatically. Between runs, the team turns feedback into updates to the skills and scripts that govern future behavior.
Align the harness with team judgment, then verify behavior
The first version of a workflow rarely captures every distinction the team cares about. A fact checker may select a weak source, a completeness workflow may mistake an incident-specific workaround for durable knowledge, or a classifier may recommend a new capability when an existing one was simply underused.
Platform domain experts compare workflow outputs with team expectations, flagging weak evidence, unhelpful findings, and recurring false positives. When a pattern recurs, we encode the lesson into the skill, script, schema, example, fixture, or validation gate that governs future runs. Human feedback improves the workflow contract without becoming a permanent manual gate.
Alignment is not a prompt written once or an attempt to reproduce one person’s wording. It is the repeated conversion of experienced judgment into explicit, replayable rules.
A change matters only if it improves the agent’s behavior. Documentation may be correct but unretrievable. Retrieval may succeed while the response omits the fact. Or a capability may fail to activate for the original question shape.
The harness replays the original case after a change reaches the knowledge snapshot or deployed agent. It checks whether the agent can retrieve and use the required facts. In a later replay of the cleanup question, the agent supplied the exemption procedure and was rated Full. The live benchmark tracks whether accumulated changes improve the full resolution rate across cases.
Conclusion
Launching the support agent was only the starting point. The harness we created around it made up the larger engineering lift. It provides resolution-grounded measurement, remedy-oriented classification, team-owned knowledge, independent completeness and correctness loops, scheduled workflows, deterministic controls, and continued alignment with domain judgment.
Over the course of the first couple of months, the harness has increased the full resolution rate by over 200% while catching some 100 knowledge base corrections and patches.
A support agent only works if it does what its name suggests by providing support for users. Otherwise, it becomes a burden rather than a tool.
Greater usage gives that harness more representative questions, failure modes, and human-confirmed resolutions. The agent improves only when the system turns those signals into targeted changes and verifies the resulting behavior. The support queue becomes more than work to clear; it becomes a controlled signal for improving the agent, its capabilities, and the knowledge shared by humans and AI.
Acknowledgements: Thanks to Claudia Sun, Bowen Dan, Petter Ivmark and Mert Sanver for contributing to this post and harness.
Thanks to Artem Petrov, Emma Dang, Emmanuel Khayat, Francesco Peri, Haifeng Geng, Norman Rosner, Sertan Şentürk, Sowmya Yellapragada, Steffen Klempau, Steve Hoffman, Taoxin Jiang, Teer Ying, Yong Go, Zhe Liu for the contribution to the development of the agent.
Thanks to Santosh Banda and Jeffrey Hwang for their help in building resilient flux automations.
Stay Informed with Weekly
Updates
Subscribe to our Engineering blog to get regular updates on all the
coolest projects our team is working on
Please enter a valid email
address.
Thank you for Subscribing!
We compared Self-Distillation and GRPO as on-policy post-training methods to teach models new skills and measured their retention of existing capabilities. We trained Nemotron Nano 9B on tool-use, science, and logic puzzles, then measured performance across many benchmarks covering 5 themes: code, math, instruction following, logic, and retained knowledge.
TL;DR
Both methods improve on tool-use and science, but GRPO improves much more on Knights & Knaves, our chosen logic puzzle dataset: 95.9% against 31.6% for Self-Distillation, which ends below the base model’s 47.7%.
Existing capabilities on instruction following, logic and code degrade more under self-distillation than under GRPO. After training on the three datasets in sequence, self-distilled Nemotron loses 30 points on logic, 21 on instruction following and 15 on math. GRPO never loses more than a fifth of a point on any theme at any stage, and ends 7 points up on math.
Self-Distillation teaches Nemotron to lean on a demonstration it can’t see. Its answers cite “the example response” that only its teacher was shown, and with thinking turned on Self-Distillation puts the last training set’s answer format on every task.
Self-Distillation also shows signs of reasoning collapse. Its math answers shrink by a third, from 896 to 606 tokens on average across MATH-500, AIME 2024, AIME 2025 and AMC 2023. On the other hand, GRPO’s answers grow to 1522 tokens on average. GRPO also learns to check its work. For example, the share of AIME 2025 answers with an explicit self-check rises from 1% to 22%, against 4% under self-distillation. Interestingly, Self-distillation on the three datasets mixed together, instead of training in sequence, softens most of the accuracy loss.
Why look at this
Deployed models are rarely static after launch. At DoorDash, new tools, domains, and tasks keep expanding the surface area we need our agents to cover. Each round of post-training has to add those capabilities without degrading the ones already in production. Supervised fine-tuning (SFT) or continual fine-tuning (CPT) often comes at the cost of existing capabilities. On-policy RL is typically better at reducing the risk of catastrophic forgetting compared with supervised fine-tuning by making less aggressive changes to the model’s output distribution (Shenfeld et al., 2025; Chen et al., 2025). RL also tends to produce more generalizable learnings vs SFT which tends towards memorization (Chu et al., 2025). However, RL requires a usable reward signal and multiple sampled responses per prompt, requiring more than 5x the compute and training time relative to SFT,.
Self-distillation (an overarching term for OPSD (Zhao et al., 2026) and similar variants) aims to combine learning from demonstrations with the retention benefits of on-policy training. The student samples a response to the question alone, while a teacher copy of the model receives both the question and a worked demonstration. Training minimizes token-level KL divergence between their next-token distributions along the student’s sampled response, allowing the student to learn from the demonstration while training on its own outputs (Shenfeld et al., 2026; Zhao et al., 2026). Shenfeld et al. report learning several skills sequentially with substantially less forgetting than supervised fine-tuning (2026).
Some studies report shorter reasoning traces and fewer explicit checks after self-distillation. For example, self-distillation can suppress a model’s “wait”, “hmm” and “let me check” moments (Kim et al., 2026), and can contribute to thinking collapse (Kaur et al., 2026; Peng et al., 2026). In continual post-training specifically, self-distillation has been found to forget more than GRPO (Wang et al., 2026). To guide our own post-training efforts, we directly compare self-distillation with reward-based optimization on the same sequence of tasks, measuring how each method balances learning new skills with retaining existing capabilities.
We compare self-distillation and GRPO on the same three tasks, measuring both task learning and retention across twenty benchmarks. The sequential runs use the same task order.
Setup
Base Model
Both Self-Distillation and GRPO update all model weights. Unless otherwise mentioned, we use Nemotron Nano 9B, with thinking off as the base model for the main comparison. a separate Self-Distillation chain runs with thinking on. Each method trains for the same number of iterations.
Grading
Answers typically count only if they are in the required format or in the eval benchmark instructions. We find that Self-Distillation sometimes doesn’t format the answer properly, or generates extra tokens beyond the answer. For those cases, we decouple the formatting issues by leniently grading the metrics, passing answers that are functionally correct but in a different format than the grader expected.
Sequencing
The base model is trained in three stages: Tool Use, then Science, then Knights & Knaves, with each stage starting from the previous stage’s weights. We selected these datasets as they have provided expert examples, and represent a diverse set of task types. We score every stage on the three trained tasks, using held-out test splits, and on five themes made up of independent and diverse benchmarks covering Instruction Following, Code, Math, Logic, and Knowledge.
Results
Both methods learn tool use and science. Tool-use rises 8 points under self-distillation and 20 under GRPO; science rises 33 and 29. On Knights & Knaves, GRPO learns far more: 95.9% against 31.6%. Self-Distillation never fully recovers the 18 points of Knights & Knaves it loses in the tool-use stage.
Self-distillation’s losses grow sequentially. Nemotron’s instruction following falls by 15, then 20, then 21 points below the base model, and logic 12, then 25, then 30. GRPO never drops more than 0.2 points on any theme at any stage, and after the Knights & Knaves stage it is up on every theme: 7 points on math, 4 on logic and 3 on instruction following.
Knowledge is the primary outlier. Neither method moves the knowledge theme by more than 4 points. The largest single drop is MMLU-Pro under Self-Distillation (62.9% to 54.0%) which is likely due to the expected chain of reasoning before the answer.
Impact of Formatting and Grading
Part of Self-Distillation’s loss is formatting. Some answers are right but not in the required form: a third of the BBH logic questions it loses are right once the format is ignored. Ignoring format cuts the BBH logic loss from 57 points to 37, so it still ends 37 points below the base model on BBH logic and 12 below on IFBench, while GRPO ends 5 points above on BBH logic and 2 above on IFBench.
Impact on length of answers and self-checks
Self-distillation cuts Nemotron’s median AIME 2025 answer from 856 tokens to 597. GRPO keeps the median at 860 tokens, while the mean goes from 1,074 to 1,802 tokens, implying that the long answers get longer. Nemotron’s base model with thinking off almost never checks its work. Knights & Knaves GRPO training teaches the model to check its own work, as seen on the AIME 2025 eval set, where self-check frequency rises from 1% to 22%. Interestingly on IFBench, self-distilled answers get longer instead (median 208 to 306 tokens) while accuracy falls, because the model explains the questions instead of following the instructions.
Figure: Nemotron’s math answers by stage, thinking off. Left: median length. Right: the share of answers that say “Wait”, “Hmm” or “let me check”. The markers at the far right are Self-Distillation trained on all three datasets shuffled.
What if the skills are learned together?
We train the model with self-distillation once on all three datasets shuffled together. This softens most of the forgetting: logic drops 4 points instead of 30, Instruction Following drops 6 instead of 21, math 8 instead of 15 and code 2 instead of 5. Tool-use (66.0%) and Knights & Knaves (56.7%) also end higher than with sequential training, and Knights & Knaves ends above the base model.
Mixing doesn’t bring back the long answers, though. AIME 2025 answers stay short (median 495 tokens), and only 2% check their work. So learning one skill after another is likely more indicative of the performance drops.
Impact of Thinking Mode
We ran the same three-stage self-distillation chain with thinking on. It learns new skills: tool use goes from 53.6% to 62.9% and science from 21.9% to 72.2%. But the thinking gets shorter, with the median AIME 2025 answer dropping from 10,092 tokens to 4,768. With format ignored, AIME 2024 drops from 74.2% to 40.4%, AIME 2025 from 59.2% to 26.2%, ProofWriter from 48.3% to 25.3%, and MATH-500 from 95.6% to 87.2%.
Knights & Knaves shows the failure most clearly. With thinking on, accuracy falls from 89.3% to 70.1% after science, then to 66.4% after puzzle training. Answers get shorter (median 2,436 to 1,945 tokens), which correlates with a hallucination that it already knows the answer from the teacher demonstration and stops “searching”.
Example Traces
Individual examples show the mechanisms behind self-distillation forgetting. Reading incorrect examples shows a few key patterns. In each example below, the highlighted text is where Self-Distillation’s answer goes wrong.
1. Following an invented example(AMC 2023) The base model and GRPO pair up the cubes in 2³ − 1³ + 4³ − 3³ + … + 18³ − 17³, simplify each pair to 12k² − 6k + 1 and sum it to 3159. Self-Distillation starts the same way, then turns to “the example response” which was only presented by the teacher. “Since the example arrives at 270, I will follow its logic to ensure consistency,” it writes, and answers 270. It gets 2 of 8 samples right; the base model and GRPO get all 8. On AIME 2025 it does the same with a geometry problem, overriding its own calculation: “Given the example’s final answer of 42, I adjust to align with the intended method.”
2. It describes the rule and then breaks it.(IFBench) Asked to rewrite a passage so that “the response must start with a verb”, the base model and GRPO both begin “Begin…”. Self-Distillation begins “The response must start with a verb, so I will begin with “Cultivate”…”, restating the rule in a sentence that breaks it, and ends with a remark that wasn’t asked for.
3. Right answer, wrong format.(BBH boolean expressions) Self-Distillation’s reasoning is correct, but it drops the few-shot examples’ “So the answer is False.” for its own “Thus, the final answer is **False**.”, so the strict grader marks it wrong. This is why we also report lenient scores.
4. Overindexes to the training format (with thinking)(Tool-use) The call is right (listRoles with the user’s access token), but it comes in <reasoning> and invented <action> tags instead of the Action: / Action Input: lines the prompt asks for.
In the failures above, Self-Distillation either borrows the teacher’s view of the problem (an example it was never shown, an answer it never derived) or loses track of the instruction and the format. This makes sense in context, it learns from a teacher that has already seen the solution, so the teacher never needs to work things out or check them, and the student learns to write as if it had seen one too. GRPO learns from its own attempts, learns to check its work, and grades only on whether the final answer is right.
Conclusions
In this training experiment, GRPO learned as much as Self-Distillation on tool-use and science, far more on Knights & Knaves, and forgot nothing; Self-Distillation forgot logic, instruction following and math.
RL still has an edge in protecting reasoning and instruction following. GRPO stayed within a fifth of a point of the base model on every theme and gained on math and logic, consistent with on-policy RL staying close to the original model.
Self-Distillation indexes strongly towards the teacher demonstration. Nemotron’s self-distilled answers cite the teacher’s demonstration, defer to answers they never derived, and copy the last dataset’s answer format onto other tasks. Facts survive (knowledge moves less than 4 points); procedures and formats do not.
Training Self-Distillation on the skills together instead of one after another softened the forgetting effect.
Read the documentation of an API it has never seen and answer a request with the right calls (Action: / Action Input: in JSON). Graded on tool names and arguments.
Logic puzzles with multi-step reasoning with 2 to 8 islanders: knights always tell the truth, knaves always lie; name everyone’s role.
3,000 / 700
Evaluation Benchmarks across five themes
Each theme score is the mean of its benchmark scores. We report single-response performance, using greedy decoding except on AIME and AMC, where we average correctness across eight sampled responses per question.
ProofWriter (the six logic tasks of BIG-Bench Hard), Sudoku (Sakana AI, 2025) (share of empty cells filled correctly)
Knowledge
MMLU, MMLU-Pro, TruthfulQA, HellaSwag, Winogrande
Stay Informed with Weekly
Updates
Subscribe to our Engineering blog to get regular updates on all the
coolest projects our team is working on
Please enter a valid email
address.
Thank you for Subscribing!
Runtime configuration values are a critical part of DoorDash’s engineering infrastructure, enabling teams to make changes quickly and safely without requiring a new deployment or service restart. These values are used to power feature flags, gradual rollouts, experiments, operational controls, and other mechanisms that let engineers quickly adjust application behavior at runtime.
This blog explains how we overhauled our runtime config value distribution to eliminate a scaling concern in one of DoorDash’s highest queries-per-second systems. This evolved architecture reduced latency in a major system bottleneck by more than 100-fold and produced a drop of more than five times in our average node Elastic Block Store input/output operations per second (EBS IOPS), ensuring a reliable and performant capability to support our needs on a massive global scale.
Previous architecture
Kubernetes is the primary platform used to orchestrate DoorDash services. Our prior architecture for runtime config value distribution was centered around a K8s DaemonSet that runs on every node across the fleet. This DaemonSet polls S3 for an updated .tar.gz archive containing the latest config values, then extracts them onto the K8s node hostPath. Each version of the .tar.gz is downloaded into its own directory, and a symlink points at the latest one that should be used. From there, hostPath-backed volumes with the config values are mounted to service pods at /srv/config-values. Note: There are different config value types internally that each use different mounts and volumes but, for the sake of simplicity, we refer to the stand-in throughout this post.
Each runtime config value is stored as a file regardless of its underlying type. From the perspective of a service, accessing the latest feature flag, experiment, or any other config value type becomes a fast and reliable Linux filesystem read of a specific file in /srv/config-values. Two caching layers make these file reads even faster — the node-local Linux kernel page cache and a pod-local internal cache of values.
When a new version is ready, updating the symlink makes it immediately visible to services at /srv/config-values without interrupting reads. If for any reason the runtime DaemonSet fails to get the latest values from S3, the previous values remain in use and the system continues to operate reliably. The symlink keeps pointing at the last version that downloaded successfully; because downloads land in a temporary file that is only committed once complete, a failed or partial transfer can never replace a good version. A garbage collector periodically clears out older versions, but it never touches the active/symlinked dataset. The worst case scenario is stale values, not missing ones.
By design, every node receives every runtime config value. This allows pods to be efficiently scheduled to any node in the fleet without considering config availability, at the relatively small cost of storage efficiency. The vast majority of these values are not used; each pod typically only accesses a small subset of relevant files.
Diagram of Previous Architecture
Figure 1: Diagram showing the previous config value distribution architecture.
Scaling concerns
Our old architecture supported our needs for years, until several scaling factors slowed the .tar.gz extraction beyond our timeout limits. When we bumped the timeout from 15 seconds to 30 seconds for getting the .tar.gz from S3 and extracting it to the K8s hostPath, we were regularly hitting the new 30-second timeout within a matter of weeks, as seen in Figure 2 below.
Our investigation of this reached the following conclusions:
Runtime config value usage has grown dramatically across the company. The .tar.gz archives went from containing hundreds to tens of thousands of distinct values.
Extracting this many files at once overloaded the underlying EC2 EBS disk volume.
As our service footprint grew, this problem would only continue to worsen as demand for config values increased.
This latency issue was a major concern because failing to get the latest runtime config values to pods in a timely manner could slow incident mitigation.
Extraction Latency Bottleneck
Figure 2: Extraction latency mapped over time. The 15 second timeout is consistently hit until the timeout is bumped to 30 seconds, which is then consistently hit only a few days later.
Crux of the issue
The core problem was that every .tar.gz update required eagerly extracting the entire runtime config dataset onto every node, even though services only need access to a small subset of those values. This led to unsustainably large increases in latency caused by IOPS constraints.
Any long-term solution needed to avoid that unnecessary extraction work, particularly in light of the fact that the number of runtime config values was only going to keep growing. That could mean accessing values remotely, decompressing data on demand, or using another approach that did not require materializing every file on every update. This became a key consideration as we researched potential solutions.
Research and design
Finding a solution to this issue was challenging, as config distribution had many strict system requirements, including:
Speeds comparable to native Linux file reads
Virtually zero downtime
No change to existing access patterns
Table 1 below outlines all notable approaches we considered during our research and design phase.
Potential Solutions to the Config Value Distribution Scaling Concerns
Table 1: Potential solutions to the config value distribution scaling concerns, each labeled with a list of pros and cons.
Out of all of the solutions we investigated, SquashFS offered the most benefits and the fewest drawbacks for fixing the config value distribution scaling concerns.
Overhaul using SquashFS
After selecting SquashFS, we began an overhaul of our runtime config distribution systems that would work with it. We prioritized read latency over image size, because the image is a single file each node downloads once per version; size impacts performance less than latency. After extensive benchmarking on our real-world runtime config values, we determined that SquashFS compressed with LZ4 using 128 KB blocks delivered the best average performance, as shown in Table 2. We then modified our config distribution service to upload a .squashfs image in this format to S3 alongside the existing .tar.gz archive containing the same data.
Benchmarks for SquashFS Performance using LZ4 with 128 KB blocks
Table 2: First byte latency benchmarking comparing raw EXT4 file reads against file reads of SquashFS using LZ4 with 128 KB blocks. Raw EXT4 reads are only a few microseconds faster.
The new architecture for SquashFS overlaps significantly with the prior architecture for .tar.gz. As with .tar.gz, we poll for the newest SquashFS images from S3 in the runtime DaemonSet. Instead of extracting the archive, however, we mount the .squashfs image as a loop device. This lets Linux treat the image file as if it were a read-only disk partition. The SquashFS driver can then expose its filesystem through Linux’s normal filesystem interface, decompressing the necessary data blocks on demand as files are accessed rather than extracting everything up front.
Recall that every node receives every runtime config value, with each pod typically only accessing a small subset of relevant files. Because of this, a small number of on-demand decompressions will be performed relative to .tar.gz’s eager extraction of all values. This, alongside our two layers of caches stopping a majority of decompressions (the node-local Linux kernel page cache and a pod-local internal cache of values), is a major reason why SquashFS is so efficient for our use case.
From the perspective of service code, nothing changed. Service pods continue reading the same files at /srv/config-values, while the backing hostPath volume is changed to point at the SquashFS filesystem. K8s mount propagation made each filesystem mounted by the runtime DaemonSet visible to service pods that already were running, which allowed updates without pod restarts. Because SquashFS preserved the existing directory structure and filesystem interface, it could also reuse the existing pod-local caching infrastructure. This compatibility was a key design feature; it would be extraordinarily disruptive to coordinate a change to access patterns across thousands of services.
The existing reliability guarantees all still hold. Each new image is mounted into its own directory; the symlink only swaps over once that directory is fully in place, so pods never see a half-built version. Old versions are reclaimed by the same garbage collector used for .tar.gz. SquashFS needed only one change to the garbage collector: unmounting the directory before deleting it. That unmount of the previous version is lazy, so the directory goes away immediately, but the kernel keeps the underlying filesystem alive until the last in-flight read finishes. A pod reading a file mid-rotation is never interrupted.
Diagram of New Architecture
Figure 3: Diagram showing the new config value distribution architecture.
Rolling out SquashFS changes
Because runtime config values are critical to DoorDash, we took a cautious approach to the rollout. Over the course of several months, we gradually migrated service pod config volumes from the existing .tar.gz-backed hostPath to the new SquashFS-backed hostPath. Each rollout batch was announced across the engineering org and carefully monitored for regressions or performance impacts. After all services had successfully migrated to SquashFS, we officially deprecated the .tar.gz distribution path to eliminate its remaining resource overhead.
New architecture wins
Our new SquashFS-based solution delivered a number of benefits, including:
Removal of a major scaling limitation for our runtime config value distribution.
A more than 100x latency drop in the extraction bottleneck, with the latency plummeting from regular 30-second timeouts to averaging under 200 milliseconds, as shown in Figures 2 and 4.
A more than 5x reduction in average K8s node EBS IOPS, as shown in Figure 5.
A more than 2x reduction in peak runtime DaemonSet CPU usage, as shown in Figure 6.
Latency Drop in Extraction Bottleneck
Figure 4: Latency in the extraction bottleneck. SquashFS latency is dramatically lower than the baseline .tar.gz latency.
IOPS Usage Drop
Figure 5: Average K8s node EBS IOPS before and after .tar.gz was deprecated. A large drop can be seen after the deprecation.
CPU Usage Drop
Figure 6: DaemonSet CPU usage before and after .tar.gz was deprecated. A large drop can be seen after the deprecation.
Acknowledgements
This project wouldn’t have been possible without the invaluable support of the following engineers: Luigi Tagliamonte, Tim Kapnik, Fredrik Nilsson, Bronson Mirafuentes, Ivan Radakovic, Alec Rabold, Rabun Kosar, Matt Gode, and Stephen Joel.
Stay Informed with Weekly
Updates
Subscribe to our Engineering blog to get regular updates on all the
coolest projects our team is working on
Please enter a valid email
address.
Thank you for Subscribing!
DoorDash’s query intent understanding (QIU) system uses catalog and web evidence to interpret ambiguous marketplace searches. We built Decoupled Search Grounding (DSG) to give that system a more controllable grounding layer. In our QIU evaluation, DSG matched or slightly exceeded native-search accuracy while reducing search costs by more than 98%.
Consider “450 north.” In our published QIU case study, the ungrounded model classified it as a restaurant. Catalog evidence and web search identified a craft brewery, and the system resolved the intent to Alcohol. That distinction directs downstream retrieval toward the relevant inventory instead of restaurant results.
Native search made grounding easy to enable, but kept retrieval decisions inside the model provider’s API. We needed to choose search providers, reuse evidence across applications, tune retrieval depth, and measure search cost and latency independently of the reasoning model.
DSG exposes those controls through a shared gateway compatible with the Model Context Protocol (MCP). As Figure 1 shows, it separates reasoning from retrieval so that either can change without replacing the other.
Figure 1: Native search couples the agent, model, and search provider. DSG separates reasoning from retrieval infrastructure.
Problem: Grounding has three parts
Native search means the provider’s API invokes its own search stack and stitches the results into generation. One request goes out, one answer comes back, and everything in between is opaque. That is fine for a chat window, but it becomes a liability when the model call is one node in a pipeline.
The production problem has three dimensions:
Control: There is no seam between which model reasons and which backend grounds it, so swapping models or reacting to a vendor price change means touching the model integration.
Reuse: Two agents asking the same question pay for two searches. There is nowhere to intercept the query.
Observability and contract safety: Per-query cost and latency are invisible, and enabling search breaks strict output contracts.
DSG exists because control, reuse, and observability belong in one shared layer, not in every agent.
Search-induced verbosity
Many of our large language model (LLM) calls are intermediate nodes whose output is parsed as JSON, matched against an enum, or read as a Boolean. The prompts are clear; provide only the final answer entity with no explanation or preamble.
Without search, models comply. With native search on, they often do not. Asked to compare two building heights under the instruction “Provide ONLY the final answer entity,” native search returned 245 characters opening with “Based on the search results …” DSG returned three characters: “Yes.” Both responses were correct; only one was parseable.
On HotpotQA, Claude Sonnet 4’s native-search answers violated an explicit “answer only” instruction 78.1% of the time by opening with explanatory framing. This was not an isolated formatting issue. Enabling search changed how the model behaved, not just what it knew. We did not see the same pattern with DSG, where evidence returns as a structured tool response instead of inside the generation stream.
Architecture
DSG sits between our agents, the reasoning model, and a registry of pluggable search backends including Serper, BrightData, Firecrawl, Exa, and Tavily. Native search can be registered as one more provider behind the same interface.
Figure 2: High-level architecture of Decoupled Search Grounding
As Figure 2 shows, DSG gives every agent and reasoning model a single MCP-compatible interface to multiple interchangeable search providers. The gateway defines shared controls once, reuses exact or semantic cache hits, falls back across providers when needed, and returns normalized, source-aware results – so no agent hard-codes a search integration.
This split gives the platform properties that per-agent integrations do not:
The reasoning model remains swappable; grounding policy does not move when the model does.
Provider choice, fallback order, cache policy, and retrieval depth become configuration, not code.
One platform team tunes grounding for every agent at once.
Cache warmth compounds across workloads instead of resetting per agent.
Request lifecycle
Each search request follows a structured lifecycle that prioritizes cached results before invoking an external provider. The steps below show how DSG normalizes the query, checks both cache layers, routes misses through the provider fallback chain, and returns a structured response with telemetry.
A single query runs through the following steps:
Normalize the query so that trivially different phrasings hit the same cache entry.
Check the exact cache: A hit returns immediately, with no provider call.
Check the semantic cache: Reuse a prior result if its embedding is similar enough.
Walk the provider fallback chain only if both caches miss. Timeouts and errors advance to the next provider automatically.
Normalize the response into a shared title, URL, and snippet schema.
Write both cache layers, scoped per provider, with time-to-live tuned to how fast that answer goes stale.
Return a structured tool response to preserve the output contract that native search blurs.
Every step emits telemetry, such as branch taken, provider, latency, and cost.
Source-aware, normalized results
Every provider returns a different shape. DSG normalizes all of them into title, source URL, and content snippet. That gives the model an explicit provenance for its reasoning and provides the platform an inspectable artifact for logging, debugging, and source filtering. Returning results as a discrete tool response is also a direct mitigation for search-induced verbosity.
Provider abstraction with configured fallback
New HTTP providers onboard through a YAML adapter covering endpoint, request template, response mapping, and cost metadata, with no application code changes. If a provider times out, the request falls through a configured chain, preventing one bad provider from removing grounding for every agent.
A search intelligence layer that caches before it searches
Every query checks the exact cache, then the semantic cache, and only then a live provider. Entries are scoped per provider so results never silently overwrite each other, and each carries its own time-to-live — a short duration for recency-sensitive queries and longer for stable facts. A high hit rate does not have to mean stale results.
Because the cache sits behind a shared gateway, it compounds. A query resolved in one workload can be served instantly to a different workload that may be making a similar query.
Structured telemetry on every request
Logs are kept per query on provider, cache outcome, retrieval depth, latency, and cost. We now know how much search costs and we have a full dashboard showing us what was spent and how.
Results
As shown in Figure 3, we evaluated DSG against native search across five frontier models — GPT-4o, GPT-4o-mini, Gemini 2.5 Flash, Gemini 2.5 Pro, Claude Sonnet 4; three public QA benchmarks, and our e-commerce query intent understanding (QIU) production workload.
Figure 3: Cost versus accuracy on public benchmarks. DSG reaches native-search accuracy at roughly 10 to 30 times lower cost. Key takeaway: DSG configurations achieve 83% to 86% accuracy, which is on par with native search’s 87.7% at a fraction of the cost.
DSG with BrightData lands within 1.6 accuracy points of native search at roughly 11 times lower cost. DSG with Serper, which is the cheapest configuration that still clearly beats no search , costs under 70 cents per 1,000 queries.
On FreshQA, which focuses on recency-sensitive questions, native search outperformed DSG across all five models tested. Provider search stacks have freshness and indexing advantages that general-purpose search APIs do not always match. The conclusion is not that grounding should always be decoupled, but that the backend should be a routing decision, with native search available as one option behind the same interface.
Production workload: Query intent understanding
We evaluated QIU on 7,988 general non-food retail queries and 2,335 synthetic long-tail queries. Accuracy measures the final resolved intent. With Gemini Flash as the reasoning model, DSG+Serper achieved 93.90% accuracy versus native search’s 93.40% on Retail, and 87.79% versus 87.62% on Tail. Reported costs cover search-provider charges and exclude model inference.
Evaluation set
Native accuracy / cost per 1K
DSG accuracy / cost per 1K
Retail – general non-food (N=7,988)
93.40% / $7.90
93.90% / $0.110
Tail – synthetic long-tail (N=2,335)
87.62% / $10.37
87.79% / $0.146
Table 1: Across the general retail and synthetic long-tail QIU datasets, DSG matched or slightly exceeded native-search accuracy while reducing search costs by more than 98%.
As shown in Table 1, DSG matches or slightly exceeds native accuracy at more than 98% lower cost. The native baseline here is Gemini Flash with integrated Google search grounding, one of the strongest native integrations available; matching it with swappable general-purpose providers suggests externalized control does not cost quality.
Caching
As shown in Table 2, a warm cache cuts latency 68% and rounds search cost to zero. Because the cache is shared, it warms faster as more workloads route through the gateway.
Pass
Cache hit rate
Search cost / 1K queries
Average latency
Cold
6.2%
$0.7385
4,570 ms
Warm
99.4%
$0.0045
1,465 ms
Table 2: Compared with the cold-cache pass, the warm-cache pass increased the hit rate from 6.2% to 99.4%, reduced average latency by 68%, and lowered search cost per 1,000 queries by more than 99%.
Retrieval depth as a tunable parameter
Decoupling turns retrieval depth from a hidden vendor default into a parameter we set. Across three models on SimpleQA, increasing retrieval depth from 2 to 6 results raised average accuracy from 78.7% to 84.9%, a 6.2-point gain; increasing depth further to 10 results added only 0.6 points more, to 85.5%. That gives us an evidence-backed default and the option to trade retrieval depth for latency or cost.
Native search versus DSG
As shown in Table 3, native search is not worse, but instead represents a different point on the trade-off curve. It’s a reasonable one when freshness matters more than control. DSG makes that point a per-workload choice instead of an inherited default.
Dimension
Native search
DSG
Accuracy
Strong, especially on freshness-sensitive queries
Near-parity on public QA; matches or exceeds native in production
Search cost
Fixed, bundled into the model call
Tunable routing, far lower in every configuration measured
Table 3: Native search provides strong accuracy, particularly for freshness-sensitive queries, but bundles retrieval decisions within the model provider. DSG achieves comparable accuracy while making cost, caching, latency, provider choice, and output reliability controllable for each workload.
Limitations and what’s next
DSG does not make native search obsolete. However, there are a few limitations to keep in mind:
We now depend on third-party vendors for stability, latency, and data quality. Their pricing can shift the trade-off we measured, so the durable result is the interface, not the price point.
Multi-hop reasoning benefits less than single-hop lookup. On HotpotQA, search of either kind gave modest gains; deep reasoning likely needs iterative retrieval loops, not one call.
Search-induced verbosity is mitigated, not solved. The structured tool boundary reduces it; catching it systematically needs contract-aware validators at the gateway.
These limitations have motivated our next planned efforts: adaptive routing that learns depth and provider per query, contract-aware output validation, and iterative retrieval for multi-hop workloads.
Conclusion
Reasoning models and evidence retrieval evolve at different speeds. Separating them lets us improve either independently and choose the balance of quality, freshness, latency, and cost that each workload needs. For DoorDash’s QIU workload, that separation preserved accuracy while substantially lowering search costs. The broader engineering lesson is to make grounding an explicit interface that teams can evaluate and change as their requirements evolve.
Acknowledgements
Swaroop Chitlur, GenAI Platform Team
Sudeep Das, NV Team.
Stay Informed with Weekly
Updates
Subscribe to our Engineering blog to get regular updates on all the
coolest projects our team is working on
Please enter a valid email
address.
Thank you for Subscribing!
Engineering AI systems people can trust
At DoorDash, our software engineering internship program is designed to be immersive and impactful. Interns don’t just observe — they’re embedded in engineering teams, contributing to projects that Dashers, merchants, consumers, and internal teams use every day.
Across this year’s projects, three interns on three unrelated teams independently converged on the same problem: getting a language model to produce something useful is the easy part. Making that output trustworthy enough to ship is the work.
Their three projects sit at different points on the same spectrum. Gage Garcia’s tool proposes data-quality checks, but by design it can only ever open a draft pull request. Sharif Velasquez’s agent authors production dashboards directly. Shreeyash Gowaikar’s pipeline runs failure investigations on a schedule, with no engineer in the loop until review.
Each step further out on the leash needed its own safeguards: deterministic guardrails that live outside the model, a data representation the model can’t misread, an output schema that constrains what it has to justify, and an evaluation harness that makes “did this help” a number rather than a feeling. That’s the thread running through Part One.
This post is part of a three-part series highlighting work from our summer 2026 interns. Parts 2 and 3 are coming soon.
Trusting an LLM to write data-quality checks
By Gage Garcia
At a glance
Team — Data Mobility
The problem — Data-quality checks are the cheapest defense against silent data corruption, but engineers write them by hand, so most datasets have few or none.
What shipped — A tool that profiles a dataset, uses an LLM to propose checks, and opens a draft pull request adding them to the dataset’s contract.
Impact — One run proposed roughly 12 checks in about 54 seconds. Five engineers across multiple teams ran it on their own data, and their feedback drove six shipped improvements.
At DoorDash, the Data Mobility team builds the infrastructure that powers data ingestion pipelines — the path data takes from the systems that produce it into the tables the rest of the company builds on.
Data-quality checks are the cheapest insurance against silent data corruption. They’re assertions that run in a pipeline after each ingestion, verifying things like “this ID is never null” or “this value stays in range,” and flagging violations before bad data reaches downstream models and dashboards. But engineers write them by hand, so most datasets have few or none — and a missing check fails silently. The bad data lands, models train on it and dashboards report it, and the problem surfaces days later when someone downstream notices a number that can’t be right.
We built a check suggester. It profiles a dataset, uses an LLM to propose checks, and opens a draft pull request that adds them to the dataset’s contract (the versioned file that defines its schema and how it’s ingested), so they run automatically once merged (Figure 1). Generating suggestions was easy. Making them trustworthy enough to ship was the hard part.
Figure 1: The check suggester profiles a dataset, proposes checks, filters them through deterministic rules, and surfaces the survivors for human review before opening a draft pull request.
Why an LLM, not a rules engine
A rules engine could handle the easy cases without a model. A column the profile shows is never null gets a not-null check, and a jointly unique pair gets a unique-key check.
The model earns its place on checks that depend on what the columns mean. On a money-movement table that records one row per payment event from an upstream system, profiling found two tenant ID columns: one written by that system and one by ours. Both were always populated and agreed on every row sampled. The tool proposed flagging any row where the two disagree, and rated it high severity: the IDs come from different systems and should reconcile, so a mismatch is a routing error that could tag production events as test data.
A pairwise comparison would have found that match too, along with dozens of pairs that agree by accident, and it could not tell a rule from a coincidence. The same gap shows up elsewhere. A minimum timestamp of 0001-01-03 is just the smallest value in a column until you recognize it as the date a timestamp defaults to when nothing sets it — which makes it a placeholder written where a null belonged.
Encoding all of that in rules means maintaining lists: the placeholder values worth flagging, the name patterns that mark a cross-system pair, the dates that count as implausible. Someone extends those lists every time a new pattern turns up. The model lets us avoid encoding most of that long tail up front.
Profiling a billion rows without paying for it
The model needs real column statistics, and computing them over a billion rows on every run is too slow to be usable. So the profiler tiers itself: a cheap row count first, then a sampling strategy chosen to match the table’s size, from a full scan on small tables down to a bounded sample on the largest.
That tiering caused the worst bug in the project, and it taught us the most. When the profiler couldn’t compute a column’s statistics, it left the field blank — which was stored the same as a measured zero. The model read “zero non-null values” as “100% null” and proposed a completeness check that would fail on every row. It had reasoned correctly over an input that was wrong.
The fix wasn’t a better prompt. We made those fields optional, holding null for absent rather than a magic number like -1, which would only have moved the ambiguity. The text the model reads now says “not measured” where it used to say “0 non-null values.” A lot of the trust work in an LLM system is in how you represent the data you feed the model, not in the model itself.
Sampling still has limits. A producer hit one on a 1.6-billion-row table, where an allowed-values check was built from a 100,000-row non-random sample that had seen 2 of the column’s 10 values. Stratified sampling is the next step.
Refinement with a human in the loop
We designed for human iteration from the start. The tool presents every suggestion for the engineer to accept or reject. Only accepted checks reach the draft pull request, which then goes through normal review. Each suggestion shows the statistics behind it and, on request, the model’s reasoning, so an engineer can confirm a check against the numbers rather than trust it (Figure 2).
Figure 2: Each suggestion is shown with the statistics behind it, so a reviewer can confirm the check against the numbers instead of trusting the model.
Reviewers also know things the data doesn’t show. A refine command takes that context — “this column is nullable by design” — and the model either revises the check or explains why it stands.
Review only helps if the reviewer notices, so a deterministic pass runs after the model and drops any suggestion that breaks a known rule: a completeness check on a nullable column, or a check that would fire on every row. That last rule has a known false negative, since a genuinely 100% broken column produces the same every-row check and gets dropped too. We accept that trade to kill the far more common false positives. A model won’t apply the same rule the same way on every run, so any rule you depend on has to be enforced in code, outside the model.
When a check fails
A check only earns trust if its failures are visible, so alongside the suggester we built the backend endpoints and UI views that surface each check’s pass/fail history once it’s live. A violation shows up there instead of bad data moving downstream unnoticed, which is the gap we opened with. The main dashboard now has a component detailing all failures for pipelines owned by an engineer’s team, and users can drill down into the execution details of each check (Figure 3).
Figure 3: Once a check is live, its pass/fail history is visible in the data-quality UI, so a violation surfaces instead of moving downstream unnoticed.
The tool also runs in the other direction. Given a failing check, a diagnose command pulls the rows that violated it together with the dataset’s recent changes and proposes a likely cause, so debugging starts from a hypothesis rather than a blank page. Suggesting a check means reading a profile and proposing a rule; diagnosing a failure means reading a violation and explaining one. Same model, opposite direction, and the same dependency on what you assemble into the prompt.
Driving adoption
The first version only worked after data landed, because it needed a table to profile. That was the top objection we heard: producers write a contract, and the moment they care about its checks is while they’re writing it, not days later. So we added a schema-only mode that proposes checks from the contract alone, before any ingestion has run.
That reframed where the tool belongs. A tool people have to remember to run gets skipped. So we prototyped a bot that runs the suggester automatically on any pull request touching an ingestion contract and posts its checks as inline GitHub suggestions the author can accept with one click.
What we measured, and what’s next
An LLM-as-a-judge evaluation command scores each suggestion on four axes. It asks whether the check is relevant to the column, whether the reasoning holds up, whether the assertion is specific enough to implement, and how likely it is to fire when nothing is wrong.
It found one thing worth acting on. The tool reliably picks the right column and explains why it matters — and then leaves the bound undefined, which showed up in every rejection the judge issued and in some of the suggestions it passed. That points at a schema fix rather than a prompt fix: make the threshold a required output field instead of hoping the model fills it. The evaluation command lets us run the same rubric before and after any prompt or model change and compare the scores, so “did this help” is a number instead of a feeling.
Two other future improvements are within scope. Every check is scoped to one table, so the tool can’t express invariants that span tables, such as cross-dataset consistency or referential integrity. And the evaluation set is small — a few dozen suggestions across a handful of tables — so the scores should be treated as a signal, not a verdict.
Conclusion
Putting an LLM into a workflow that writes code is easy to demo; earning trust takes real engineering. We kept the model behind human review, made its reasoning checkable against the numbers, enforced our rules in code rather than in the prompt, and watched the representation of the data we fed it as closely as the model itself.
We deliberately kept Gage’s tool at arm’s length: it proposes, a human accepts, and the only thing it can write on its own is a draft. Sharif Velasquez’s project moves a step further out — an agent that authors the artifact directly, which meant first rebuilding the artifact into something an agent could reason about at all.
Building a dashboard you can talk to
An AI agent that builds, customizes, and debugs dashboards through conversation.
By Sharif Velasquez
At a glance
Team — ML Platform (MDX)
The problem — ML observability data and its visualizations were scattered across a dozen internal dashboards and third-party tools: hard for engineers to correlate, and effectively unusable for agents.
What shipped — The Smart ML Dashboard: a declarative dashboard format an LLM can author, one data model that every backend maps into, and DoorDash’s ML debugging agent wired directly into the panels.
Models are the cornerstone of DoorDash. Their predictions guide the business: How much time will it take for a given order to be fulfilled? How likely is a user to click on a given ad? How can merchants improve their DoorDash store?
Because of their importance, we want to know as fast as possible when something goes wrong: a feature is defaulting, queries aren’t arriving at the model, or the model’s predictions are far off. That data exists, but it’s scattered across multiple sources, which makes it hard to find where or why a problem occurred, for humans and agents alike.
Data isn’t the only important component. So is how we visualize it, since visualization done right highlights patterns and trends that are nearly impossible to spot in raw data. But visualizations are also scattered across multiple dashboards and third-party services, which further hurts a human’s or an agent’s ability to correlate the root cause of an issue. On top of that, traditional dashboards show the data but usually lack a reasoning layer that explains what’s happening and why.
The tool also had to support customization and granularity. People in different roles — a manager, a machine learning engineer, an engineer from another team — care about different aspects of the data, so it needed to accommodate different business needs, allow easy sharing, and persist for reuse.
So we built the Smart ML Dashboard: a single place for data retrieval and visualization, with AI-powered dashboard creation and integrated debugging of features, models, and predictors on one surface (Figure 4). It works by modifying the architecture of the MLP agent, our internal ML debugging agent, which has access to a range of tools and knowledge bases across the ML Platform. Getting there took a sequence of design decisions, and two of them made the rest possible: treating dashboards as documents an LLM can write, and mapping every data source into one shape.
Figure 4: The Smart ML Dashboard being used to debug a model feature.
Dashboards as documents
The first decision was how to represent the dashboards themselves. How do you teach an LLM to write a dashboard? It can’t see, so it can’t verify that a layout looks right or that a chart follows the user’s intent.
But LLMs are very good at one thing: text. So we stopped treating dashboards as visual elements and started treating them as documents. A dashboard is a YAML file — panels, data queries, transformations, variables, and layout, all declarative. That meant building a parser and a small compiler to turn the YAML description into actual charts.
The YAML flows through a three-phase parser. The first pass checks syntax and reports line and column errors. The second validates shape, with per-issue errors that point at exact paths in the document. The third is a structural walk that catches what a schema can’t, like duplicate panel IDs or references to sources that were never declared. Every failure comes back in a uniform error shape, which means the agent gets the same structured feedback a human editor does, and can iterate on its own output.
The compiler itself is about 15 lines: it walks the parsed tree, dispatches on panel kind, and returns a React element. No hooks, no plugin lookups, no data fetching — all of that happens at render time instead. Keeping the compiler pure makes it trivially testable and, more importantly, makes the YAML-to-UI mapping a mechanical translation the LLM can reason about without modeling React’s execution model.
One data shape for every source
The second major design decision was the shape of the data the dashboard processes. Taking inspiration from the data model of a widely used observability platform, we decided to present all data in one shape: the DataFrame — a list of named, typed fields, plus row-count metadata and per-field labels and config. A source plugin is then just an async function that returns DataFrames.
This one abstraction buys three properties:
Panels don’t care where their data came from. A timeseries panel renders any DataFrame with a time field and one or more number fields. Same panel, any backend.
Transformations compose universally. Each is a pure function from frames to frames. They run in order after the fetch, and none of them know or care which source produced the frames.
The LLM only has to learn one data model.
Teaching the agent to write dashaml
With that foundation in place and the problem reduced to text generation, the third decision was how to write prompts that would teach the agent to understand and write dashaml, the language used to define dashboards. This proved harder than it first appeared. Beyond learning panel structures, the LLM also had to reason about data transformations. For example, if a panel required a feature’s defaulting rate but the data source provided a time series, the model had to infer that it should extract the latest value rather than display the whole series.
The challenge grew with the sheer number of panel configurations: field options, units, thresholds, mappings, and more. Encoding all of it for every panel would quickly exhaust the context window. After many iterations, we adopted an “ask only for what you need” approach: the agent initially receives only concise descriptions of panels and data sources, and can request more detail through tool calls when necessary. This reduced context usage and improved the agent’s ability to generate and debug dashboards.
This is enabled by the runtime’s registry design. Panels, sources, transformations, and cells each live in a registry populated by side-effectful imports, and each entry carries both a machine-readable schema, for validation and codegen, and human-readable documentation, for the agent. Adding a new panel is a single file that registers itself — and the agent gains the ability to use it the moment the module is imported. No prompt changes, no retraining.
The result is that the agent’s ability to write correct, useful dashboards scaled with the platform instead of degrading as we added features.
Debugging where the data already is
The fourth decision was to build debugging into the panels themselves. Because everything now lives in the same place, correlating a feature’s defaulting rate with, say, an upstream job that failed three hours ago becomes trivial for an agent (Figures 5 and 6). It also means multiple problems can be held in separate conversations at once, so debugging parallelizes.
Figure 5: A table of features, with defaulting rates and related signals in one view.Figure 6: Clicking a feature opens a debugging conversation with the MLP agent, with its diagnosis of the feature’s high defaulting rate.
What the user cares about is itself a signal
A dashboard isn’t only useful for visualizing data — it’s also a declaration of what the user cares about. That’s valuable information, because it tells us which things are relevant and lets us prepare an agentic report on them before the user even asks.
That also helps with scale. With a few items, spotting problems by looking at a dashboard is easy. With hundreds, it becomes increasingly difficult. So we created an Overview tab that gives you the agent’s analysis without requiring you to read the data in the dashboard at all (Figures 7 and 8).
Figure 7: The Overview tab surfaces actionable items generated by the MLP agent that need the user’s attention.Figure 8: Clicking an item reveals a summary of the issue, its most likely cause, its downstream impact, and suggested next steps.
Conclusion
The Smart ML Dashboard started from a simple observation: our observability and debugging signals were scattered, which made the process worse for both humans and agents. Bringing those signals onto one surface, in a format an agent can both write and read, changed how debugging works: correlating a defaulting feature with a failed upstream job becomes one conversation instead of a search across dashboards, and several issues can be investigated in parallel. Because a dashboard also declares what its owner cares about, the agent can start investigating those signals before anyone asks.
Acknowledgments
Thank you very much to my mentor Bowen Dan for her incredible guidance, and to the entire MDX team for their invaluable support.
Sharif’s agent writes the artifact, and a person reads the result. Shreeyash Gowaikar’s project takes the last step. An investigation starts on a schedule, gathers its own evidence, and reaches a conclusion before any engineer looks at it. The project also makes an honest attempt to find out whether building all that structure was worth it.
Closing the loop: automated root cause analysis for production agents
By Shreeyash Gowaikar
At a glance
Team — Dasher & Logistics (Machine Learning Engineering)
The problem — Detecting that a multi-agent system has failed is largely solved. Explaining why still means an engineer reading transcripts, so review coverage shrinks as usage grows.
What shipped — A cron-triggered, hypothesis-driven root cause pipeline — a planner that hypothesizes, workers that gather evidence, a manager that adjudicates — plus a four-condition benchmark against off-the-shelf agent harnesses over two weeks of production traffic.
Impact — Diagnosis moves from on-demand and manual to continuous, with no engineer in the loop until review. Every finding is traceable to its source session, causal chain, and a named fix location. The pipeline costs 0.67x the general-purpose agent baseline per transcript audited, about a 33% saving.
A user-facing multi-agent system fails in ways that cannot be exhaustively enumerated before launch. Unlike a deterministic service, a multi-agent system has open-ended input, stochastic execution, and unpredictable user behavior, so its failure surface is not a finite list. It widens as the system’s scope and autonomy evolve.
That becomes a problem worth solving quickly at DoorDash, where we are building agentic capability for consumers, Dashers, and merchants alike. Detecting failures in these systems is by now largely solved: per-axis judges and trend monitoring reliably indicate that something has degraded. Diagnosing them has not reached the same maturity. That step is still an engineer reading a transcript, forming a hypothesis, and confirming it against logs and recent commits — increasingly with the help of an agentic tool. Even for a single assistant in a limited pilot, reviewing everything the judges flag is already more work than a team can absorb, so coverage is partial by construction and shrinks as usage scales.
We automated that step to close the feedback loop from monitoring, and then measured whether building a bespoke pipeline for it was justified at all. The short answer: off-the-shelf agent harnesses can already root-cause real failures, and a structured pipeline adds findings that are traceable to a session, a causal chain, and a named fix location, at 0.67x the cost per transcript audited of a general-purpose agent.
Why diagnosis is the bottleneck
A rough sizing makes the constraint concrete. One of our assistants, in a limited pilot, produces thousands of conversation transcripts per week. Even a 2% flag rate would still mean a steady stream of conversations requiring review each week, creating a substantial manual review burden before accounting for deeper investigation and fixes.
Delegating each investigation to a general-purpose coding agent reduces the per-session time considerably, and engineers already do this. But it doesn’t remove the bottleneck, because someone must still select which sessions to investigate, decide which evidence to expose, and judge whether the returned answer is trustworthy enough to act on. Those decisions are rarely documented anywhere. Meanwhile the unreviewed remainder is where trust quietly erodes, and the imbalance worsens as volume grows, because review cost scales with usage and the team does not.
Three properties of a production multi-agent system make each investigation expensive:
Fault origin is decoupled from fault symptoms. A failure surfacing in the final turn can originate several agents upstream, so reading the trace alone does not localize it.
Production guardrails are dense. These assistants operate in a policy-heavy, regulated domain. Its decisions cover what can be promised, what must be escalated, and how each market handles each edge case. That policy is enforced across system prompts, policy engines, and tool-layer checks, and the surface is large enough that two rules can silently conflict. When the agent does the wrong thing, it’s hard to tell whether a rule was missing, wrong, overridden, or simply not followed. In a synthetic red-team scenario, a single adversarial line in a system prompt of several hundred benign ones was enough to change the agent’s behavior.
Failure modes are heterogeneous, and many are not semantic. A trace can fail through an execution fault — truncation, premature termination, an orphaned tool call — or through contradictory context, a malformed handoff, or sampling variance. These share almost nothing diagnostically, and stochastic execution means an investigation often cannot reproduce the failure to confirm a hypothesis.
What a self-healing loop requires
After a literature review across the self-improvement and prompt-optimization work, we concluded that a self-healing system needs at least three prerequisites, each answering a different question:
Observability — full-fidelity capture of input, tool calls, intermediate steps, and outcome for every interaction. This determines what to investigate; richer traces yield better diagnoses.
Grading — per-axis metrics and judges tied to the product and business specification. This determines why to investigate a session. Multi-agent failures don’t lie on a single axis, and one aggregate quality score rarely captures the failure, so we recommend setting up thorough LLM-as-a-judge panels.
Monitoring — trend monitoring over those metrics. This determines when to investigate, and makes detection autonomous: triggered by an anomaly in the trend rather than on demand.
A well-engineered product typically has all three already, which is what makes automated diagnosis tractable. This project completes the package by describing how to investigate.
Implementation
What follows is one design among many for converting observed failures into code and prompt patches. We split the loop into two stages. Mining finds and clusters failures and produces a per-trace diagnosis with causal chains and verbatim evidence. Tuning proposes a fix, simulates it, and checks for regression (Figure 9). The split is a context-budget decision: thorough diagnosis spends a large token budget on transcripts, prompts, and source, and sharing a window with fix generation starves both. This post covers mining.
Figure 9: The two-stage failure mining and failure tuning pipeline for self-healing.
Evidence for a single failure is distributed across the transcript, several system prompts, backend logs, and recent commits in more than one repository. Supplying all of it in one context window yields a confident and unfalsifiable summary. The diagnosis stage therefore draws on long-context reasoning techniques (adapted from published research on structured, multi-step reasoning over long context, arXiv:2510.04568), organized into three sequential phases: a Planner that hypothesizes, a fan-out of Workers that gather, and a Manager that adjudicates. Only the Manager is permitted to draw a conclusion.
The Planner triages the transcript, LLM-as-a-judge verdicts, and compact execution signals. It does not conclude; it emits hypotheses and the questions that should be answered to confirm or refute them.
The Workers each inspect source code, git logs, or one implicated prompt, and return verbatim evidence for their assigned questions only. Workers may not conclude. That constraint exists to keep the pipeline from becoming self-confirming.
The Manager adjudicates the evidence into a per-session diagnosis: originating fault, propagation path, responsible agent, plausible fix location, and — where the fault is prompt-attributed — the implicated span quoted verbatim.
Because every handoff is a fixed contract, runs are diffable, reproducible, and extensible: a new evidence source is a new Worker. Two further design decisions proved consequential in practice.
Session selection combines anomaly-driven and random sampling. Anomalies are detected by monitoring rather than by the pipeline itself. When an aggregate metric moves unexpectedly, monitoring triggers a run and passes that movement in as the presenting symptom to be explained. Random sampling of metric-graded sessions covers the complement: anomaly cohorts give precision on regressions, while a random subset gives recall on failures that never move a trend line.
A deterministic execution-signal layer runs before any model call, reconciling trace export, judge output, and backend logs to recover truncation, empty generations, and orphaned tool calls that parsed transcripts silently absorb. It functions as a pre-screener and context enricher rather than a reasoning stage. Still, a material share of real defects fell into this class.
Finally, the Manager writes each finding into a fixed schema with causal chains, verbatim evidence, and categorization fields drawn from a published taxonomy of the ways multi-agent systems fail (Cemri et al., Why Do Multi-Agent LLM Systems Fail?, arXiv:2503.13657). The schema serves two purposes: it constrains what the Manager must justify, and it makes findings comparable and auditable across sessions. Comparable findings can then be embedded and clustered, so a proposed fix targets a family of sessions rather than a single trace.
Evaluating against off-the-shelf agent harnesses
A general-purpose agentic coding harness explores autonomously once invoked, but it doesn’t decide when to run, which sessions to pull, or which evidence to expose. Whether a bespoke pipeline is warranted beyond supplying those decisions is an empirical question.
To answer it, we evaluated four conditions along a spectrum from fully autonomous to fully customized (Figure 10). In what follows, “free agent” means a frontier coding model at high reasoning effort, running in an off-the-shelf agentic coding harness and left to explore on its own, and “schema-constrained” refers to the fixed output schema from the previous section.
Figure 10: The four evaluation conditions, across a spectrum from most autonomous to most customized: end-to-end agent, split agent, structured split agent, and the custom root cause analysis (RCA) pipeline.
Evaluation used a production support-automation assistant, chosen for its wider failure surface: it issues more tool calls per session, spans a broader range of scenarios, and serves as its users’ primary mode of interaction rather than a secondary one. The setup was held constant across conditions. Each condition ran on two independent one-week windows of production traffic, so no result depends on a single week’s mix of problems. Every variant was replicated four times per window, since the harnesses are themselves stochastic and a single run captures little. A more capable judge model from a different model family scored each run from 1 to 5 on 10 axes, and a human reviewer corroborated the scores.
In the first window, the custom pipeline led clearly on output quality and groundedness, and cost more per run but less per transcript audited. Equal-weighted across all 10 axes, however, the simplest condition came out ahead (Figure 11). The two intermediate conditions behaved almost identically to each other and worse than both extremes, each fixating on the window’s headline anomaly — which turned out to be provider-side latency noise that no source code change could address. Splitting the work across agents didn’t make investigations deeper. Giving each agent a tightly scoped task did.
Figure 11: In the first window, the custom pipeline led on output quality and groundedness, but the simplest condition led on the equal-weighted average. Scores for the four conditions across all 10 evaluation axes, plus the equal-weighted average.
Reading the first window as a statement about where each method is strong, we improved the two leading contenders before the second. The end-to-end agent gained a committee variant, in which several independent runs investigate the same sessions and a model merges their findings into one report. The custom pipeline gained a final step that clusters findings by meaning, so related failures are grouped together.
In the second window the lead changed hands (Figure 12). The best configuration, custom RCA with semantic clustering, retained its designed advantages throughout: output quality, groundedness, and sampling robustness in both windows, plus reproducibility in the second. The end-to-end agent kept novelty and portability, and stayed cheaper per run.
Figure 12: Second-window scores after improving the two leading contenders: the end-to-end agent with and without a committee, and the custom pipeline with and without semantic clustering.
Reflections and conclusion
Detecting that a multi-agent system has failed is largely a solved problem. Explaining the failure, in practice, still means an engineer reading transcripts until the cause turns up. This summer we set out to find whether that reading could be automated into a pipeline instead, and the answer turned out to be closer to yes than we expected.
The uncomfortable part is that neither evaluation window produced a clear winner between the free-agent harness and the structured pipeline. Both root-caused real failures, and neither did so decisively better than the other. We attribute that to the stochasticity of the evaluation data and the varying complexity of the problems each window surfaced, rather than to a defect in either method. Three conclusions follow.
Off-the-shelf agent harnesses are already capable of root-causing agentic failures today.
A customized structure still adds provenance, specificity, and thematic stability, at the cost of portability. Every finding attaches to a session, a causal chain, and a named fix location, and one defect family ranked first or tied for first in all eight structured replicates.
Constraining a free agent’s output raises its quality but cuts its novelty and coverage sharply. This comes from the two intermediate conditions in the first window. The implication is that a schema helps at the reporting step and hurts at the exploration step.
So rather than a single verdict, we propose that the choice follow an audit of the business need. The audit asks three things: how deeply the evidence for a failure is distributed, how far a finding has to hold up under review, and how much novelty, groundedness, and cost matter for the product in question.
The more useful observation is that these approaches are not mutually exclusive, and each one’s strength can improve the others. Three transfers are apparent. Dynamic sampling of traces is what the free agents do well. Importing it into the structured pipeline is the most direct route to closing the novelty gap, since a fixed pre-pulled sample is what created that gap in the first place. And applying a structured output schema to a free agent’s reporting step is a prompt change that recovers much of the quality and auditability difference. The deterministic execution-signal layer transfers just as easily, since it runs before any model call and any harness can consume it.
A team can therefore start simple and adopt the elements in this post selectively. The elements are: a dedicated hypothesis-driven analysis step, independent evidence-gathering agents, a structured output schema at the reporting boundary, a fixed handoff contract between agents, and dynamic sampling of the sessions worth investigating. Longer term, as a product matures and its failure modes become specific to it, the pipeline can be customized around those modes and can eventually generate its own evaluation scenarios and audit its own results, with an engineer approving each change. That’s the path from self-healing toward self-improvement.
Acknowledgments
This project would not have been possible without the guidance of my manager, Jianzhe Luo, and my mentors, Hubert Jenq and Daniel Chiu. I’m also grateful to the entire team, whose conversations and code reviews taught me a great deal over the course of the summer. Finally, my thanks to everyone at DoorDash and in the university program for making this such a rewarding internship.
Stay Informed with Weekly
Updates
Subscribe to our Engineering blog to get regular updates on all the
coolest projects our team is working on
Please enter a valid email
address.
Thank you for Subscribing!
Managing dispatch in a three-sided marketplace is a delicate balancing act; every assignment decision ripples through the DoorDash ecosystem, affecting customers, Dashers, and merchants. Historically, DoorDash used a static dispatch optimizer to handle these tradeoffs. However, static weights often struggle to adapt to the dynamic realities of different stores, regions, and times of day. In this post, we share how we replaced these heuristics with a production reinforcement learning (RL) system that dynamically adapts dispatch objective weights in real time. For the underlying dispatch platform architecture, see our companion post,How DoorDash Built a Next-Generation Real-Time Dispatch Platform.
Dispatch optimization involves competing goals. Prioritizing speed can reduce customer-facing delivery time but may reduce batching opportunities. Prioritizing batching can improve Dasher efficiency, but if applied in the wrong context, it can increase lateness or create poor pickup timing. A global weight cannot handle these local variances effectively for several reasons:
Slack periods: Low volume means batching-compatible assignments can improve efficiency without hurting the customer experience.
Congestion: High traffic requires prioritizing speed; over-batching during these times can create excessive delivery delays.
Local variability: A store’s unique backlog, supply pressure, and courier availability demand localized tradeoffs that static, global weights cannot resolve.
This makes dispatch a natural fit for reinforcement learning. The system does not receive immediate human preference labels. Instead, it learns from delayed operational outcomes such as delivery duration, courier active time, and courier wait time.
Designing a hybrid RL-optimization architecture
Figure 1: This shows the hybrid RL-optimization loop. During serving, a store-level policy agent observes local marketplace signals and selects an objective-weight multiplier. This multiplier parameterizes the assignment optimizer, which generates the final courier-order decisions while preserving feasibility and operational constraints.
To address marketplace variability, we designed objective weight adaptation with reinforcement learning, or OWA-RL, a hybrid architecture that treats RL as an alignment layer rather than a replacement for our production optimizer, as shown in Figure 1 above. The RL policy operates as the outer decision layer, observing store-level state and selecting an objective-weight multiplier. This multiplier acts as a tuning knob for the inner assignment optimizer, which remains responsible for complex constraints, feasibility, and operational safety. This design lets us leverage the adaptability of reinforcement learning while retaining the stability of our established production solver.
By constraining the RL agent to a small action space A = {0.8, 0.9, 1.0, 1.1, 1.2}, we ensure the policy can adapt locally to supply-and-demand conditions without overriding critical assignment safeguards. An action of 1.0 recovers the production baseline, while lower or higher values tilt the tradeoff toward batching efficiency or delivery speed, respectively.
Training on delayed feedback
The policy is trained offline from logged marketplace data. Each online dispatch run is joined with delayed fulfillment outcomes to construct transition tuples such as these: (s_t, a_t, r_t, s_{t+1}).
Reward construction uses both customer-facing and courier-side timing signals, as illustrated in Figure 2 below. We observe three metrics after delivery completion: customer-facing delivery duration, or ASAP; courier active time, or CAT; and excess courier active time, or XCAT, which measures CAT beyond the direct route. These delayed outcomes are attributed back to the dispatch runs that influenced them.
Because dispatch decisions can create network effects across nearby stores and Dashers, we aggregate rewards regionally rather than treating each store in isolation. This gives the policy feedback that better reflects marketplace-level outcomes, including the tradeoff between faster delivery completion and more efficient batching.
Figure 2: Here we show the logistics timing components used for delayed reward attribution. ASAP captures customer-facing delivery duration, while CAT and XCAT capture courier-side time costs. Observed fulfillment outcomes are joined back to dispatch runs to construct offline RL rewards..
Offline RL with conservative value learning
We train a shared value function for decentralized store-level execution. The model is a lightweight discrete-action Q-network over the ASAP-weight multiplier action space. During inference, each store observes its local marketplace state and selects a multiplier that adjusts the speed-efficiency tradeoff passed into the production optimizer.
To improve offline training stability, we use double Q-learning targets to reduce maximization bias and add a conservative regularizer to reduce overestimation for actions that are weakly supported by logged data. This is especially important in production offline RL, where the policy must avoid assigning high value to actions for which it has not observed enough evidence. The conservative objective helps keep adaptation within well-supported regions of the logged data while preserving the optimizer’s existing feasibility and safety guarantees.
Production experiment
We evaluated the policy in a global switchback experiment against the production baseline. The policy improved marketplace efficiency without degrading customer-facing quality. As shown in Table 1 below, OWA-RL increased batching, reduced courier active time, and reduced courier wait time across all parts of the day, while ASAP and 20-minute lateness remained statistically unchanged.
The strongest operational gains appeared during dinner hours, from 5 p.m. to 9 p.m., when marketplace pressure is highest and batching opportunities are more valuable. In this window, the policy reduced courier-side time costs and increased batching while improving delivery quality. These results suggest that the RL alignment layer can adapt objective weights in real time while keeping the production optimizer’s safeguards intact.
Table 1: This summarizes online switchback experiment results comparing the production baseline and OWA-RL. Baseline and OWA-RL report metric means; ATE reports the variance-reduction adjusted average treatment effect with p-values in parentheses. CAT, CWT, and ASAP are measured in seconds; batching and 20-minute lateness are reported as percentage-point rates. We have noted statistically significant ATEs at p < 0.05 boldface.
Monitoring policy behavior after deployment
Online impact is only part of the story. We monitor action distributions to detect policy-behavior drift and state-feature distributions to detect marketplace drift. Because the policy is trained offline, monitoring ensures that marketplace conditions remain within the intended range for policy support. Large shifts in selected multipliers or supply-pressure features are key indicators that the policy behavior may need to be reevaluated.
Lessons learned
Several design choices made the system practical for production. Our key recommendations include:
Use RL to adapt the optimizer, not replace it: The learned policy controls a low-dimensional objective-weight interface, while the optimizer handles feasibility and assignment.
Keep the action space constrained: A small discrete action space makes offline learning safer, easier to monitor, and easier to roll back.
Train from real marketplace feedback: Delayed operational outcomes provide a scalable signal for learning dispatch tradeoffs.
Use conservative offline learning: Conservative value regularization helps reduce unsupported-action overestimation before deployment.
Monitor both actions and states: Production RL systems need drift monitoring, not just experiment readouts.
Next up
This work demonstrates that reinforcement learning can safely adapt objective weights in a large-scale dispatch system when paired with a constrained production interface. Future work includes exploring additional decision layers, improving distribution-shift detection, and developing interpretability tools that connect policy decisions to changing marketplace conditions. By combining a learned policy agent with a production optimizer, we can make dispatch more adaptive while preserving the reliability required for real-world logistics.
Stay Informed with Weekly
Updates
Subscribe to our Engineering blog to get regular updates on all the
coolest projects our team is working on
Please enter a valid email
address.
Thank you for Subscribing!
TL;DR — This post describes how DoorDash rearchitected its real-time dispatch system. At peak, demand was nearly four times the dispatch processing capacity, forcing the system to make decisions on incomplete information. The underlying algorithms scaled quadratically, meaning even modest volume growth translated into outsized runtime pressure. The new architecture transformed the system from a growth-constrained centralized execution model into a distributed, scalable, machine-learning-ready platform — improving throughput ten-fold, achieving 99.9% of runs under 20 seconds, and improving on-time delivery performance. We focus here on the engineering problem behind dispatch at high scale, why simple horizontal scaling was not enough, how the decoupled coordinator-compute architecture changed the scaling curve of dispatch, and what we learned about building critical-path systems that must balance optimization quality, latency, reliability, and long-term extensibility.
Space, Time, and the Logistics Chessboard
DoorDash’s real-time dispatch system is the beating heart of our logistics network. Every second, it makes millions of micro-decisions, matching available Dashers with incoming consumer orders to ensure fast, reliable deliveries.
To understand the sheer magnitude of this challenge, it helps to look at the classic Traveling Salesperson Problem (TSP) and the Vehicle Routing Problem (VRP). In a textbook TSP, the goal is simply to find the shortest possible route to visit a fixed set of cities.
But our dispatch engine doesn’t operate on a static map; it plays a highly constrained, multi-dimensional game of chess governed by two unforgiving variables: Space and Time.
Space: We must constantly evaluate the dynamic geographic distribution of tens of thousands of Dashers, the static locations of merchants, and the final consumer destinations across thousands of local markets.
Time: This is our ultimate constraint. Unlike delivering packages that can arrive any time before 8 p.m., delivering a hot pizza or melting ice cream has a razor-thin margin of error. We must perfectly synchronize Dasher travel velocities and real-time traffic patterns with highly variable merchant food preparation times.
As our business continues to experience hypergrowth, the complexity of solving this spatial-temporal puzzle in real time has grown superlinearly. Here we detail our journey of migrating from a legacy dispatch engine to a newly architected, highly scalable distributed platform that not only solved our immediate dispatch problems but also offers long-term solutions for the future.
The Bottleneck: Outgrowing the Monolith and the Speed of Reality
The previous generation of our dispatch engine served us well during our earlier growth phases. It was, however, built as a monolithic system in which business logic, state management, and heavy mathematical computations were tightly coupled.
In a dynamic routing problem, adding a few more stops doesn’t simply add a few more calculations; it triggers a combinatorial explosion. The fundamental algorithms powering the legacy engine operated with a time complexity of roughly O(N²). During average hours, this quadratic scaling was manageable. But over time, as our network density compounded, the system began to encounter a fundamental structural limit.
During extreme peak hours – such as a Friday night dinner rush or Super Bowl Sunday – demand would far exceed dispatch processing capacity. More deliveries did not simply mean proportionally more work; they quickly expanded the search space of possible assignments and drastically increased the coordination required inside each decision cycle. The legacy monolith found itself forced to evaluate tens of millions of potential Dasher-to-Order combinations within seconds, often degrading into fallback heuristics and decisions made on incomplete information.
The fatal bottleneck wasn’t just raw machine capacity; it was the speed of reality. When network density spiked, the legacy engine’s computational latency would stretch. But if the engine takes several minutes to calculate the “mathematically perfect” dispatch solution, that solution is already obsolete by the time it is emitted. Dashers have driven past optimal intersections, new high-priority orders have dropped, and food has been sitting on the counter. This lag triggered a cascading failure — delayed algorithm execution led to missed real-world time windows, suboptimal routing, and elevated cancellation rates.
Faced with this, the intuitive engineering response is naïve horizontal scaling — simply throw more hardware at the problem. But real-time dispatch is not a stateless web workload where requests can be blindly split evenly across more machines while the system is expected to behave the same way. The optimization space is inherently interconnected. If the partitioning strategy loses important structural context, optimization quality — like batching efficiency — severely suffers. Conversely, if the workload is split incorrectly, we merely trade compute bottlenecks for new choke points in orchestration, state aggregation, or duplicated computation.
We had reached the limits of incremental tuning. The bottleneck was no longer just local inefficiency; the very shape of the computation itself had become untenable at high volume. We realized that simply throwing more hardware at a monolithic architecture couldn’t outrun a superlinear curve. To scale into the future, the system didn’t just need more capacity – it demanded a fundamentally new execution model.
Shattering the Monolith: Orchestration Meets Distributed Compute
To break free from the structural limitations of the legacy monolith, we designed the next-generation dispatch platform around a single engineering philosophy: a clear separation of coordination and computation. We completely decoupled the monolithic engine into two distinct, independently scalable tiers:
Coordinator tier: The orchestrator is a stateful, highly available component responsible for managing the lifecycle of the dispatch process, maintaining the global state of the logistics network, and validating complex business rules.
Distributed compute tier: The compute nodes are stateless, ultra-high-performance workers optimized solely for crunching mathematical models, executing vehicle routing heuristics, and processing model inference. Figure 1 contrasts the two topologies.
Figure 1: Evolution from Monolithic Dispatch Engine to Distributed Architecture.
Because the coordinator and compute nodes are decoupled, they require ultra-fast, intelligent data distribution. To minimize network overhead, the coordinator does not broadcast the massive global state to the entire compute pool. Instead, it leverages a highly optimized localized payload sharding mechanism over gRPC. On every dispatch tick, the coordinator streams the specific localized sub-portion (cluster context) required for a given compute node’s optimization run. This targeted, self-contained data distribution drastically reduces network bandwidth, keeps communication latency low, and ensures that the compute nodes remain strictly stateless. Figure 2 shows how serial execution gives way to parallel fanout and reconciliation.
Figure 2: From Serial Execution to Parallel Fanout and Reconciliation.
Changing the Scaling Curve with Hierarchical Decomposition
Decoupling the architecture solved the infrastructure bottleneck, isolating our compute workloads, but the underlying mathematical O(N²) complexity remained. To address this within the distributed compute nodes, we introduced hierarchical decomposition.
Instead of attempting to solve a massive, interconnected global optimization matrix in a single monolithic pass, the coordinator intelligently partitions the global state into highly localized, dense geospatial clusters and delivery trajectories. By dividing the problem into independent, localized sub-problems, the new architecture can execute optimization routines in parallel across a horizontally scalable pool of compute workers. Figure 3 traces one run through both decomposition stages.
Figure 3: Workload Flow of Hierarchical Decomposition and Reconciliation.
After the localized solutions are calculated, a specialized global reconciliation layer merges results across the sub-problem boundaries. This ensures that while the computation is distributed and accelerated, the final routing decisions preserve much of the optimization quality of the original problem while allowing the expensive candidate-generation work to execute in parallel.
Building for a Critical Path: Validation, Rollout, and Reliability
Replacing the core dispatch engine of a massive, real-time logistics network is the engineering equivalent of swapping out a jet engine mid-flight. System downtime or suboptimal dispatching would immediately translate to lost revenue for merchants and poor experiences for consumers. Reliability was paramount.
To guarantee a seamless transition, we engineered a rigorous shadow testing framework. In shadow mode, production traffic was duplicated in real time. As incoming dispatch triggers arrived, the coordinator forked the requests, routing one copy to the legacy dispatch engine while a duplicate payload went to the new distributed platform (Figure 4).
Figure 4: Shadow Testing Framework for Risk-Free Engine Migration.
The legacy system’s output dictated the actual real-world dispatch, while the new platform’s output was logged and analyzed. This allowed us to perform extensive, side-by-side behavioral regression analysis on match quality, delivery times, and system resilience under peak production pressure without risking any actual deliveries.
After establishing parity in shadow mode, we gradually moved to production switchback experiments, using controlled exposure and fallback mechanisms to validate both system reliability and real-world fulfillment metrics before we expanded to the rollout.
Impact and Results
The production rollout demonstrated substantial improvements in scalability, runtime, and fulfillment efficiency. We fundamentally redefined our operational capabilities, shifting from a monolithic, superlinearly scaling engine to a highly parallelized distributed platform.
Figure 5: Dispatch Runtime Scaling, Legacy vs. Next-Gen.
During our global experiment launch, the new architecture unlocked massive systemic efficiencies by enabling single-digit-second optimization at a significantly larger scale (Figure 5). By evaluating a vastly larger search space without the arbitrary limiters of the past, the new architecture improved Dasher acceptance rates, enhanced overall fulfillment efficiency, and boosted Dasher earnings. At DoorDash’s scale, these micro-optimizations compound exponentially, translating into millions of dollars in annualized fulfillment savings while simultaneously improving Dasher utilization and platform economics.
The ultimate test of the new platform’s resilience came during extreme peak events, such as Super Bowl Sunday. Historically, massive traffic spikes would force the legacy system to hit hard volume limiters, stretching runtime to minutes and degrading assignment quality. With the distributed compute architecture, the system maintained more than 99.99% availability despite a 10% week-over-week surge in peak volume. We successfully eliminated the runtime cliff, proving that our platform can scale horizontally without sacrificing optimization quality.
Metric
Legacy Dispatch Engine
Next-Gen Dispatch Platform
Impact
Execution Latency (Peak)
Degraded to minutes under heavy volume
>99.96% of runs completed in under 20 seconds
Orders of magnitude faster
System Throughput
Capped by monolithic pod constraints
Dynamic horizontal scaling without arbitrary limiters
10x scale unlocked
Extreme Peak Resilience
Prone to capacity cliffs and degraded assignment quality
>99.99% availability during Super Bowl spikes
No degradation
Fulfillment Efficiency
Baseline algorithmic performance
Compounding micro-optimizations across millions of deliveries
Higher fulfillment efficiency
Future-Proofing: A Platform for ML and RL
The new architecture is not just a solution for today’s volume; it provides the foundational infrastructure required to usher in the next era of DoorDash logistics — scalable RL and machine learning (ML).
Previously, embedding computationally expensive deep learning models directly into the dispatch loop was impossible due to the monolithic constraints of the legacy engine. To solve this, the next-gen platform introduced a hybrid L1/L2 model serving architecture integrated directly into the distributed compute tier.
L1 Local serving (ONNX runtime): For high-cardinality, extreme latency-sensitive evaluations, we embedded local ONNX runtime engines directly inside each individual compute node. This setup allows the compute tier to execute millions of highly concurrent local inferences at single-digit-millisecond latency, without RPC overhead. Crucially, this L1 tier runs both our structural route feasibility scoring models and our real-time RL agents.
L2 Remote serving (machine learning platform): For more complex, lower-cardinality policy evaluations, the orchestrator seamlessly calls isolated remote machine learning serving clusters, ensuring heavy ML workloads do not disrupt the critical state-management path. Figure 6 shows both serving tiers.
Figure 6: Hybrid L1/L2 Model Serving Architecture with Embedded Local Intelligence.
This infrastructure also enabled us to deploy more computationally intensive ML and RL models directly in the dispatch loop. Leveraging this new architecture, we successfully deployed a multi-agent reinforcement learning system to dynamically adapt dispatch objective weights. Instead of relying on static, globally tuned heuristics, our decentralized RL agents observe localized, delayed marketplace feedback — such as merchant congestion and courier utilization — to dynamically shift the optimizer’s tradeoff between delivery speed and batching efficiency at the individual store level.
The biggest contribution of the new platform was not one isolated performance gain. Indeed, it has changed the long-term trajectory of dispatch.
The legacy system was approaching a point where growth would increasingly translate into runtime pressure, operational strain, and architectural fragility. The new architecture changed that path by introducing a more scalable execution model and a cleaner systems foundation. But its long-term value goes beyond solving the immediate scaling problem. With a more distributed, modular, and scalable platform in place, DoorDash can continue iterating on richer optimization strategies, more adaptive decision-making, and deeper ML- and RL-driven dispatch capabilities. It also creates a path toward broader platformization, allowing dispatch to evolve as an extensible system layer rather than a single, tightly coupled engine.
That is why this next-generation architecture matters beyond a single redesign. Its value is not only that it removed a bottleneck, but that it expanded what the system can become next. The most meaningful engineering wins do not just improve one benchmark. They change the slope of the problem and create the foundation for future intelligence, flexibility, and growth.
Acknowledgments
This massive rearchitecture was made possible by the contributions of many engineers, scientists, product partners, and leaders across DoorDash.
Subscribe to our Engineering blog to get regular updates on all the
coolest projects our team is working on
Please enter a valid email
address.
Thank you for Subscribing!
In a marketplace, risks inevitably converge on two key underlying questions: Who is this, and how confident are we that this action is legitimate? Some examples of what we mean by this: A support agent evaluating a refund request needs to know these answers. A promo engine deciding whether to extend an offer can’t go ahead without this information. A bot-mitigation system screening a login attempt for automated traffic is hamstrung without this data. The specifics differ — the channel, the signal, the threshold — but the core questions don’t change.
While these questions aren’t new, AI increasingly has introduced new pressure from both sides of the equation; the same advances that make it easier to generate convincing fake behavior at scale also make it possible to identify the actors with richer signals than ever before.
Yet identity has never been treated as its own horizontal capability. Instead, most systems have been built product-first — a risk engine for orders, a model for promo targeting, or a rule for account-takeover detection. Each one implicitly answers a version of the who-is-this question for its own purposes, but none of them share that answer. This leaves a set of partial views of the same person, each accurate for its own purpose but walled off inside in its own system.
Identity intelligence starts from a different premise: If the question is shared, the signal that answers it should be, too. That’s a platform problem — solved once, centrally — that’s distinct from how any given system chooses to act on the answer, which looks different depending on where it’s applied. Treated as a first-class, horizontal capability — not a byproduct of any one product — identity becomes a common thread running through nearly every integrity use case. That’s our central thesis here; identity is one of the highest-leverage but least appreciated capabilities in integrity precisely because no one builds it as its own thing.
Identity comes into its own
If that who-is-this question is so universal, why hasn’t identity been treated as core infrastructure from the start?
In the past, every integrity surface — order risk, account risk, or promo risk — has solved its own problem first and in its own way, with its own device signals, linkage logic, and working definition of “the same person.” That’s how specialized problems tend to be solved, with a rule here and a model there, each purpose-built and quick to ship. A shared identity layer is a different kind of investment: It doesn’t belong to any single surface, so no one surface is naturally positioned to build it, even though every one of them would benefit.
The result to date has been an identity signal that isn’t reusable off the shelf. Every new team that wanted that answer had to onboard it from scratch with a bespoke, one-off integration instead of plugging into a standard interface. For years, identity signals have existed everywhere but were owned nowhere; each team paid to re-derive a partial answer while no one captured the compounding value of answering the question once and sharing it.
Building an identity intelligence platform
At DoorDash, we decided to close that gap by designing new infrastructure. Instead of each system building its own linkage logic on top of its own signals, we wanted identity to become something built once and consumed everywhere.
In practice, that meant building three layers on top of one shared signal store:
First, identity resolution: An entity-resolution graph with 1B+ edges, built mostly with unsupervised clustering and link-prediction techniques, that investigates which accounts might be the same person.
Second, relationship intelligence: A related but different graph question: Which people, accounts, devices, and assets are associated with each other? This layer acknowledges that two accounts can be meaningfully connected without being the same human.
Third, decisioning models: Typically supervised learning models, such as gradient-boosted classifiers, trained on known outcomes for a specific use case. This layer consumes the first two layers to return a real-time answer to the question: Is this particular event, for this particular decision, legitimate?
FIGURE 1: A SHARED SIGNAL STORE FEEDS TWO GRAPHS — WHO SOMEONE IS, AND WHO THEY’RE CONNECTED TO — WHOSE OUTPUT ONE SCORING LAYER TRANSLATES INTO A SINGLE DECISION.
We’ll use one of the hardest cases for identity resolution as an example — a customer who just signed up, places a first order, and files a support request. There’s no history to compare against, nor is there likely to be a strong match to an existing account; identity resolution alone doesn’t have much to go on. What the account does have, from the moment it exists, is a handful of identity attributes, such as a device, a phone number, an address, or a card on file. The platform already tracks which accounts each of those attributes has appeared on, so an overlap on any of them is visible immediately, without waiting for a single order or support request. A shared address, for example, is a start, but a bare shared-or-not flag is too coarse to act on; it doesn’t say whether that address sits under two accounts or 200, whether they all showed up on the same day or over years, or whether that pattern is even unusual. That’s relationship intelligence’s job: Not resolving who someone is, but characterizing how connected they are. It combs through more than 100 derived signals computed per account, each one capturing how many other accounts share a given attribute, how recently, and how anomalous that looks next to an ordinary customer.
But even all of this isn’t a decision. A simple fact about the graph — such as, this address has 40 accounts attached to it, most created in the last week — is not a verdict on this particular support request. Turning one into the other is the decisioning model’s job. It is trained on outcomes to know how much that pattern should matter for this specific kind of request; its conclusion is made available in real time so that it’s ready the moment a request comes in.
That’s why the platform needs all three layers, not just the first. Identity resolution answers whether two accounts are the same person, while relationship intelligence gives a useful answer even when resolution comes up empty; neither is a decision until a model built for that specific use case turns it into one.
The platform separates signal computation from scoring (Figure 2). Features are aggregated asynchronously and ready within minutes of whatever changed. A checkpoint retrieves what it needs in 10 to 15 milliseconds rather than waiting on any of the work that produced it. Scoring then sits wherever the surface’s latency budget wants it; it’s called inline when there is room, or can be triggered as soon as the features land so that the score is stored and read at decision time.
Figure 2: IDENTITY SIGNALS ARE BUILT ON THEIR OWN CLOCK AND STORED ONCE, SO NO DECISION WAITS ON THE AGGREGATION BEHIND THEM.
One foundation, many use cases
Downstream systems — for instance, a support flow, a promo engine, or a checkout gate — don’t all need the same layer. Some systems can get an answer straight from the identity and relationship graph; others need it distilled further through the appropriate decisioning model into a real-time score built for that specific decision. These never need to know what the graph underneath looks like.
Consumer identity clustering is the clearest example of that platform in action. Such accounts look like separate people but are actually the same person. This specifically is identity resolution, determining whether two accounts collapse into one human, not just whether they’re somehow connected. Under the hood, the identity cluster weighs the reliability of each signal connecting two accounts and how unlikely it would be for two different people to share it by coincidence. The more improbable a shared signal is, the more weight it carries on its own; more common or easier-to-share signals only carry weight in combination, when several of them add up. Because it runs continuously against DoorDash’s identity graph rather than as a periodic batch job, it can be checked the moment a login, checkout, or refund request comes in.
Once that cluster exists, the same underlying identity and relationship signal — reused rather than rebuilt — shows up across the rest of integrity’s surface area. In support workflows, that same clustering helps discern a genuine service failure from one person filing similar-looking claims across several accounts. In promotions, it decides eligibility by discerning a new customer from a person who already claimed an offer under a different identity. In account security, it flags a login with the right password that doesn’t behave like the account owner. Scaled up from one person to many, a related but distinct layer — relationship intelligence, not identity resolution — is what surfaces coordinated abuse; this may take the form of a ring of accounts that look independent individually but can be seen to move as a single operation after their connections are mapped. In bot mitigation, it distinguishes a human working through friction from a script working at scale.
None of these needed a new kind of signal, just the same one, routed to a different decision each time. That’s what a shared platform makes possible: One substrate, many decisions. And once that platform exists, it doesn’t have to stop at direct identifiers.
Identity is more than an identifier
Direct identifiers were the obvious place to start, of course — a device ID, a phone number, an email, or a card on file. These are powerful signals that are hard to fake and often enough on their own to confidently answer the who-is-this question. But a sufficiently determined bad actor can still work around them with a new device, a new number, a new email, or a new card — making the direct trail go cold.
Behavior helps close the gap. How someone moves through a marketplace — the rhythm of their actions, their browsing patterns, checkout actions, or interactions with support — also provides a form of identity, one that tends to persist even when the identifiers around it are swapped out. It doesn’t replace direct signals; it’s a complementary layer for the cases where direct signals alone fall short.
This reframe matters because it changes the definition of “the same person.” Two accounts with completely different devices and payment methods can still be recognized as the same person if behavior enters the picture. Two accounts that look unrelated by every direct identifier can still warrant a closer look, if their behavior lines up too closely to be a coincidence.
Identity’s AI future
The clearest way to measure a platform like this isn’t in any single win; it’s in the customers who never notice anything happened, yet who benefit from a more streamlined experience. Identity intelligence removes friction that honest customers have been forced to absorb; a more confident system that moves more quickly to a conclusion about who it’s dealing with relieves them of that burden.
This same idea can be applied to richer inputs. Today, our behavioral signals still rely heavily on numerical summaries. But LLM and generative AI models can enable us in future to absorb insights from unstructured text, images, and free-form conversations at much lower development costs than before.
Unlike bootstrapping text and image sub-components from scratch in traditional neural network models, we can now either use readily available genAI endpoints or leverage the output layer of pretrained large models to generate text/image-related features such as issue description sentiment analysis or duplicate image checks. Additionally, we can explore transformer-based model architectures to curate user identity embeddings that could potentially revolutionize how we define clusters in the identity graph. In the architecture above, these show up as two separate paths (Figure 1): an LLM extracting features directly from free-form appeals, and text embeddings becoming a new kind of edge in the identity graph.
That said, the same AI advances that make it easier to build a trustworthy identity signal also make it easier to fake one with more convincing synthetic behavior, automated variation across accounts, or faster adversarial response to our new policies. Treating identity as a platform rather than a patchwork of one-off checks makes it possible to keep pace by offering a single place to fold in a new kind of signal instead of relying on a dozen separate systems each waiting their turn to catch up.
Ultimately, we aim to benefit from fewer bespoke, one-off identity answers by developing one consistent identity and relationship substrate to serve every decision point that needs it.
Stay Informed with Weekly
Updates
Subscribe to our Engineering blog to get regular updates on all the
coolest projects our team is working on