How Netflix Uses LLMs to Power Better Recommendations

Peter Bubenik · Netflix Tech · · Source
Image for GenRec: Towards LLM-Native Recommendation at Netflix

After studying this material, you should be able to:

  1. Explain why traditional recommendation systems have limitations and why LLMs offer a promising alternative
  2. Describe GenRec's architecture, training framework, and key design decisions
  3. Understand how verbalization replaces feature engineering in LLM-native recommendation
  4. Analyze the trade-offs between quality, cost, and scalability in LLM-backed recommenders
  5. Evaluate what "LLM-native recommendation" means as a broader paradigm shift

Step-by-Step Study Material

Step 1: The Problem — Why Traditional Recommenders Struggle

What exists today

Traditional recommendation systems like Netflix's production ranker are built on:

Traditional Stack Components:
├── Thousands of hand-crafted features
│   ├── User features (age, location, preferences)
│   ├── Item features (genre, duration, language)
│   └── Interaction features (watch history, ratings)
├── Specialized architectures
│   ├── Two-tower models
│   ├── DLRM-style networks
│   └── Custom attention blocks
└── Task-specific pipelines per surface/content type

The core pain points

ProblemConsequence
Thousands of engineered featuresExpensive to maintain
Custom architecture per taskHard to scale to new content types
Heavy feature infrastructureSlow to onboard new use cases
Sparse ID-based representationsDiminishing returns at scale

Key Insight: Adding a new content type (e.g., podcasts) could require feature engineering, architecture changes, infrastructure work, AND experimentation — all from scratch.


Step 2: Why LLMs Are Attractive for Recommendation

What LLMs bring to the table

LLMs offer capabilities that traditional recommenders lack:

LLM Strengths for Recommendation:
├── Broad world knowledge (understands content relationships)
├── Strong language understanding (interprets metadata naturally)
├── Shared semantic space (represents users + items together)
└── Natural-language steering (prompts can guide behavior)

But off-the-shelf LLMs fail as recommenders

Simply using a general-purpose LLM doesn't work because:

  • Popularity bias — over-recommends globally popular content
  • Hallucination — suggests items not in the catalog
  • No business awareness — ignores content balance requirements
  • Limited personalization — doesn't know your specific users

The Gap: Raw LLMs have the right capabilities but lack the domain alignment needed for production recommendation.


Step 3: GenRec's Core Idea

The solution in one sentence

GenRec post-trains an internal Netflix foundation LLM on Netflix-specific data and objectives, adding a catalog-aware ranking head to produce personalized recommendations.

Formal task definition

Input:  (u, τ, t, H)
         │   │  │  └── Interaction history
         │   │  └───── Time
         │   └──────── Context (device, surface, locale)
         └──────────── User

Output: π (ranking over catalog C)
         └── π(i) = position assigned to item i

Optimized for: Long-term member utility (not just clicks)

Step 4: The Two-Phase Training Framework

This is the architectural heart of GenRec. Think of it as general → specific.

Phase 1: Foundation Adaptation
┌─────────────────────────────────────────┐
│  Open-Source LLM                        │
│         ↓                               │
│  Train on Netflix proprietary corpora   │
│         ↓                               │
│  Netflix-aware backbone                 │
│  (updated infrequently, shared widely)  │
└─────────────────────────────────────────┘
              ↓
Phase 2: Ranking Specialization
┌─────────────────────────────────────────┐
│  Netflix-aware backbone                 │
│         ↓                               │
│  Post-train on ranking-specific data    │
│  + ranking objectives                   │
│         ↓                               │
│  GenRec: production-ready ranker        │
└─────────────────────────────────────────┘

Why two phases?

PhasePurposeUpdate Frequency
Phase 1General Netflix knowledgeInfrequent (shared backbone)
Phase 2Ranking-specific behaviorMore frequent (task-specific)

Analogy: Phase 1 is like a medical school education (broad foundation). Phase 2 is like a residency in cardiology (specialized application).


Step 5: Verbalization — Replacing Features with Language

The paradigm shift

Traditional systems convert user behavior into dense numerical vectors.
GenRec converts user behavior into natural language text.

Traditional Approach:
User History → [0.82, 0.14, 0.67, ...] → Model

