Distill the LLM, Don't Serve It: Search & Personalization at DoorDash — Raghav Saboo, DoorDash

summarized

TLDR

DoorDash treats LLMs as offline reasoning engines for search and personalization rather than serving them online. The company distills LLM reasoning into graded relevance labels, semantic IDs, and consumer memory blocks so small production models can learn semantic understanding across a catalog of a few billion items. The core argument is that marketplace discovery is a semantic understanding problem, and offline distillation, not live LLM serving, is the right architecture.

Key points

DoorDash improved retrieval relevance NDCG by 2.3% using labels distilled from LLMs.

Semantic IDs built from catalog data improved the ranker's MRR by 4-5%.

DoorDash fine-tunes a lightweight LLM such as GPT-4o mini as an offline graded labeler.

An ordinal relevance tower trained on LLM labels now sits alongside engagement towers in ranking.

LLM-generated personalized collections lifted pets order rate by about 1% and active users by 6%.

Tools mentioned

Techniques

  • LLM-as-labeler supervision with human auditing
  • two-stage contrastive learning with hard negative mining
  • curriculum training for retrieval
  • semantic IDs: hierarchical embedding codes
  • memory blocks for multi-form consumer representation
  • ordinal relevance tower for ranking
Transcript (captions)

0:12 Thank you everyone for coming to this talk and Devanch for organizing this. Uh I'm Ragav. I'm a staff uh machine learning engineer at Door Dash. I work on search and personalization

0:24 and uh today I'm going to talk about uh the ways that we're integrating LLMs for you know our marketplace discovery uh specifically in four pieces and um how these primitives are kind of uh uh

0:38 working towards our integration of LLMs into traditional uh Rexus as well. So I'll start off uh today uh with a simple claim. Uh the claim is that to build effective discovery in this case for a

0:55 marketplace like Door Dash the real bottleneck is semantic understanding. So that is knowing what you know actually what items mean uh for users given some context and what a shopper actually

1:13 intends to do on you know an app like Door Dash. And historically we have treated these uh as engagement optimization problems. Um however LLMs give us a genuinely new lever to extend

1:29 this. So this talk is about uh you know the four primitives that have allowed us to start leveraging LLMs for problems at Door Dash. As you may know Door Dash is now grown

1:44 uh well beyond restaurants. So we're in grocery, retail, pets, gifting and more. And our goal is to capture every shoppable moment. Uh and we know that across these verticals, the users

1:59 frequently have very broad shopping missions, right? So for example, a consumer may say when they come to our app is, you know, I just adopted a puppy.

2:10 What do I need to get started this week? And this consumer start may start on like searching for puppy food because they just adopted the puppy. That one query could unfold into further query

2:24 reformulations. Um they land on collections for you know other shopping needs, complimentary items such as crates, leashes, uh training pads all the way to checkout.

2:38 And this could happen over multiple sessions, mult multiple days, right? And capturing that whole arc is pretty hard because it spans multiple models. Um, and this is where the four primitives I

2:52 will cover come in. Specifically, supervision, catalog semantics, semantic personalization, and steerable content generation. As we heard previously as well, it's a system

3:06 of shared representations that help us map this customer's journey uh with the use of LLMs. Now, with supervision, the question we're asking or looking to address is

3:19 how do we teach our retrieval and ranking systems what good means for different tasks? And here's a simple example, right? A shopper searches for gluten-free pasta. And if we only rank

3:31 from engagement, very popular regular spaghettes might show up and because it sells well, you know, it may continue to show up. Even gluten-free white bread might be retrieved and, you know, show

3:44 up because it overlaps with gluten-free. But neither of these are clearly the right answer. What we actually want is graded relevance. A true, you know, gluten-free pasta should be a high

3:56 relevance item. Chickpea pasta might be a reasonable substitute and regular spaghetti while it's popular it fails the constraint that the user has. Now to solve this there are obviously two

