Engineering brief

DoorDash shows why LLM distillation beats real-time serving

AI Engineer3 min read · saves 19 min

At a glance

The brief is enough

Relevance
Practical value
Radar
Time horizon
Now
Warnings
None

DoorDash doesn't serve LLMs in production. It distills their reasoning into offline labels, semantic IDs, and memory blocks that every model reuses.

Distilling LLMs offline into shared primitives is more practical than serving them online.

Watch if you're designing an LLM-enhanced search or recommendation system at scale.

Summary

The core claim. Raghav Saboo argues that marketplace discovery is fundamentally a semantic understanding problem, not an engagement optimization one. At DoorDash's scale—spanning restaurants, grocery, retail, and pets—users arrive with broad missions like "I just adopted a puppy." Historically, retrieval and ranking systems optimized for click-through and conversion, which rewards popular items even when they fail user constraints. LLMs offer a new lever: the ability to reason about item meaning and shopper intent, but only if integrated thoughtfully into existing infrastructure.

The supervision primitive. DoorDash uses LLMs to generate graded relevance labels at scale. Human annotators create a high-quality seed set on a three-level scale. A stronger LLM audits suspicious cases—for example, items humans marked irrelevant but that convert well. After reconciliation with taxonomy models, the cleaned dataset fine-tunes a lightweight model like GPT-4o mini. This cheap, fast labeler then scores the full catalog offline. The key insight: spend expensive reasoning once, distill it into a model you can serve at production latency.

The catalog semantics primitive. Standard embeddings at e-commerce scale collapse relevance distinctions—related items sit near exact matches. DoorDash's fix is a two-stage contrastive method trained on the same graded labels. Stage one shapes global geometry with multi-level supervised contrastive loss. Stage two mines hard negatives (items the model confuses) and runs curriculum training. The result improved retrieval NDCG by 2.3% and translated to business metrics.

The memory primitive. DoorDash represents consumers at multiple time scales: long-term durable preferences from orders and searches, real-time in-session context, and stated preferences from agentic interactions like "Ask DoorDash." Each consumer's memory is materialized in three forms—human-readable text, latent embedding vectors for ML models, and graph structures linking consumers to brands, taxonomies, and revealed preferences. Graph-based embeddings outperformed taxonomy-based ones for retrieval at fine-grained levels. This memory framework powers personalized collections, agentic personalization, and feeds into downstream retrieval and ranking models as features.

The steerable content primitive. All four primitives feed into an offline batch process that generates personalized collections on store pages. Using consumer memory and semantic IDs, an LLM synthesizes collection titles, subtitles, and item lists. Because this runs offline, DoorDash still uses its existing retrieval and ranking stack for item hydration and collection ranking at serving time. The result is steerable by occasion and consumer context—plant-based pantry rows for vegan shoppers, cat dry food rows for cat-only households.

My take

This is the right pattern for any team building LLM-enhanced search or recommendations at scale. Saboo's claim that "the online LLM call is often not the product architecture you need" is exactly right. I've seen teams burn budgets on real-time model calls when an offline distillation pipeline would serve better and cheaper. What's missing is the operational cost of maintaining those pipelines: the seed dataset, the auditor model, the reconciliation logic. That's not trivial. But it's cheaper than running GPT-4 on every query. I'd add that the semantic ID approach has hidden complexity, regenerating them when catalog structure shifts requires careful versioning. Still, the distillation-first pattern is worth adopting.

What to do with this

  1. Audit your current LLM usage: how many calls are online when offline distillation would work?
  2. Map your shared primitives: graded labels, semantic IDs, user memory blocks. Identify gaps.
  3. Run a pilot distillation pipeline on one search or recommendation surface. Measure cost vs quality.

Watch the video

This video is blocked due to your privacy settings. To watch this video, please accept YouTube marketing cookies.

Related breakdowns

Get TL;DW

Too Long; Didn't Watch.

A concise breakdowns of the AI and devtools videos that actually matter for engineering leaders.

Free. Weekly. No hype.

Video and thumbnails remain the property of their respective creators. tldw.news provides editorial analysis, commentary, and discovery links to original content.