GenRec Approach:
User History → "User watched Stranger Things for 45 min,
                gave Squid Game a thumbs up, added
                The Crown to their list..." → LLM

What gets verbalized

Netflix generates hundreds of billions of interaction events:

Interaction Types:
├── Views and plays
├── Watch duration
├── Thumbs up / thumbs down
├── Add to list
└── Abandons (stopped watching early)

These are converted into single-turn or multi-turn conversations between a simulated user and recommender.

Each conversation turn contains:

  • User message: Verbalized history + context
  • Assistant message: Recommendation response

Important: At inference time, the model does NOT generate assistant messages. The conversational format is only used during training to support the language modeling objective.


Step 6: Context Engineering — The New Feature Engineering

The token budget problem

Verbalizing everything is impractical at Netflix scale. The context window becomes the new "feature budget."

Naive Verbalization:
All history → Exceeds token limit → Too expensive ❌

Context Engineering:
Selective history → Fits token budget → Efficient ✅

Context engineering strategies

Context Engineering Toolkit:
├── Prioritization
│   └── Recent + high-signal interactions first
├── Compression
│   └── Summarize or drop older history
├── Prompt Structure
│   └── Maximize shared prefixes for caching
└── Goal: Compact, high-information prompt

The verbalization compaction finding

Experiments showed context tokens could be reduced to ~⅓ of original budget with negligible quality degradation, yielding a similar reduction in serving cost.

This is a critical result: careful context design preserves quality while dramatically cutting cost.


Step 7: Multi-Objective Training Loss

GenRec is trained with three combined objectives:

Total Loss = Ranking Loss (weighted) + LM Loss + Alignment

     ┌─────────────────────────────────────────────┐
     │  1. RANKING OBJECTIVE (Primary)             │
     │  Cross-entropy loss over catalog             │
     │  Positives = high-value engagements          │
     │  (long plays, strong explicit feedback)      │
     └─────────────────────────────────────────────┘
                        +
     ┌─────────────────────────────────────────────┐
     │  2. LANGUAGE MODELING OBJECTIVE             │
     │  Next-token prediction over verbalized text  │
     │  Preserves language understanding            │
     │  Enables future text-generation use cases    │
     └─────────────────────────────────────────────┘
                        +
     ┌─────────────────────────────────────────────┐
     │  3. REWARD-WEIGHTED ALIGNMENT               │
     │  Scale ranking loss by reward signal         │
     │  High-value engagement → larger weight       │
     │  Low-value engagement → smaller weight       │
     └─────────────────────────────────────────────┘

Why reward weighting?

Without alignment, the model might:

  • Over-favor binge-watching behavior
  • Focus too heavily on one content type
  • Optimize for clicks rather than satisfaction

Reward signals come from two types of separate reward models:

  1. Long-term satisfaction signals (retention, member utility)
  2. Business constraint signals (content type balance)

Why not full RL? Reward-weighted training is simpler and cheaper than full reinforcement learning (e.g., GRPO). GenRec uses this as a practical middle ground, noting RL-style methods show additional gains but at higher cost.


Step 8: Architecture — The Catalog-Aware Ranking Head

Architecture Overview:

Input: Verbalized context (text)
         ↓
┌─────────────────────────┐
│  Decoder-only           │
│  Transformer backbone   │  ← From Phase 1
│  (next-token prediction)│
└─────────────────────────┘
         ↓
┌─────────────────────────┐
│  Catalog-aware          │
│  Ranking Head           │  ← Scores only in-catalog items
│                         │
│  Item Embeddings        │  ← Jointly trained
└─────────────────────────┘
         ↓
Output: Ranked list of Netflix catalog items

Key design choices

ChoiceReason
Decoder-only TransformerFollows foundation LLM architecture
Catalog-aware headPrevents hallucination of out-of-catalog items
Joint training of all parametersEnd-to-end optimization
Sampled softmax for large catalogsEfficient training/inference at scale

Step 9: Serving at Scale

The cost drivers

Serving Cost ∝ Model Size × Context Length × Inference Mode

Three cost control strategies

Strategy 1: Prefill-only inference
  → No autoregressive decoding needed
  → Much faster than text generation

Strategy 2: Prefix caching
  → Shared prompt prefixes cached and reused
  → Reduces redundant computation