4:10 sources of truth. We could look at human annotation but that's expensive slow and becomes quickly stale because our catalog changes quite rapidly.

4:22 Second is behavioral signals. They're abundant but obviously as I mentioned biased by exposure, position, price, promotions and you know previous model choices. So

4:33 the missing signal is a scalable reasoning signal. This is where LLMs are very useful as they offer a way to produce that supervision for such tasks. So in our case, you know, the PIP

4:46 pipeline starts with human ground truths. uh we build a high quality seed set of example query item pairs and on a three three uh level relevant scale 012. We audit the suspicious cases. For

5:02 example, if a human label says you know that an item is irrelevant but that item performs very well on add to cart or conversions, we send that case to a stronger LLM uh to re-evaluate with more

5:15 granular prompts. We also reconcile with other models. You know, for example, our query to taxonomy or category models. And if a query, you know, query maps to a set of valid

5:27 categories and the items belong to those valid categories, we may adjust the label accordingly. And through this process, we're able to achieve a pretty high precision golden data set that we

5:39 then fine-tune a lightweight LLM, let's say, for example, a GPD 40 mini on top of it. And that's when it, you know, really pays off. We are able to use that fine-tuned labeler offline across, you

5:54 know, our full catalog to generate uh full graded query item pairs. And those labels become one shared target for both retrieval and ranking systems. This pattern has been pretty important for us

6:07 over the past uh few years. um use you know expensive reasoning once offline then distill it into models that can you know be served cheaply and quickly. Now let's take retrieval first. The

6:24 challenge is you know standard embeddings um at e-commerce scale quickly collapse the relevance uh distinction. items that are merely related sit close to items that actually

6:36 match and the model uh may know two items are related but not be able to separate uh exact matches, substitutes, compliments. So our fix is a two-stage contrastive

6:48 method um trained on uh the same graded labels. Stage one, which we call mining, does a global geometry shaping. We use two tower encoders uh with multi-level supervised contrastive loss. Um after

7:03 that we use that base model to mine harder negatives and uh these are items that the model confuses hard negatives that are ranked too high or strong positives ranked too low. And the second

7:17 stage after that is where we really put the model through curriculum training. uh use those hard negatives, relabel them and our uh you know relevance of the retrieval layer improves sharply

7:33 after that. So after stage one we see overlaps between you know relevant and uh moderately relevant but after stage two there is a significant difference and this has been one of like our

7:44 biggest uh levers in retrieval improvement uh across the board. um you know we've improved NDCG of relevance by 2.3%. And uh that's also been true with our

7:57 downstream business metrics and we did the same with uh uh exercise with our ranking models as well distilling LM reason labels into our rankers. However, combining this with uh

8:11 business and engagement objectives. Here we add a new tower uh in this case an ordinal uh relevance tower on top of the LLM graded labels and uh this prediction sits right alongside existing

8:27 engagement towers uh click add to cart and conversion and since they share the same uh bottom layers the semantic fit and relevance fit gets distilled in the same backward pass and uh our model is

8:41 able to predict uh you know probability of relevance across the different levels and we are able to blend uh through a value function on on top of this that allows us to uh fine-tune between

8:54 engagement and relevance for different surfaces. Now these two examples are part of a larger theme of our work across similar projects uh where it seems right. We're

9:07 not replacing the retrieval and ranking system with an LLM, but rather distilling the uh reasoning and understanding into some production ranking architecture. And this allows us

9:18 to kind of quickly test and also scalably improve our models uh with LLMs while keeping uh you know the business and system objectives uh of these surfaces in mind.

9:31 So once we have supervision, the next question is how do we represent a very large and constantly changing catalog uh in a way that every model be it language models or uh you know traditional

9:44 retrieval and ranking models uh that they can understand and at you know Door Dash's scale uh you can imagine we're kind of surfacing items across stores across internationally actually uh now

9:57 and you know that's easily a few billion items at the store item level and for these items you obviously have unique skew ids but it says nothing semantically. So we also have a human

