Large Foundation Model for Unified Recommendation and Ranking at Scale

linkedin · Tech · 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: Unified recommendation and ranking at platform scale

LinkedIn wanted one foundation model to solve many personalization and ranking tasks instead of maintaining task-specific recommender models that were disjointly optimized, slow to roll out, and weak at zero-shot or cold-start generalization. The production constraint was severe: recommendation systems require very high QPS and sub-second latency.

Constraints:

Architecture

LinkedIn converts user profiles, histories, interactions, instructions, and candidate items into prompts, trains a large personalization foundation model through upcycling, continuous pretraining, fine-tuning, instruction tuning, and alignment, then compresses it for serving. The quality-maximized 150B model acts as the teacher. Production uses gradual distillation through intermediate sizes such as 8B, 3B, and 1B, gradual pruning, mixed-precision quantization with FP32 kept for the LM head, and attention sparsification/multi-item scoring so candidates attend to user history but not each other. The team built automation so experiments push results to spreadsheets and developers can vary quantization or model parameters end-to-end.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  User_profile_and_history["User profile and history"] --> Promptification_layer["Promptification layer"]
  Candidate_items["Candidate items"] --> Promptification_layer
  Promptification_layer --> Foundation_model_training_pipeline["Foundation model training pipeline"]
  Foundation_model_training_pipeline --> 150B_teacher_model["150B teacher model"]
  150B_teacher_model --> Stepwise_distillation_pipeline["Stepwise distillation pipeline"]
  Stepwise_distillation_pipeline --> Gradual_pruning_pipeline["Gradual pruning pipeline"]
  Gradual_pruning_pipeline --> Production_sized_student_model["Production-sized student model"]
  Mixed_precision_quantization["Mixed precision quantization"] --> Production_sized_student_model
  User_profile_and_history --> Sparse_attention_scorer["Sparse attention scorer"]
  Candidate_items --> Sparse_attention_scorer
  Sparse_attention_scorer --> Production_sized_student_model
  Production_sized_student_model --> Recommendation_serving_system["Recommendation serving system"]
  150B_teacher_model --> Benchmark_suite["Benchmark suite"]
  Production_sized_student_model --> Benchmark_suite
  Automation_system["Automation system"] --> Foundation_model_training_pipeline
  Automation_system --> Benchmark_suite
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
User profile and history Member profile, recent activity, and past interaction context used for personalization prompts. Promptification layer, Sparse attention scorer
Candidate items Items or entities being scored for recommendation and ranking. Promptification layer, Sparse attention scorer
Promptification layer Converts user history, profile, interaction data, instructions, and candidate items into LLM prompts. User profile and history, Candidate items, Foundation model training pipeline
Foundation model training pipeline Open-source initialization plus upcycling, continuous pretraining, fine-tuning, instruction fine-tuning, and alignment. Promptification layer, 150B teacher model, Automation system
150B teacher model Quality-maximized large model used for personalization and as a distillation teacher. Foundation model training pipeline, Stepwise distillation pipeline, Benchmark suite
Stepwise distillation pipeline Gradually distills the teacher through intermediate model sizes such as 8B, 3B, and 1B. 150B teacher model, Production-sized student model, Gradual pruning pipeline
Gradual pruning pipeline Progressively removes transformer heads, MLPs, or layers while distilling to reduce model cost. Stepwise distillation pipeline, Production-sized student model
Mixed precision quantization Uses FP8 for activations/parameters where possible while keeping the LM head in FP32 for calibrated scores. Production-sized student model
Sparse attention scorer Scores many candidate items while preventing candidate items from attending to each other. User profile and history, Candidate items, Production-sized student model
Production-sized student model Compressed model suitable for high-QPS low-latency recommendation serving. Stepwise distillation pipeline, Gradual pruning pipeline, Mixed precision quantization, Sparse attention scorer, Recommendation serving system
Recommendation serving system Production environment requiring tens of thousands of QPS and sub-second latency. Production-sized student model, Benchmark suite
Benchmark suite Internal and external benchmarks for cold-start, out-of-domain, instruction-following, and production model comparisons. 150B teacher model, Production-sized student model, Automation system
Automation system Experiment automation that integrates open-source tools and pushes results automatically for rapid iteration. Foundation model training pipeline, Benchmark suite

Data flow