Strategy 3: Context compression
  → Reduce tokens to ~⅓ with negligible quality loss
  → Direct proportional cost reduction

Infrastructure note: GenRec is served using vLLM on Netflix's internal LLM stack — the same infrastructure used for general LLM serving, not a custom RecSys stack.


Step 10: Results — Does It Actually Work?

Offline results

GenRec vs. Production Ranker (Offline):

Training data used:  ~40× FEWER labeled examples
MRR improvement:     +1.6%
Trend:               Metrics continue improving with more data

Online A/B test results

Test scope:    ~10% of Netflix traffic
Duration:      ~4 weeks
Surfaces:      Batch-compute recommendation surfaces
Configuration: Low-data, low-signal (conservative setup)

Result: Statistically significant gains on BOTH
        ├── Short-term online metrics
        └── Long-term online metrics

The headline finding: GenRec matches or exceeds a mature production system that took years to build, using far fewer labels and input signals.


Step 11: The Broader Paradigm Shift

This is the "so what" — what GenRec signals about the future of recommendation systems.

Five dimensions of change

1. FEATURE ENGINEERING → CONTEXT ENGINEERING
   Old: Design features manually
   New: Decide what signals to include in the prompt

2. TASK-SPECIFIC ARCHITECTURES → SHARED BACKBONE
   Old: Custom model per task
   New: One foundation model, differentiated by data + objectives

3. SPARSE ID REPRESENTATIONS → SCALING LAWS
   Old: Diminishing returns from more data
   New: More data + larger models = consistent improvement

4. CUSTOM RECSY INFRA → LLM INFRA
   Old: MLP/factorization-based serving stacks
   New: GPU-accelerated, vLLM/Triton-based serving

5. MANUAL STEERING → NATURAL LANGUAGE STEERING
   Old: Hard-coded business rules
   New: Natural language prompts guide behavior

Summary comparison table

DimensionTraditional RecSysLLM-Native RecSys
Input representationDense features/embeddingsVerbalized text
ArchitectureTask-specificShared backbone
Scaling behaviorDiminishing returnsFollows scaling laws
Business alignmentHard-coded rulesReward-weighted training
InfrastructureCustom MLPs/factorizationLLM serving stack
Onboarding new tasksHigh engineering costContext + objective design

Concept Map: GenRec at a Glance

                    ┌─────────────────┐
                    │   User Request  │
                    │  (u, τ, t, H)   │
                    └────────┬────────┘
                             │
                    ┌────────▼────────┐
                    │  VERBALIZATION  │◄── Context Engineering
                    │  (History →     │    (prioritize, compress,
                    │   Natural Text) │     cache prefixes)
                    └────────┬────────┘
                             │
              ┌──────────────▼──────────────┐
              │     GENREC MODEL            │
              │  ┌─────────────────────┐    │
              │  │  Phase 1 Backbone   │    │
              │  │  (Netflix-aware LLM)│    │
              │  └──────────┬──────────┘    │
              │             │               │
              │  ┌──────────▼──────────┐    │
              │  │  Catalog-aware      │    │
              │  │  Ranking Head       │    │
              │  └──────────┬──────────┘    │
              └─────────────┼───────────────┘
                            │
                   ┌────────▼────────┐
                   │  RANKED OUTPUT  │
                   │  (in-catalog    │
                   │   items only)   │
                   └─────────────────┘

Training Objectives:
  ├── Ranking Loss (cross-entropy)
  ├── Language Modeling Loss
  └── Reward Weighting (alignment)

Quick Review Questions

Test your understanding:

  1. Why can't you just use an off-the-shelf LLM as a recommender?

    It hallucinate items, ignores business constraints, has popularity bias, and lacks personalization.

  2. What problem does the catalog-aware ranking head solve?

    It constrains outputs to only in-catalog Netflix items, preventing hallucination.

  3. What is "context engineering" and why does it matter?

    It's the process of selecting, compressing, and structuring user history within a token budget — the LLM equivalent of feature engineering.

  4. Why use reward-weighted training instead of full RL?

    It's simpler and more cost-efficient while still providing effective alignment to long-term satisfaction and business goals.

  5. What does the 40× data efficiency result tell us?

    The LLM backbone's pre-existing world knowledge and language understanding compensates for less task-specific labeled data.

More to study