Large Recommender Models: Adapting Gemini for YouTube Video Recommendations

google_/_youtube · Media & Entertainment · year n/a · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Video recommendation at consumer-internet scale

YouTube wanted to adapt Gemini-style large language modeling to video recommendations, where the model must reason over users, context, watch history, and billions of videos. The core challenge was converting videos into tokens a language model could use, adapting Gemini to YouTube's domain language, and serving improved recommendations under YouTube-scale cost, latency, freshness, and personalization constraints.

Constraints:

Architecture

YouTube builds a Large Recommender Model by adapting a Gemini checkpoint to a YouTube-specific video language. Videos are converted into semantic IDs by extracting title, description, transcript, audio, and frame-level features, embedding them, and quantizing them with RQ-VAE-like residual vector quantization. Continued pretraining links English text to semantic ID tokens and trains on masked watch-sequence prediction over YouTube engagement data. The resulting LRM can generate video semantic IDs for recommendation tasks such as retrieval, and production deployment uses smaller checkpoints plus cost optimizations and offline recommendation tables to avoid per-user online inference where possible.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  corpus["YouTube video corpus"] --> tokenizer["Semantic ID tokenizer"]
  gemini["Base Gemini checkpoint"] --> lrm["YouTube LRM checkpoint"]
  tokenizer --> lrm
  watches["Watch-sequence training data"] --> lrm
  lrm --> prompt["Generative retrieval prompt"]
  prompt --> surface["Surface-specific retrieval and ranking models"]
  lrm --> surface
  surface --> table["Offline recommendation table"]
  table --> prod["Production recommendation surfaces"]
  surface --> prod
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
YouTube video corpus Billions of videos and fresh uploads that need compressed semantic representation. Semantic ID tokenizer
Semantic ID tokenizer Extracts video features, builds embeddings, and quantizes videos into semantically meaningful tokens. YouTube video corpus, YouTube LRM checkpoint
Base Gemini checkpoint General-purpose foundation model adapted for YouTube recommendations. YouTube LRM checkpoint
YouTube LRM checkpoint Gemini-derived model continued-pretrained to reason across English and YouTube semantic ID tokens. Semantic ID tokenizer, Base Gemini checkpoint, Watch-sequence training data, Generative retrieval prompt, Surface-specific retrieval and ranking models
Watch-sequence training data User engagement paths and watched-video sequences used for masked prediction tasks. YouTube LRM checkpoint
Generative retrieval prompt Personalized prompt containing user demographics, device/location, current video context, and watch history. YouTube LRM checkpoint, Surface-specific retrieval and ranking models
Surface-specific retrieval and ranking models Custom LRM variants aligned for retrieval, ranking, and major recommendation surfaces. YouTube LRM checkpoint, Production recommendation surfaces, Offline recommendation table
Offline recommendation table Precomputed candidate recommendations for popular videos, used to avoid costly online LRM serving. Surface-specific retrieval and ranking models, Production recommendation surfaces
Production recommendation surfaces YouTube Home, Watch Next, Shorts, and personalized search surfaces where recommendations are served. Surface-specific retrieval and ranking models, Offline recommendation table

Data flow

YouTube starts with a base Gemini checkpoint and adapts it into a YouTube LRM checkpoint. Each video is featurized from metadata, transcripts, audio, and video frames, embedded, and quantized into semantic ID tokens. Continued pretraining teaches the model to map between English and semantic IDs and to predict masked videos from user watch sequences. For generative retrieval, a user prompt includes demographics, current context, and recent watch history, and the model decodes recommended video semantic IDs. For lower-cost serving, YouTube also removes personalization from some prompts, performs offline inference over head videos, builds recommendation lookup tables, and serves candidates through simple lookup.

4 supporting quotes
“we start with this base Gemini checkpoint um and then we are adapting it for YouTube recommendations teaching it a lot of information about YouTube”transcript, stated
“you extract a number of features out of it like the title, description, transcript, even the audio and video frame level data.”transcript, stated
“you can prompt the model with things like a user has watched the following videos ABCD. And you mask some of those videos”transcript, stated
“construct a prompt like we have on the right with this user demographic information, the context video, and have the model decode some video recommendations as SIDs.”transcript, stated

Why this architecture

YouTube uses semantic IDs because raw video content is too large and heterogeneous for direct LLM tokenization. Continued pretraining turns Gemini into a bilingual model over English and YouTube's video-token language, letting it reason about relationships between videos and users. Serving is split between smaller online models and offline lookup tables because full Gemini-scale inference is too costly for billions of users.

