Skip to main content

Real architecture · Senior

LinkedIn feed (two passes, dwell time, LLM in 2026)

Real production architecture. Key points: first pass/second pass, dwell time, and multi-objective.

17 min read · Content reviewed on October 23, 2026

Short answer

Real production architecture. Key points: first pass/second pass, dwell time, and multi-objective. LinkedIn's Feed serves more than 1.3 billion professionals. The challenge the company describes is balancing content from the member's network, from the people they follow and from the Economic Graph more broadly, that is, suggested content.

01 · CONTEXT AND SCALE

What the feed needs to decide

LinkedIn's Feed serves more than 1.3 billion professionals. The challenge the company describes is balancing content from the member's network, from the people they follow and from the Economic Graph more broadly, that is, suggested content.

A 2026 engineering post states that the company ranks millions of posts at any given moment, balancing freshness and relevance. A 2020 post already talked about tens of thousands of candidate posts that could appear in a member's feed.

In 2020, the post describes a candidate generation layer, the first pass, which applies an efficient, lightweight ranking algorithm to identify the best candidates. In 2026, the company describes the split this way: retrieval determines which posts reach the ranking stage, and ranking determines what the member actually sees.

02 · THE CLASSIC FEED

Weighted scoring and the limit of clicks

The 2020 post trains machine learning models to predict several quantities for each possible click and viral action. The actions are clicking, reacting, commenting and sharing, and the company calls reacting, commenting and resharing viral actions. The quantities are the probability that the member performs the action and, if they do, the expected number of downstream clicks or viral actions and the expected upstream value for the post's creator.

The model outputs are synthesized into a single score by a weighted linear combination, and that score is used for a ranqueamento point-wise ranking of all candidates.

The same post points out limits of click and viral-action signals. They can be rare, especially for passive consumers of the feed, and the click is a noisy indicator of engagement: a member may click on an article, realize it is not relevant and return to the feed within seconds. To compensate for some of these limits, the team evaluated dwell time aggregated per post.

AspectoClicks and viral actionsDwell time
DisponibilidadeNot always measurableAlways measurable
Signal typeBinary indicator of engagementReal-valued measure of engagement
Signal qualityNoisy indicator of engagement; positive signals are quite sparseCan be a more reliable indicator of engagement; there is no scarcity of signals

03 · DWELL TIME AND P(SKIP)

From dwell time to the probability of skipping

Each post seen in the feed generates two kinds of dwell time. The first, in the feed, starts being measured when at least half of the post is visible while the member scrolls the feed. The second, after the click, is the time spent on the content after clicking a post in the feed.

When analyzing per-post dwell time on mobile, the team looked for a threshold, called Tskip, to classify a post viewed for less than Tskip seconds as skipped. The post reports that this natural threshold exists and that the same Tskip value worked for all the heterogeneous post types, such as text, images and videos.

Based on this, the team added a new objective to the feed's value function, P(skip), which predicts the probability that the member skips a post. The model is a logistic regression with raw features and interaction features learned by a boosted decision tree. Because skipping is considered a negative outcome, the final function lowers the score of all posts proportionally to the predicted P(skip).

  1. The candidate generation layer applies an efficient, lightweight ranking algorithm to identify the best candidates to show.

    Architecture diagram: Classic feed: first pass and scoring
    CLMember in the app
    CPCandidate generation (first pass)first pass
    CPPrediction models
    CPValue function and ordering
  2. The candidates move on to the prediction models, which estimate the probability of the action, the expected downstream effect and the expected upstream value.

    Architecture diagram: Classic feed: first pass and scoring
    CLMember in the app
    CPCandidate generation (first pass)
    CPPrediction modelsper-action predictions
    CPValue function and ordering
  3. The new objective, P(skip), enters the feed's value function and predicts the probability that the member skips the post.

    Architecture diagram: Classic feed: first pass and scoring
    CLMember in the app
    CPCandidate generation (first pass)
    CPPrediction modelsP(skip)
    CPValue function and ordering
  4. The value function synthesizes the outputs into a single score by a weighted linear combination and lowers the score proportionally to the predicted P(skip).

    Architecture diagram: Classic feed: first pass and scoring
    CLMember in the app
    CPCandidate generation (first pass)
    CPPrediction models
    CPValue function and orderingsingle score
  5. The score is used to order all candidates point-wise.

    Architecture diagram: Classic feed: first pass and scoring
    CLMember in the app
    CPCandidate generation (first pass)
    CPPrediction models
    CPValue function and orderingordering