10:09 curated taxonomy that helps us classify and categorize these items into meaningful spaces. But often this is too coarse and too rigid. So for example something like hot sauces

10:22 may just have like sauces hot sauces in the taxonomy uh but it doesn't tell you anything about the relationship between hoof or franks or tobasco.

10:33 So that's where we've also adapted uh or adopted um semantic ids. Uh it's been introduced previously already. It's a backbone for a lot of our uh work uh now. And uh what it does is it gives us

10:50 a you know a short hierarchical code that's analogous to our taxonomy but uh the ability to control the fine grain nature of it. And the result of this learn taxonomy is that each item gets

11:05 this hierarchical code and the prefix captures broad neighborhoods and you know the later tokens capture finer distinctions. So for example in the map over on on the

11:18 slide you'll see hot sauces and the structure emerging from the data with zero labels. each one share the same first and second prefix in this uh ID sequence but then split by specialtity.

11:32 So now you've got Mexican, Caribbean, Korean hot sauces uh being split up. And the important property is that this code that's learned is you know comparable by as I said by prefix but also usable by

11:47 all of our downstream models and that unlocks a few things for us. So the first is cross-category comparisons or relationships. You know chips, salsa, guacamole may live in different taxonomy

12:01 branches but a shared semantic ID neighborhood can uh indicate that they belong together and maybe a shopping mission. Second cold start problems. uh oftentimes we get new catalog items

12:13 added by stores and with techniques like engram and bite parent coding of these tokens we're able to scalably add these to our models as sparse ID features third tail coverage so sparse items uh

12:29 and uh inherit a lot of signal from semantically related items and uh you know we don't have to wait for the volume or exposure uh to you um for to consumers for these items. And then

12:43 lastly, nice to have is the fact that we can actually also do a reverse audit. So we can audit our catalog and how well our human labels agree with the semantically learned labels.

12:56 So a couple of examples of where we're using it today uh just to get give some real metrics. Um it has been one of our biggest improvements to our ranker. Um in in this case it's actually improved

13:09 our uh ranker by uh improving MRR between four to 5% and that's translated to pretty big conversion uh wins as well. The second one that I'm particularly

13:21 fond of is query reformulation. So again going back to the hot sauce example, Sriracha can lead to garlic chili garlic sauce or sambell Ole and because these queries map onto like our catalog

13:36 grounded semantic neighborhood uh that results in much more relevant queries that we're suggesting to users. Um ultimately if these are queries that we don't have inventory for on Door Dash,

13:50 they're meaningless. And with the addition of semantic ids in this query graph, we were actually able to see pretty massive um MR gains as well uh for for this piece of work.

14:03 So for now we've talked about you know item mapping and relevance and the next question is consumer context. What does the system know about the shopper and can that knowledge be reused across

14:16 models again? And this is where uh our third primitive comes in memory. So memory in the agent context is pretty well understood now. Um we apply the same concepts to uh our recommendation

14:32 systems. So user embeddings are clearly very useful. uh we have many representations of our consumers but they don't necessarily get to uh why a consumer may have certain intents um and

14:46 why they might have certain preferences. Additionally, LLMs cannot uh readily use these uh embeddings. You could tokenize and like uh train these models to learn it. But oftentimes having some explicit

15:01 LM native counterpart is very useful and that's what we found. So the idea of memory is to represent uh the consumer in multiple forms semantic in you know inspectable and reusable

15:16 and uh the way we think about memory is uh in three time scales. So long-term memory captures durable preferences from orders, searches, browsing, support interactions.

15:31 Real-time context captures uh agentic inter interactions um oh sorry in session interactions so cart state active searches and then we have stated preferences which come from agentic

15:45 interactions so something like ask door dash for example where consumers are able to explicitly state their constraints and preferences as well and the way we represent consumers in uh