LinkedIn gathers user profile information, user interaction history, and candidate items, then promptifies them into an instruction-style LLM input. Training starts from an open-source model, uses upcycling to tune size/quality/throughput, then applies continuous pretraining, fine-tuning, instruction fine-tuning, and alignment. The resulting 150B-quality teacher is evaluated on cold-start and out-of-domain recommendation tasks. Serving compresses the teacher step by step into smaller models, applies pruning, mixed precision quantization, sparse attention, and multi-item scoring, then benchmarks latency and throughput improvements for production recommendation workloads.

4 supporting quotes
“we need to convert all the information we have about the users and the interactions and everything that they had into prompt”transcript, stated
“we start with the open source model then we do some uh magic of upycling”transcript, stated
“we have like a few uh blocks of training uh continuous pre-training fine-tuning and in instruction fine-tuning and also alignment”transcript, stated
“we go all the way down to let's say 3B model which is actually something that can be productionized”transcript, stated

Why this architecture

The architecture separates quality maximization from production serving. A large teacher captures holistic user journey, zero-shot behavior, cold-start in-context learning, and new-domain generalization. Because that model cannot meet high-QPS low-latency serving constraints, LinkedIn gradually distills, prunes, quantizes, sparsifies attention, and automates experiments until the student model preserves enough quality while meeting production cost and latency needs.

3 supporting quotes
“what if we have only one model to to solve all the task uh at at at the same time.”transcript, stated
“we need to go big and then go small if you go with a smaller model initially it doesn't have enough capacity”transcript, stated
“this 150 billion parameter model and then we start distilling it to the smaller model.”transcript, stated

Models used: 150B personalization foundation model · 8B student model · 3B student model · 1B student model · Mixtral 7B · Mixtral 8x22B · SG lang · vLLM · Lightning

Scale

Alternatives considered (roads not taken)

Maintain separate task-specific recommender models

Rejected because: Task-specific models are disjointly optimized, slow to roll out, and cannot solve new tasks zero-shot.

“they are disjoint optimized um they are usually not leveraging for for leveraging the the most advanced architecture they are being rolled out one by one”transcript, stated

Train only a small model from scratch

Rejected because: The speakers say small models lack enough capacity and that distillation from a larger model is necessary.

“If you do try to train the model from scratch with a small model, it doesn't actually work that well.”transcript, stated

Distill directly from 150B to 1B

Rejected because: Stepwise distillation through intermediate sizes is described as more effective.

“that recipe shows to be much much much more effective rather than basically directly going from 150 billion parameter model to one v parameter model.”transcript, stated

Aggressive pruning at the beginning

Rejected because: Aggressive pruning can reduce model quality; gradual pruning can preserve information.

“if you just basically do aggressive pruning at the beginning, you can have up to 1% reduction in the in the model quality.”transcript, stated

Apply FP8 everywhere

Rejected because: The LM head needs FP32 precision so ranking probabilities stay calibrated.

“in the LM head at the end of the language model has to be in FP32.”transcript, stated
“you cannot distinguish between different item recommended.”transcript, stated

Patterns

fine-tuning-adaptation (model-training)

LinkedIn adapts an open-source LLM into a personalization model with continuous pretraining, fine-tuning, instruction tuning, and alignment on promptified recommendation data.

“continuous pre-training fine-tuning and in instruction fine-tuning and also alignment”transcript, stated

retrieval-ranking (ranking)

The LLM foundation model scores user-item relevance for recommendation and ranking surfaces.

“recommendation ranking and personalization is deeply integrated our daily life.”transcript, stated
“what do you think about the relevancy between these two entities.”transcript, stated

cost-aware-routing (serving)

The serving recipe compresses the teacher model through distillation, pruning, quantization, and sparse attention to lower latency and raise throughput.

“there are three levers that we can we can pull in in order to make the model more efficient and improve the throughput and and reduce the latency”transcript, stated

batch-offline-processing (training)

Large model training, distillation, pruning, quantization experiments, and benchmark runs are automated offline before production serving.

“We had to do a lot of automation. So, one of the key lessons from here is that you build a lot of automation into this uh into these pipelines”transcript, stated

eval-driven-development (evaluation)

LinkedIn uses broad benchmarking, including internal and external tasks, to check cold-start behavior, out-of-domain generalization, and instruction-following after compression.

“having a very comprehensive benchmarking set. We have something around like 50 to 60 benchmarking.”transcript, stated

Tradeoffs

Train one foundation model for many recommendation tasks.

Chose unified personalization foundation model over many task-specific recommendation models.

Rationale: A single model can generalize to new surfaces, support cold-start users, and reduce one-by-one model rollout work.

