Design recommendations with LLM re-ranking
Recommendation systems were doing machine learning at scale long before LLMs: candidate retrieval, a learned ranker, business rules. The question in 2026 is where an LLM actually helps. Netflix's GenRec paper (August 2026) describes an LLM-backed ranker post-trained on Netflix data and tested online against their production ranker; they frame it as an early step, not a replacement of the whole stack. That framing matches what I would say in an interview: the LLM is one more stage in the funnel, used where its strengths (understanding text, reasoning over a user's history in natural language, explaining choices) beat the cost.
I'll design recommendations for a content platform (articles and videos) with an LLM re-ranking stage.
Requirements
Functional
- Personalized home feed and "more like this" rails.
- Use behavior (clicks, watch time, likes) and content understanding (titles, descriptions, transcripts).
- Support cold-start users and brand-new items.
- Optional short explanations ("Because you watched X").
- Business rules: diversity, freshness, policy filtering, sponsored slots.
Non-functional
- Feed latency under about 300 ms at p99 for the page load.
- Cost per feed request bounded; LLM calls cannot be per request for every user at peak.
- Measurable lift in online A/B tests, not only offline metrics.
Scale estimates (assumptions)
| Quantity | Assumption | Result |
|---|---|---|
| Daily active users | 30M | |
| Feed requests per user per day | 6 | 180M/day, about 6,000/s at peak |
| Catalog | 10M items | |
| Candidates per request | 1,000 from retrieval, 200 after first ranker | |
| LLM re-rank input | 50 items x 60 tokens plus 500 token user profile | about 3,500 tokens per call |
| Naive LLM cost | 6,000 calls/s x 3,500 tokens | 21M prompt tokens/s, far too expensive to do online for everyone |
That last row decides the architecture. You either make the LLM stage cheap (small model, prefill-only scoring, caching) or move most of it offline, or both.
High-level architecture
Rendering diagram…
There are actually three LLM uses here, and two are offline:
- Item enrichment (offline): generate tags, topics and dense descriptions for every item, and embed them. Helps retrieval and cold-start items.
- User profile summaries (offline or near-line): turn a user's recent history into a short natural language profile, refreshed periodically.
- Re-ranking (online): score or reorder the top ~50 candidates with the profile and item text.
Request flow
Rendering diagram…
Components
| Component | Responsibility | Notes |
|---|---|---|
| Event stream | Clicks, views, dwell time, skips | Kafka or similar; feeds features and training data |
| Feature store | User and item features for ranking | Online low-latency reads, offline for training |
| Item enrichment | LLM-generated tags, summaries, embeddings | Batch job on new items; re-run on model upgrades |
| Candidate retrieval | Multiple sources: ANN, co-engagement, trending, follows | Blended to about 1,000 items |
| First-stage ranker | Fast learned model over features | GBDT or neural ranker; does most of the work |
| User profile service | Text summary of user tastes, versioned | Refreshed on schedule or after N new events |
| LLM re-ranker | Reorders top N with semantic understanding | Fine-tuned small model, or prompted larger model on a subset of traffic |
| Rules layer | Diversity, dedupe, policy, sponsored slots | Deterministic and auditable |
Data model
CREATE TABLE item_enrichment (
item_id BIGINT PRIMARY KEY,
model_version TEXT,
summary TEXT, -- 1-2 sentence LLM description
topics TEXT[],
embedding VECTOR(768),
safety_labels TEXT[]
);
CREATE TABLE user_profiles (
user_id BIGINT PRIMARY KEY,
version INT,
profile_text TEXT, -- "Likes long-form history, recently into cycling..."
built_from_event_id BIGINT,
updated_at TIMESTAMPTZ
);
CREATE TABLE impressions (
request_id UUID,
user_id BIGINT,
item_id BIGINT,
position INT,
stage_scores JSONB, -- first ranker score, LLM score, final
ranker_variant TEXT, -- for A/B analysis
clicked BOOLEAN,
dwell_ms INT
);
Logging scores from every stage per impression is what lets you tell whether the LLM stage is helping or just moving things around.
Deep dives
Pointwise, listwise, or prefill-only scoring
There are a few ways to have an LLM rank:
- Listwise generation: give the model 50 items and ask for an ordered list of ids (the RankGPT style). Expressive, but decoding 50 ids is slow and output can be malformed.
- Pointwise scoring: for each item, read the probability of a "yes, the user will like this" token. Parallel and robust.
- Prefill-only scoring: encode the user history once and score candidates from the logits in a single forward pass, with no decoding at all. Netflix describes prefill-only serving for GenRec. Since prefill is compute-bound and batches well, this is far cheaper than generation.
For an online stage, I would choose pointwise or prefill-only scoring with a small fine-tuned model, and keep listwise generation for offline experiments or for explanations.
Fine-tuned small model vs prompted large model
A prompted frontier model is a quick way to prototype and can be good at cold start, but it does not know your engagement data. A smaller open model fine-tuned on your logged impressions (with labels like click, long watch, skip) is cheaper per call and learns your platform's notion of "good." The usual path: prototype with prompting, generate training data, then distill into a small model that serves in your own GPU fleet.
Keeping cost and latency under control
- Shrink N: the first-stage ranker already does most of the work. Re-rank 30 to 50 items, not 200.
- Cache: the LLM input is (profile version, candidate set). Users refresh feeds often with similar candidates, so caching scores per (profile version, item) hits a lot.
- Prefix reuse: the profile is a shared prefix across all candidates in a request, so prefix caching in the serving engine makes per-item scoring cheap.
- Traffic tiers: run the LLM stage only for surfaces where it shows lift, or for users with enough history, and fall back to the first ranker on timeout.
- Time budget: give the stage a hard deadline (for example 80 ms) and skip it rather than slowing the page.
Evaluation
Offline: NDCG, MRR and recall at K on held-out sessions, measured on top of the first ranker's output (the realistic setting). Also measure diversity and coverage, since LLMs can overfavor popular or well-described items. Online: A/B tests on engagement and longer-term metrics like retention, because a re-ranker that boosts clickbait can win clicks and lose users. Netflix reports gains on both short-term and long-term online metrics for GenRec in a four-week test; you should demand both before shipping too.
Explanations
LLM-written explanations ("Because you enjoyed documentaries about climbing") are a nice product touch. Generate them only for the items actually shown, cache them, and ground them in real history items so they are not fabricated.
Trade-offs and pitfalls
- Position and verbosity bias. In listwise prompts, items listed first get favored. Shuffle inputs or use pointwise scoring.
- Text quality bias. Items with better descriptions win regardless of actual quality. LLM enrichment for every item levels the field.
- Feedback loops. Any ranker trained on its own impressions narrows over time. Keep exploration traffic and log propensities.
- Offline-online gap. Offline gains often do not transfer. Treat offline metrics as a filter and A/B tests as the decision.
- Profile staleness. A profile refreshed weekly misses this morning's new interest. Combine the text profile with real-time features.
- Cost creep. An LLM stage that is 2% better but 10x more expensive may not pay off. Report lift per unit cost.
Checklist
- LLM work split into offline enrichment, near-line profiles and a narrow online stage.
- Online stage re-ranks only the top tens of items, with a hard deadline and fallback.
- Scoring uses pointwise or prefill-only inference, not long generation.
- Caching keyed by profile version and item, plus prefix caching in serving.
- Per-stage scores logged on every impression.
- Offline ranking metrics plus diversity, then online A/B on short and long-term metrics.
- Exploration traffic to limit feedback loops.