15:57 in uh this long-term memory is through uh memory blocks. And these are structured in a way that allows uh us to add new dimensions of the user, you know, from dietary preferences to dining

16:10 preferences to uh substitute pre uh preferences um as we learn more about the consumer and that is uh decoupled from like the downstream system that u that doesn't need to reinterpret uh this

16:24 for their own use cases. So each consumer's memory is multi materialized in multiple forms. So first is text that's human readable. It's uh captures the consumer in a compact way.

16:37 Second is are latent vectors embeddings of those memory blocks that can be fed into retrieval and ranking systems. And third are graph and tree or hierarchical approaches. So uh you know type

16:51 relationships between consumers and brands taxonomies and memory uh revealed um preferences and these are assembled into you know composite memory objects that both ML

17:05 models and LLM use downstream. So an example is you know this context graph uh where we connect consumers with extracted memory concepts and a graph needs fits neatly into shopping journeys

17:18 because you know oftent times uh consumer item interactions are sparse and multihop. And in this case these context graphs are able to link consumers across memory concepts that we

17:30 previously did not have uh relationships for. And it's particularly helpful uh at fine grain taxonomy levels. In our case, we're seeing uh for retrieval uh uh using uh graph uh based embeddings

17:47 outperforming our uh existing taxonomy based embeddings. And today this memory framework shows up in three places. The first is personalized collections. I'll talk

18:01 about that a bit later. Uh second is agentic personalization. So ask door dash for example uses this to personalize its sessions uh for you. And third in uh retrieval and ranking models

18:13 as I said we encode these memory blocks and feed them as features in in downstream models as well. So the fourth primitive is steerable content generation. We heard quite a bit

18:26 about it in the previous talk and this slide is my take on how we're p piecing all these uh primitives together. So all of these inputs, semantic ids, memory blocks um and graded relevance or um LLM

18:43 supervision feed into multiple models you know be it LLMs or small language models or um uh you know traditional models and from these inputs we can generate different output shapes you

18:56 know ranked semantic ID lists, carousel titles, subcopies and these show up across different surfaces today on Gord Dash and A direct example of this is uh our um

19:09 personalized collections on store pages. So historically collections on store pages uh on Door Dash have been a fixed library or attribute-based um and we've been able to kind of expand

19:23 that through uh consumer level collection generation. And today this is an offline uh LLM process where we take in consumer memory semantic ids and syni syn synthesize uh collections um all the

19:38 way from title subtitle to the actual items. And the important part is that control and steerability. We're able to react to occasions and moments um and build those

19:50 collections as needed uh for different consumers at serving time. uh because this is all batch and uh generated offline through LLMs, we are able to still use our uh existing retrieval and

20:05 ranking stack for item hydration, collection ranking, etc. And you know this is for example what a shopper actually sees, right? For a shopper with plant-based affinity, the

20:16 system can generate plant-based pantry rows. For cat-only households, it can generate cat dry food rows. And if a session indicates that you know a person is going through pantry restocking it

20:28 can bias towards pantry staples. And our early tests show that you know consumers are feeling the benefits of these tailored experiences. Uh an example is uh within our pets vertical we've been

20:40 able to drive uh close to 1% uh order rate increases and 6% in uh active users. So to conclude uh there are three takeaways I would love for you to take

20:53 away from this talk and how LLM fit into search and recommendations. First discovery is a semantic understanding problem. It's not only about engagement. LMS give us a way to reason about item

21:07 meaning and shopper intent. Uh in in Door Dash's case for example. Second uh distill LM reasoning into primitives. capture you know reasoning uh offline as labels, semantic ids, memory and then

21:23 let smaller and faster models serve it. The online LLM call is often not the product architecture you need. Third, shared representations create many use cases. Uh once you have these

21:36 primitives, they can power, you know, retrieval, ranking, content generation, etc. So last but not least, thank you and thank you to all the collaborators at

21:47 Door Dash who have helped ship a lot of these things as well.

Frontier News · by Hyperjump Technology