“So the mission that we started was to build a large foundation uh model based on large language models”transcript, stated
“can solve all the personalization tasks that that LinkedIn has with just one model.”transcript, stated

Use promptification for recommender data.

Chose LLM prompts containing profile, history, instruction, and candidate information over traditional task-specific feature input only.

Rationale: Promptification lets the model follow instructions, use in-context examples, and generalize across recommendation tasks.

“we turn it into a prompt something like the one on the right hand side here.”transcript, stated
“there's an instruction for the model to follow for example what we want the model to do”transcript, stated

Go big then go small.

Chose 150B teacher followed by gradual student distillation over training the small production model directly.

Rationale: The large model maximizes quality, and staged distillation transfers that behavior into a deployable model.

“Unfortunately, that's not actually the case. You have to first go big and then go small.”transcript, stated
“the distillation is actually something that is very important for for the smaller models.”transcript, stated

Score many candidate items together with sparse attention.

Chose multi-item scoring with attention masks over decoding or fully connected candidate attention.

Rationale: Candidates can share user-history context without attending to each other, improving serving efficiency.

“Instead of recommending one item you can recommend 50 item 500 item at the same time”transcript, stated
“you want to make sure that these items are not attending to each other.”transcript, stated

Gotchas (what bit them)

A quality-maximized 150B recommender foundation model cannot directly serve high-QPS recommendations.

Root cause: Recommendation systems need tens of thousands of QPS and hundreds-of-milliseconds latency.

Resolution: Distill, prune, quantize, and sparsify attention into a production-sized student.

“obviously this model is not going to be able to serve online because as you as you know the recommendation systems are very very coopus hungry”transcript, stated
“how can we production such a large model in an environment that requires a very high QPS and low latency.”transcript, stated

Small recommender LLMs trained directly lack quality.

Root cause: They do not have enough capacity or reasoning power for complex personalization tasks.

Resolution: Train a large teacher first, then distill gradually into smaller models.

“if you go with a smaller model initially it doesn't have enough capacity it doesn't have enough reasoning power”transcript, stated

Longer user context helps until the model fails to generalize to long context.

Root cause: Recommendation context length controls how much history the model sees, but some models degrade beyond their long-context generalization range.

Resolution: Experiment with context length and user-history ordering instead of assuming more history always helps.

“towards the end of this graph the performance actually drops.”transcript, stated
“the model that we were using in this experiment doesn't generalize that well to the longer context.”transcript, stated

Ranking probabilities can collapse under overly aggressive quantization.

Root cause: Lower-precision LM heads lose score calibration needed to distinguish recommended items.

Resolution: Use mixed precision and keep the LM head in FP32.

“If you do it in FP16, BF16 or FP8, uh what what happens is that the numbers collapse”transcript, stated

Smart history retrieval can conflict with serving optimizations such as KV caching.

Root cause: More complex context selection can break or complicate serving cache assumptions.

Resolution: Use chronological order when good enough and design smarter retrieval with serving constraints in mind.

“You don't want to break the KV caching or something that you're using in the serving.”transcript, stated
“it's going to be a little bit more complicated, more cumbersome to do something that's smarter than just putting the chronological order.”transcript, stated

Evaluation

LinkedIn evaluates the foundation model across cold-start user groups, out-of-domain tasks never seen in training, internal and external benchmark sets, instruction-following tests, compression quality, latency, and throughput. Experiments also vary data scale, model size, context length, distillation, pruning, quantization, and serving kernels.

Metrics: cold-start performance by number of interactions · out-of-domain task performance · 50 to 60 benchmarks · instruction-following benchmark quality · latency reduction · queries handled per GPU · model quality loss under pruning · ranking calibration under quantization

3 supporting quotes
“we actually show the gap between our model and the production models uh on the users that have few uh interactions”transcript, stated
“these are four different tasks and these tasks are completely out of domain.”transcript, stated
“the answer overall is having a very comprehensive benchmarking set. We have something around like 50 to 60 benchmarking.”transcript, stated

Outcomes

The transcript reports a 150B teacher, production-sized 3B models, candidate groups up to 500 items, high-QPS recommendation serving, roughly 400-500 ms latency targets, 7x latency reduction, 30x throughput improvement per GPU, and around 50-60 benchmark sets.

3 supporting quotes
“it can actually uh be on par or even beat uh some of the um the production models”transcript, stated
“we were able to reduce the latency by 7x and at the same time increasing the throughput”transcript, stated
“everything else just by click button happens end to end. Uh so I think uh automation is the key”transcript, stated