In online A/B experiments with a small percentage of members, the company reports a large drop in the number of skipped posts and more interaction through clicks and viral actions.

04 · UNIFIED RETRIEVAL

A single LLM-based retrieval

According to the 2026 post, the traditional approach used several retrieval sources, such as trending content, collaborative filtering and embedding-based systems, each with its own infrastructure. This created engineering complexity and made holistic optimization difficult. The ranking model, in turn, treated each impression independently and lost sequential consumption patterns.

The solution combines a unified retrieval, which uses LLMs to generate a high-quality representation of members and content, with a sequential ranking model that captures how professionals interact with content over time. One benefit cited is cold-start: for a new member with only a title and job role in their profile, the LLM can infer likely interests without waiting for engagement history to accumulate.

For the LLM to process structured data, the team built a prompt library that turns features into standardized sequences. For numeric features, engagement counts initially went in raw and the model treated them as ordinary text tokens, which left the correlation between item popularity and cosine similarity close to zero (-0.004). The team split the counts into percentile buckets, wrapped in special tokens, and the correlation rose 30x, with a 15% improvement in recall@10.

The retriever is a dual encoder: an LLM processes the member and item prompts and generates embeddings compared by cosine similarity. In training, each positive pair is contrasted with two kinds of negatives.

Negative typeHow it is obtainedReported effect
EasyRandomly sampled posts that were not shown to the memberWeak but stable contrastive signals
HardPosts shown to the member that received no engagementAdding just two per member improved recall by +3.6%

Another point was curating the member's history. Initially it included all posts shown, and this hurt performance and cost more compute, since GPU computation is quadratic in context size. Filtering to only posts with positive engagement made the model learn better. In the production setup, with 8 H100 GPUs for training, this brought a 37% reduction in memory per sequence with equivalent history depth and a 2.6× faster training iteration, due to smaller sequences and better batching efficiency.

05 · FRESHNESS WITH NEARLINE PIPELINES

Fresh embeddings without waiting for the batch

The company maintains three pipelines running continuously in nearline: prompt generation, embedding inference and index update. Decoupling the system this way allows optimizing each stage independently and keeping the end-to-end system fresh within minutes.

  1. When a post is published or gains engagement, the item prompt is updated; when the member updates their profile or interacts, the member prompt is updated.

    Architecture diagram: Feed: nearline embedding pipelines
    CLMembers and creators
    CPPrompt generationupdates prompts
    DBPrompt key-value store
    CPNearline stream processor
    CPEmbedding inference (LLM on GPU)
    CPGPU embedding index
  2. The prompts go to key-value stores, for online access in retrieval, and at the same time to a nearline stream processor that generates embeddings.

    Architecture diagram: Feed: nearline embedding pipelines
    CLMembers and creators
    CPPrompt generation
    DBPrompt key-value storestored prompts
    CPNearline stream processor
    CPEmbedding inference (LLM on GPU)
    CPGPU embedding index
  3. The fresh prompts go through LLM inference servers in GPU clusters.

    Architecture diagram: Feed: nearline embedding pipelines
    CLMembers and creators
    CPPrompt generation
    DBPrompt key-value store
    CPNearline stream processor
    CPEmbedding inference (LLM on GPU)inference
    CPGPU embedding index
  4. New posts get embeddings in near real time, and posts that gain engagement have their embeddings updated.

    Architecture diagram: Feed: nearline embedding pipelines
    CLMembers and creators
    CPPrompt generation
    DBPrompt key-value store
    CPNearline stream processor
    CPEmbedding inference (LLM on GPU)fresh embeddings
    CPGPU embedding index
  5. Updates are grouped into configurable time windows, trading GPU efficiency for embedding freshness.

    Architecture diagram: Feed: nearline embedding pipelines
    CLMembers and creators
    CPPrompt generation
    DBPrompt key-value store
    CPNearline stream processor
    CPEmbedding inference (LLM on GPU)configurable window
    CPGPU embedding index
  6. The embeddings go into a specialized index for exhaustive nearest-neighbor search on GPUs.

    Architecture diagram: Feed: nearline embedding pipelines
    CLMembers and creators
    CPPrompt generation
    DBPrompt key-value store
    CPNearline stream processor
    CPEmbedding inference (LLM on GPU)
    CPGPU embedding indexupdated index

At query time, the system fetches the member's embedding and runs a k-nearest-neighbor search on this index, retrieving the best candidates in under 50 ms, even with millions of posts in the index.

