Raghav, a Staff Machine Learning Engineer at DoorDash, presents their approach to integrating Large Language Models (LLMs) for marketplace discovery. The central claim is that the bottleneck for effective discovery on a platform like DoorDash is semantic understanding—knowing what items mean to users in context and what a shopper intends to do. Historically, this has been framed as an engagement optimization problem, but LLMs offer a new lever to extend this understanding.
DoorDash has expanded beyond restaurants to include groceries, retail, pets, and gifting, meaning users often have broad shopping missions. For example, a user adopting a puppy might search for 'puppy food' but also need crates, leashes, and training pads. Capturing this entire shopping arc is challenging as it spans multiple models and sessions.
DoorDash integrates LLMs across four primitives:
1. Supervision: The goal is to teach retrieval and ranking systems what 'good' means for different tasks. Engagement data (clicks, orders) is a biased proxy for relevance due to exposure bias. Human annotation is accurate but slow, expensive, and quickly becomes stale as the catalog changes. LLMs address the missing signal by providing scalable semantic reasoning. The process involves human annotations for a high-quality seed set of query-item pairs, which is then audited for suspicious cases (e.g., human labels indicating irrelevance for highly engaged items). These audited cases are re-judged by a stronger LLM with granular prompts. They also reconcile LLM outputs with query-to-taxonomy models. This process creates a high-precision gold set used to fine-tune a lightweight LLM (e.g., GPT-4o mini) offline. This fine-tuned LLM then labels 100M+ query-item pairs, generating graded relevance supervision for both retrieval and ranking systems.
For retrieval, standard embeddings often fail at e-commerce scale by collapsing relevance distinctions. DoorDash uses a two-stage contrastive method. Stage 1 (Global Shaping) uses two-tower encoders with multi-level supervised contrastive loss. Stage 2 (Boundary Sharpening) uses the base model from Stage 1 to mine harder negatives (items ranked too high despite low relevance, or strong positives ranked too low). This significantly improves retrieval relevance (e.g., +2.3% offline NDCG@10) and downstream business metrics like purchase rate and conversion rate.
For ranking, an ordinal relevance tower is added on a shared bottom model, trained using the offline LLM-generated graded relevance labels. This prediction is combined with existing engagement towers (click-through rate, add-to-cart rate, conversion rate) via a unified value function. This approach has led to +0.15 in relevance NDCG@10 and positive lifts in purchase rate and conversion rate.
2. Catalog Semantics: SKU IDs are random and semantically meaningless, while human-curated taxonomies are often too coarse and rigid. DoorDash addresses this by adopting Semantic IDs—a compact, hierarchical code per product learned from embeddings. These codes are analogous to the taxonomy but capture finer-grained distinctions. For example, hot sauces with different regional specialties (Mexican, Caribbean, Korean) will have distinct Semantic IDs that branch off a common 'hot sauce' prefix. This unlocks:
Cross-category links: Identifying relationships between items in different taxonomy branches (e.g., chips, salsa, guacamole for a shopping mission).
Cold-start coverage: New items can inherit signals from semantically related items without waiting for purchase volume.
Tail-item coverage: Sparse items gain signals from their neighbors in the Semantic ID clusters.
Outgoing audit: Auditing how well human labels align with semantically learned labels.
Semantic IDs feed into the multi-task ranker as a categorical feature, improving MRR by 4-5% and yielding significant conversion rate wins. They also improve query reformulation by suggesting next queries grounded in the semantic neighborhood of the initial query, rather than relying on potentially off-catalog free-text generation.
3. Semantic Personalization: Embeddings capture behavior, but memory captures intent. User embeddings are useful but don't explain why a user has certain preferences. LLM-native memory layers provide explicit, reusable knowledge about a consumer's durable and in-session preferences. This memory operates at three timescales:
Long-term memory: Captures durable preferences from orders, searches, browsing, and support interactions (e.g., dietary preferences, store preferences).
Real-time context: In-session interactions like cart state, active searches, and recently viewed/rejected items.
Stated preferences: Explicit preferences and constraints from direct agent interactions (e.g., 'ask DoorDash').
Memory is stored hierarchically as text combined with metadata (memory blocks). These blocks are derived from latent sequences and a context graph for context assembly and summarization, which agents can read. For retrieval and ranking models, Context Graph Embeddings (GNN embeddings) are generated. This graph connects consumers with brands, taxonomies, merchants, and extracted keywords, lifting retrieval by 11-13% in production across taxonomy levels. Memory blocks run in production to:
Personalize collections: Offline LLM batch jobs generate per-consumer defined collections (carousels) based on memory, which are then served through existing retrieval/ranking stacks. This has driven ~1% order rate and ~0.6% active user increases in pets.
Natural-language context for every turn: Agents use memory blocks for contextual understanding, distinguishing true loyalty from re-ordering patterns.
Memory as embeddings: Encoded memory blocks feed into downstream two-tower retrieval and GNN ranker models as features.
4. Steerable Content Generation: This is the fourth primitive, crucial for generative AI. It allows for controlled generation of content (e.g., carousel titles, subtitles, search intents).
Three Takeaways:
1. Discovery is also a semantic understanding problem: LLMs add a new level to teach the system what items mean and what a shopper intends.
2. Distill LLM reasoning into primitives: Capture reasoning offline as labels, Semantic IDs, and memory, then let smaller, faster models serve it. Online LLM inference is rarely the thing that has to ship.
3. Shared representations, many use cases: Each primitive is a shared understanding and representation that multiple downstream models and use cases reuse, from retrieval and ranking to generation.