4 supporting quotes
“even with a million tokens of context, when you want to reason over many videos, you have to compress that video representation in some way.”transcript, stated
“we're making the atomic units for a new language of YouTube videos.”transcript, stated
“the outcome after this step in my mind is it's a bilingual LLM that can speak English and natural language but it can also speak your domain specific language.”transcript, stated
“there's no way that you can serve that to billions of daily active users.”transcript, stated

Models used: Gemini · Large Recommender Model · Gemini Flash · smaller Gemini checkpoints · semantic ID model · RQ-VAE or residual quantization vector quantization · generative retrieval model · mixture-of-experts candidates

Scale

Alternatives considered (roads not taken)

Predict search queries and retrieve videos through those queries

Rejected because: The speaker says this was tried before semantic IDs and was not good enough.

“we tried a bunch of other things like uh predicting search queries and retrieving videos through that or trying to just uh recommend videos directly.”transcript, stated
“And those solutions were just not good enough.”transcript, stated

Use hash-based tokenization for videos

Rejected because: YouTube wanted semantically meaningful tokens that preserve relationships between videos.

“this I think in itself is is an interesting milestone to move away from hashbased tokenization into a semantically meaningful one.”transcript, stated

Serve the strongest Gemini Pro-class model to all YouTube users

Rejected because: The full model was not servable to billions of daily active users under YouTube latency and scale requirements.

“Gemini Pro is incredible, but there's no way that you can serve that to billions of daily active users.”transcript, stated
“we had to focus on the smaller, more efficient models like flash and and even smaller checkpoints than that”transcript, stated

Always serve personalized LRM recommendations online

Rejected because: The team converted some recommendation serving into offline lookup tables to avoid serving-cost bottlenecks.

“we tried to turn this into an offline problem where it's the same prompt in the same model. We just remove the personal personalized aspects of this prompt”transcript, stated
“make this offline rex table and then we can just do a simple lookup to serve some recommendations.”transcript, stated

Patterns

retrieval-ranking (recommendation)

The LRM is aligned for recommendation retrieval and ranking surfaces, generating candidate video semantic IDs for downstream recommendation systems.

“Then we can align it for different recommendation related tasks like retrieval and ranking”transcript, stated
“have the model decode some video recommendations as SIDs.”transcript, stated

fine-tuning-adaptation (model-adaptation)

YouTube starts from Gemini and continues pretraining it on YouTube-specific semantic-ID and watch-sequence tasks.

“we basically take a Gemini checkpoint and then adapt it for this YouTube purpose and get this like YouTube and Gemini LRM checkpoint.”transcript, stated

batch-offline-processing (serving)

To reduce online serving cost, YouTube precomputes recommendations for head videos and serves them through lookup tables.

“do offline inference, um make this offline rex table and then we can just do a simple lookup to serve some recommendations.”transcript, stated

latency-optimization (serving)

The team moved toward smaller Gemini Flash and even smaller checkpoints because the recommendation system must meet latency and scale requirements.

“we had to focus on the smaller, more efficient models like flash and and even smaller checkpoints than that um just to be able to hit the latency and scale requirements”transcript, stated

cost-aware-routing (serving)

The production design routes some recommendation work to offline precomputed tables and smaller models after 95%+ TPU serving-cost reduction work.

“we spent a lot of time just reducing the TPU serving cost. And, you know, we got 95% plus cost savings”transcript, stated

Tradeoffs

How to let Gemini reason over videos

Chose Semantic ID tokenization over Search-query prediction, direct video recommendation, or hash-based video tokens.

Rationale: Semantic IDs compress videos into meaningful tokens that preserve relationships and outperformed the earlier retrieval approaches the team tried.

“we tried a bunch of other things like uh predicting search queries and retrieving videos through that or trying to just uh recommend videos directly. And those solutions were just not good enough.”transcript, stated
“move away from hashbased tokenization into a semantically meaningful one.”transcript, stated

How to adapt Gemini for YouTube

Chose Continued pretraining that links English and semantic IDs plus watch-sequence reasoning over Using Gemini as a generic text-only recommender.

Rationale: The adaptation creates a bilingual model that can speak natural language and YouTube's domain-specific video language.

“this process of what we call continued pre-training where we're trying to take this model and have it understand both English and this new YouTube language.”transcript, stated
“the outcome after this step in my mind is it's a bilingual LLM that can speak English and natural language but it can also speak your domain specific language.”transcript, stated

How to serve recommendations at YouTube scale

Chose Smaller checkpoints, cost reduction, and offline recommendation tables over Full personalized LRM online inference for every request.

Rationale: The LRM improved quality but serving cost and latency required aggressive optimization and offline lookup.

“the biggest limitation was that the serving costs are too high, especially for the scale that YouTube operates at with billions of users.”transcript, stated
“this was kind of a a complete way around our serving problems.”transcript, stated