The company also describes a gain for ranking: instead of candidates from disparate sources, with different biases and quality profiles, it receives a coherent set of candidates selected by semantic similarity. The company states that replacing several sources with a single embedding-based approach reduced engineering complexity.

06 · SEQUENTIAL RANKING

A sequence model and the cost of serving it

For ranking, the company built the Generative Recommender (GR), which treats the member's interaction history as a sequence. Instead of scoring each post in isolation, the GR processes more than a thousand historical interactions to understand temporal patterns and long-term interests.

The GR uses transformers with causal attention, processing posts in chronological order along with the member's actions on each post. Actions, such as long dwells, likes, comments and shares, are embedded and interleaved with the post representations. In causal attention, each position only attends to earlier positions.

After the transformer layers, the model applies late fusion: it concatenates the transformer output with per-step context features, such as device type, member profile embeddings and aggregated counts and affinities. According to the post, including these features in the sequence path would inflate the computational cost without clear benefit. The result goes through a Multi-gate Mixture-of-Experts (MMoE) prediction head, in which passive tasks (click, skip, long-dwell) and active tasks (like, comment, share) get specialized gates and share the same sequential representations.

AspectoPrevious rankingSequential ranking (GR)
Unit evaluatedEach impression treated independentlyInteraction history treated as a sequence
Combining objectivesModel outputs synthesized into a single score by a weighted linear combination (2020 description)MMoE head with per-task gates over shared representations
HardwareHistorical ranking models ran on CPUsHuge parameter counts require high-bandwidth memory, available only on GPUs

The post reminds us that GPUs are expensive and that cost per inference becomes critical at this scale. The following diagram walks through the online path and the serving choices described by the company.

  1. When the feed opens, the system fetches the member's embedding and runs the nearest-neighbor search.

    Architecture diagram: Feed: GPU retrieval and ranking
    CLMember in the app
    CPRetrievalmember embedding
    CPGPU embedding index
    CPFeature processing (CPU)
    CPGR inference (GPU)
  2. The GPU index returns the best candidates in under 50 ms, even with millions of posts.

    Architecture diagram: Feed: GPU retrieval and ranking
    CLMember in the app
    CPRetrieval
    CPGPU embedding indexcandidatos
    CPFeature processing (CPU)
    CPGR inference (GPU)
  3. Retrieval determines which posts reach the ranking stage.

    Architecture diagram: Feed: GPU retrieval and ranking
    CLMember in the app
    CPRetrieval
    CPGPU embedding index
    CPFeature processing (CPU)enter ranking
    CPGR inference (GPU)
  4. The disaggregated architecture separates feature processing, which is CPU-bound, from model inference, which is GPU-heavy.

    Architecture diagram: Feed: GPU retrieval and ranking
    CLMember in the app
    CPRetrieval
    CPGPU embedding index
    CPFeature processing (CPU)CPU
    CPGR inference (GPU)GPU
  5. The batched shared context computes the history representation once and scores all candidates in parallel with custom attention masks.

    Architecture diagram: Feed: GPU retrieval and ranking
    CLMember in the app
    CPRetrieval
    CPGPU embedding index
    CPFeature processing (CPU)
    CPGR inference (GPU)history once
  6. GRMIS, a custom Flash Attention variant, delivers an additional 2× gain over PyTorch's standard attention.

    Architecture diagram: Feed: GPU retrieval and ranking
    CLMember in the app
    CPRetrieval
    CPGPU embedding index
    CPFeature processing (CPU)
    CPGR inference (GPU)custom attention

07 · WHAT TO TAKE TO THE INTERVIEW

Decisions the case teaches

Frequently asked questions

What is LinkedIn feed (two passes, dwell time, LLM in 2026)?

Real production architecture. Key points: first pass/second pass, dwell time, and multi-objective.

What does the LinkedIn feed (two passes, dwell time, LLM in 2026) design cover?

It is organized in these sections: What the feed needs to decide, Weighted scoring and the limit of clicks, From dwell time to the probability of skipping, A single LLM-based retrieval, Fresh embeddings without waiting for the batch, and A sequence model and the cost of serving it.

How long is LinkedIn feed (two passes, dwell time, LLM in 2026) and what level is it?

It takes about 17 minutes to read and is rated Senior level.

Now design it yourself

Run this case as an interview in the System Design school: you make the decisions, the tutor challenges them and you see how your design scores.