How to handle language capability while specializing on video tokens

Chose Balance semantic-ID expertise with retained text ability over Overtraining solely on semantic-ID recommendation quality.

Rationale: Future interactive recommendation features require natural-language input and explanations, so losing English ability is a problem.

“we mostly cared just about recommendation quality in which case we overindexed on speaking the semantic ID language.”transcript, stated
“we're going to shift more towards text as we try to build these interactive experiences where uh text input from user is going to become more important.”transcript, stated

Gotchas (what bit them)

Raw video content cannot be treated like ordinary text tokens.

Root cause: The model needs to reason over many videos, but even huge context windows require compressed video representation.

Resolution: Create semantic IDs by embedding multimodal video features and quantizing them into video tokens.

“even with a million tokens of context, when you want to reason over many videos, you have to compress that video representation in some way.”transcript, stated
“You put all of that into a multi-dimensional embedding. Um and then you quantize it using RQVE to give every video uh a token.”transcript, stated

High-quality LRM retrieval was initially too expensive to serve.

Root cause: Transformer-based recommendation serving at YouTube's billion-user scale creates high TPU serving cost.

Resolution: Reduce serving cost by more than 95%, use smaller checkpoints, and turn some personalized serving into offline lookup.

“the biggest limitation was that the serving costs are too high, especially for the scale that YouTube operates at with billions of users.”transcript, stated
“we got 95% plus cost savings to be able to actually launch this in production.”transcript, stated

Recommendation freshness requirements are much stricter than ordinary LLM pretraining cadence.

Root cause: YouTube adds millions of videos daily and users expect trending fresh content immediately.

Resolution: Continuously pretrain the LRM on days/hours timescales rather than multi-month foundation-model cycles.

“We have 20 billion videos on YouTube, um with millions added every day. Um and the freshness of videos is really important”transcript, stated
“we have to continuously pre-train it on the order of days and hours which is very different than classical LLM pre-training like Gemini”transcript, stated

Overtraining on semantic-ID tasks can damage the model's English capability.

Root cause: The model can over-index on the new video-token language and forget natural-language behavior.

Resolution: Explore balancing mechanisms such as mixture-of-experts, with some experts retaining text ability while others focus on semantic IDs.

“as you overtrain on more and more of those examples actually the model forgets to speak English.”transcript, stated
“with mixture of experts maybe we can have a few experts that retain the text capability while other experts focus on the semantic ID capability”transcript, stated

Video-frame features are heavily compressed and may obscure what the representation captured.

Root cause: At YouTube scale, only selected frames can be sampled and all video information is compressed into a small token representation.

Resolution: Sample frames intelligently, including from high-engagement moments, while acknowledging uncertainty in exactly what the token picked up.

“given the scale we can't sample a lot of video frames so we try to intelligently select it”transcript, stated
“at the end all of this video information gets compressed into eight tokens. So, it's probably learning something, but it's hard to know exactly”transcript, stated

Evaluation

The talk describes production launch for retrieval, experimentation for ranking, comparison against prior production recommendations in hard cases, cold-start/fresh-content improvements, and internal quality assessment. Specific quantitative quality metrics are withheld, but the speaker reports that it was the largest recommendation-quality improvement in recent years.

Metrics: recommendation quality · retrieval production launch status · ranking experiment status · TPU serving cost · fresh-video performance · new-user and limited-history recommendation quality · cold-start performance for videos uploaded in the last day or week

4 supporting quotes
“this is a model that we have launched in production at YouTube for a while in terms of the retrieval system and we're experimenting a lot on the ranking side.”transcript, stated
“We find that this gives really interesting unique recommendations, especially for our hardest recommendation tasks.”transcript, stated
“what we find is performance for videos that were uploaded in the last day or the last week uh gets much better”transcript, stated
“it's been the biggest improvement to recommendation quality we've seen in the last few years.”transcript, stated

Outcomes

The system is designed for one of the world's largest consumer apps, across home, watch-next, Shorts, and search surfaces, with 20 billion videos, millions of daily uploads, billions of daily active users in the serving constraint statement, and continuous adaptation on days/hours timescales.

5 supporting quotes
“this is a model that we have launched in production at YouTube for a while in terms of the retrieval system”transcript, stated
“now with this new model, it's able to find this unique connection between the user demographic and their past watch history”transcript, stated
“we got 95% plus cost savings to be able to actually launch this in production.”transcript, stated
“performance for videos that were uploaded in the last day or the last week uh gets much better because we're better understanding this fresh and tail content.”transcript, stated
“it's been the biggest improvement to recommendation quality we've seen in the last few years.”transcript, stated