Recommender Systems — Sr Staff edition

A course-level reference for the 2026 interview loop. Built for an experienced RecSys engineer who needs to articulate the field crisply enough to clear Pinterest / DoorDash / Reddit / TikTok / Snap / Anthropic / Databricks Sr Staff bars. The depth here is what you should be able to say out loud at a whiteboard, not what you read off a slide.

Part 1 — RecSys architecture

1.1 The canonical funnel

Every large-scale recommender — YouTube, Instagram, TikTok, Pinterest, DoorDash, Spotify, Reddit — has the same shape. You start with hundreds of millions to billions of candidate items and you have ~50–200ms end-to-end to return a sorted list of 10–50 to the user. You cannot run a deep model over 1B items per request, so you build a cascade of progressively more expensive models over progressively smaller candidate sets.

Corpus ~1B items Retrieval (multi-source) ~10k candidates · ~10 ms · cheap Ranking (deep model) ~500 scored · ~30 ms · DLRM/HSTU Re-ranking + policy ~10 shown · ~5 ms · diversity, business rules
The cascade. Each stage discards 10–100x more items but spends 3–10x more compute per surviving item.

Latency budget — typical

StageP99 budgetCompute per requestWhy this budget
Request decode + auth5 msEdge layer, GeoDNS routing
User-context fetch10 msKV readsUser embedding, recent history, last 100 events
Retrieval (parallel)10–20 msANN over millionsMultiple sources hit in parallel; slowest dominates
Feature hydration10–15 msBulk KV / online storeItem embeddings + counters for ~10k candidates
Ranking inference20–40 ms1 GPU forward / batch of ~500Deep model, multi-task heads
Re-rank + policy5 msMMR, frequency caps, business rules
Total P99~150 msBeyond this users feel jank on a feed scroll
Sr Staff framing
The funnel exists for two reasons: (1) compute economics — you cannot afford to run DLRM over 1B items, and (2) latency — even if you could, it wouldn't fit in 100ms. Anyone proposing a one-shot model needs to defend both. In 2024–2025, generative recommenders (HSTU, TIGER) start to compress the funnel because a single transformer can do retrieval and ranking jointly, but only at moderate corpora (≤ 10M items) or with semantic-ID quantization.

1.2 Retrieval / candidate generation

Retrieval is responsible for recall. It does not need to score perfectly — it just needs to ensure the truly relevant items are among the ~10k passed to ranking. Modern systems run multiple retrieval sources in parallel and union them: collaborative, content, social, geo, freshness, exploration. Each source is allowed to be biased; the union is what matters.

Two-tower (DSSM)

The dominant architecture. A user encoder consumes user features (id embedding, recent history sequence, demographics, context) and produces a vector u ∈ ℝd. An item encoder consumes item features (id embedding, content embeddings, taxonomy) and produces v ∈ ℝd. Score = ⟨u, v⟩ (or cosine). Trained with sampled-softmax or in-batch negatives so item encoder can be precomputed offline and indexed in an ANN. Only the user tower runs at request time.

user_id, history, ctx, demog embedding lookup + concat MLP / Transformer pool u ∈ ℝᵈ computed online, per request item_id, text, image, taxonomy embedding lookup + concat MLP / pool v ∈ ℝᵈ precomputed, indexed in HNSW ⟨u, v⟩ score
Two-tower / DSSM. The asymmetry is the entire point: item embeddings are precomputed and indexed; only the user tower runs online.

Why two-tower wins for retrieval but not for ranking: a dot product cannot model feature crosses across user × item (e.g. "user from SF × restaurant in SF" gets the same score as "user from SF × restaurant in NYC" if those interaction features aren't in the encoders). For retrieval, this is acceptable because ranking will fix it. For ranking, it's a dealbreaker.

Negative sampling — the central question of two-tower training

Item-to-item collaborative filtering

Classical: build a co-occurrence matrix from sessions, normalize (cosine, Jaccard, or PMI), and serve "items frequently watched after X." Old but still extremely strong for fresh sessions and cold users where you have one anchor item. Amazon's "customers who bought this also bought" was item-item CF. Today usually combined with neural retrieval, not replaced.

Matrix factorization (ALS)

Decompose user–item interaction matrix R ≈ U VT. Implicit-feedback ALS treats observed interactions as confidence-weighted positives, all others as low-confidence zeros. Closed-form per-user/per-item updates make it embarrassingly parallelizable on Spark. Limitation: shallow, no side features (without extensions like LightFM).

Graph-based retrieval — PinSAGE, GraphSAGE, LightGCN

Treat the user–item bipartite graph (and optionally item–item co-engagement graph) as the substrate. Aggregate features from a node's neighborhood with learned weights. PinSAGE scaled this to ~3B node graphs at Pinterest by sampling neighborhoods with random walks. LightGCN strips out non-linearities and feature transforms — just iterative neighborhood averaging — and matches/exceeds heavier GCNs on retrieval benchmarks because in collab-filtering the embedding propagation is what matters, not the MLP.

Users Items u (target) Layer-k aggregation sample 50 item neighbors of u for each, sample 50 user neighbors aggregate (mean / attention) project + ReLU + L2 normalize u embedding (k-hop) PinSAGE: 2 hops, 50/50 fanout, MapReduce-friendly
Bipartite user–item graph + neighborhood aggregation. PinSAGE runs this offline in MapReduce to materialize all 3B node embeddings.

Sequential models for retrieval — SASRec, BERT4Rec

Treat a user's interaction history as a sequence and use a transformer to predict the next item. SASRec uses causal attention (predict next from prefix); BERT4Rec uses bidirectional masked-item modeling. The "user representation" is the encoder output at the last position. The item embeddings are the input/output embedding table. Retrieval = top-K of WitemT · hlast.

Generative retrieval — TIGER, RecGPT

The newest paradigm. Items are tokenized into semantic IDs (a short tuple of discrete codes from an RQ-VAE trained on item content embeddings), then a transformer is trained to autoregressively generate the semantic ID of the next item. Retrieval becomes beam search. Strengths: generalizes to cold items (because the semantic ID is content-derived), shares parameters across items, can scale with model size. Weaknesses: beam search is slower than ANN; semantic IDs need re-training as the corpus drifts.

Mixed retrieval — the production pattern

No top-tier system uses one retrieval source. A typical Sr Staff answer:

Total ~5–10k candidates after dedup, all hydrated and passed to ranking. The diversity of sources is itself a debias mechanism — if your only retrieval is two-tower, popularity bias compounds.

1.3 ANN serving

Once you have item embeddings indexed, retrieval is "given query vector q, return top-K nearest neighbors by inner product or cosine." Exact NN is O(N·d) per query — for N=100M, d=128, that's 12.8B FLOPs per request. Approximate methods get you 100–1000x speedup with <1% recall loss.

HNSW (Hierarchical Navigable Small World)

A multi-layer proximity graph. Top layers are sparse (long-range links); bottom layer contains all points. Search starts at the top entry point, greedily descends by following edges to the closest neighbor of the query, then drops to the next layer. At the bottom layer, performs a beam search of width efSearch.

Layer 2 (sparse) Layer 1 Layer 0 (all points) Query path: top entry → greedy descent → beam search at L0
HNSW: orange-ringed nodes mark a single query's traversal. Sparse top layers act like skip pointers; dense bottom layer contains all data.

Key parameters and how they trade off:

IVF-PQ (Inverted File + Product Quantization)

Two-stage lossy compression:

  1. IVF (coarse). Cluster all vectors into nlist centroids (k-means). At query time, find the nprobe nearest centroids and only search items in those Voronoi cells.
  2. PQ (fine). Split each d-dim vector into m sub-vectors, run k-means with K=256 on each sub-space. Each item is now stored as m bytes (one cluster ID per sub-space). Distances are computed via precomputed lookup tables — extremely cache-friendly.
IVF coarse: Voronoi cells ★ query, ringed = nprobe=4 nearest cells visited PQ: split d-dim into m subspaces d=128 vector d=32 d=32 d=32 d=32 k-means on each subspace, K=256 c₁ c₂ c₃ c₄ item stored as 4 bytes (one ID per subspace) d=128 × 4 bytes = 512 B → 4 B = 128× compression distances precomputed via lookup table per query
IVF + PQ. IVF cuts the search space; PQ compresses each vector to a few bytes. The combo lets you fit 1B × 128-dim vectors in < 8 GB.

HNSW vs IVF-PQ — when to pick which

HNSWIVF-PQ
Recall@10 (typical)0.95–0.990.85–0.95 (with refinement: 0.97)
MemoryFull vectors + graph (large)Few bytes per item (small)
Latency~1 ms / query, very flat~3–5 ms, depends on nprobe
Build timeHours for 100MMinutes (k-means dominates)
UpdatesInsert/delete supported but degradesEasy to add to IVF cells
Sweet spot≤ 100M items, low-latency, plenty RAM≥ 1B items, GPU/disk-bound, OK with slight recall loss

Other notable systems

Filtering / hybrid search — the painful problem

Real recsys queries always have filters: "in stock," "shippable to my zip," "not blocked by user," "language=en." How to combine filters with ANN is non-obvious:

1.4 Ranking

The ranking stage scores each candidate from retrieval. Unlike retrieval, ranking can use rich user×item interaction features and deep architectures because the candidate set is small (~hundreds to a few thousand). Sr Staff interviews go deep here — be ready to defend choices about loss, architecture, multi-task structure, and calibration.

Loss formulations

In practice, a Sr Staff answer is: pointwise BCE for the underlying probability heads (with calibration) plus a pairwise auxiliary loss when the metric you care about is ordering and your data is heavily implicit. For multi-task (CTR, like, share, completion), pointwise BCE per task with shared bottom is the baseline.

Deep ranking architectures — the 10-year lineage

Industrial CTR/CVR rankers all face the same problem: learn high-order feature interactions over hundreds of sparse + dense features at sub-50ms inference. Below is the lineage of architectures that have led the field, with the architectural trick that distinguishes each.

Wide & Deep (Cheng, Google DLRS 2016). Linear/cross-feature "wide" arm + DNN "deep" arm. Wide handles memorization (specific user×item co-occurrence indicators that need exact match); deep handles generalization (embedding lookups + MLP). Trained jointly with one log-loss. The "wide" arm is FTRL-Proximal optimizer (handles billions of sparse weights cheaply); the "deep" arm is AdaGrad. Production at Google Play store. Still a useful mental model for "what features go where" — even today the wide arm is the right place to encode hard business rules ("this category never recommends to under-13 users").

DeepFM (Guo et al., IJCAI 2017). Replaces Wide&Deep's linear arm with an explicit 2nd-order Factorization Machine (FM) interaction over the same embedding table as the deep arm. So each feature has one embedding, used both for FM dot-products (interaction features) and for MLP input (general non-linear features). End-to-end trainable. Beats Wide&Deep on most benchmarks because the FM captures pairwise interactions automatically (no manual cross-feature engineering needed).

DCN — Deep & Cross Network (Wang, ADKDD 2017). Replaces FM's 2nd-order interactions with a cross network that learns polynomial interactions of arbitrary degree. Layer $l$: $x_{l+1} = x_0 \cdot x_l^\top \cdot w_l + b_l + x_l$ — every layer multiplies the original input by the running state plus a residual. $L$ layers give up to degree-$(L+1)$ polynomial interactions. Parameter count is linear in feature count (vs FM's quadratic). Used at Google Search ads.

DCN-V2 (Wang, WWW 2021). Improves on DCN by replacing the vector $w_l$ with a low-rank matrix $W_l = U_l V_l^\top$ which gives much more expressivity per layer without quadratic parameter blow-up. The cross is now $x_{l+1} = x_0 \odot (W_l x_l + b_l) + x_l$. DCN-V2 was the production CTR ranker at Google for years, beating MLPs by ~0.3% AUC on ads data — small numbers, huge dollar value.

AutoInt (Song, CIKM 2019). Stacks multi-head self-attention over the feature embeddings to learn arbitrary feature interactions. Each feature embedding is a "token"; attention weights between tokens capture interaction strength. Heavier than DCN-V2; tends to win on benchmarks with many text-derived features and lose on benchmarks dominated by ID features (where DCN-V2's polynomial form is more parameter-efficient).

xDeepFM / CIN (Lian, KDD 2018). The Compressed Interaction Network (CIN) explicitly enumerates 2nd, 3rd, ..., k-th order interactions via outer-product feature maps compressed by a learned matrix. More expressive than DCN at the same depth but more parameters. Production at Microsoft Bing for some time; less popular post-DCN-V2.

DLRM (Naumov, Meta 2019). The reference Meta architecture for years. Sparse features (id-types) → embedding tables; dense features → bottom MLP; pairwise dot products of all (sparse_emb, dense_proj) pairs → top MLP → logits. The dot-product interaction is the inductive bias that captures "this user × this item × this context" — strictly 2nd-order over learned embedding space. DLRM-V2 (2021) scaled this 10× via TorchRec and tighter ZeRO-style sharding. Replaced by HSTU at Meta ranking in 2024 but still the reference benchmark every recsys paper cites.

MaskNet (Wang, ByteDance 2021). The ByteDance CTR ranker. Insight: feature embeddings are not equally important per instance — a query about "shoes" should down-weight the "country" embedding and up-weight "size." MaskNet adds instance-guided masks: an auxiliary MLP outputs a per-feature mask vector $M(x)$ that element-wise multiplies into the feature embedding before the main DNN. Two variants: serial MaskNet (mask applied once at input) and parallel MaskNet (mask applied at every layer). Beats DCN-V2 by ~0.2% AUC on Criteo benchmark and substantially on ByteDance internal data; powers TikTok-class CTR models.

FinalMLP / FinalNet (Mao, AAAI 2023). The architectural surprise of 2023: a pure two-stream MLP, with one stream applying feature-gating and the other applying feature-aware bilinear interactions, beats DCN-V2 / xDeepFM / AutoInt on every benchmark. The lesson is humbling: feature-aware non-linearity matters more than explicit polynomial-feature-crossing structure. The result has caused a small re-evaluation of whether explicit cross-networks are still worth their complexity.

Wukong — RecSys scaling laws via stacked FM blocks (Zhang, Meta 2024). The most important deep-ranking paper of 2024. Architecture: stacks of FMB (Factorization Machine Block) + LCB (Linear Compressed Block) with residual connections. FMB does a compressed factorization-machine-style interaction; LCB applies linear projection for dimensionality compression. Stacking N of these gives a controllable-depth interaction model. The breakthrough: Wukong exhibits clean scaling laws on industrial recsys data — loss decreases as a power law in compute and parameters. This is the first paper to convincingly show recsys obeys LLM-style scaling laws in the deep-ranker (non-sequence) setting. Production at Meta as the dense-feature-interaction backbone for HSTU. Cite this paper when an interviewer asks "do scaling laws apply to recsys?"

FuxiCTR benchmark (Zhu, FuxiCTR). The standard benchmark for comparing these architectures. Reports AUC and Logloss across Criteo, Avazu, Movielens. When an interviewer says "have you read X paper?" knowing FuxiCTR-published numbers is the next level — you can immediately say "yes, on Criteo it's 0.814 AUC vs DCN-V2's 0.812 — small numbers but consistent."

Comparison table — deep-ranking architectures

ArchitectureYearInteraction orderParameter costWhere deployed
Wide & Deep20161 (linear arm)Linear in featuresGoogle Play (historical)
DeepFM20172nd (FM)Linear in featuresHuawei AppGallery
DCN-V22020L-degree polynomialLinear × low-rankGoogle Ads (historical leader)
AutoInt2019Arbitrary (self-attn)Quadratic in featuresVarious academic
DLRM20192nd (pairwise dot)Dominated by embedding tablesMeta Reels / IG / FB Feed (historical, replaced by HSTU 2024)
MaskNet2021Instance-guided gatingLinearByteDance / TikTok
FinalMLP2023Two-stream MLPLinearVarious
Wukong2024Stacked FM, scaling-lawTunable via N stacksMeta (with HSTU)
HSTU2024Generative sequenceScaling-law tunableMeta ranking
Sparse (categorical) user item creator topic e₁ e₂ e₃ e₄ Dense (continuous) age, ctr, recency, price ... bottom MLP → e_dense Pairwise dot products: ⟨eᵢ, eⱼ⟩ for all i < j + e_dense ≈ C(k+1, 2) interaction terms, captures user×item×creator etc. top MLP: 1024 → 512 → 256 → ... p(click) p(like) p(share) p(complete) final ranking score = w₁·p(click) + w₂·p(like) + ... (calibrated combination)
DLRM. Sparse features get id embeddings; dense get an MLP projection; all pairs get dot-producted; top MLP produces multi-task heads.

Multi-task learning — Shared Bottom, MMoE, CGC/PLE

Real systems optimize multiple objectives jointly: click, like, share, watch-time, complete, follow, hide. Three architectures dominate:

shared input embedding N experts (each an MLP) Expert 1 Expert 2 Expert 3 Expert 4 Expert 5 Per-task gates (softmax over experts) gate_click gate_like gate_share click tower like tower share tower p(click) p(like) p(share) Each task picks its own mixture of experts → tasks can specialize without blowing up params
MMoE. Each task has its own gating network selecting a soft mixture of shared experts.

Why MMoE outperforms shared-bottom (the interview answer)

In shared-bottom, all tasks must compromise on a single trunk representation. If two tasks have negatively correlated labels (e.g. "fast click" vs "long watch"), their gradients destructively interfere and the trunk learns a weak average. In MMoE, each task routes to a different mixture of experts; the negative correlation can be expressed as the two tasks attending to different experts, and gradients no longer fight at the parameter level. Empirically this shows up most strongly when tasks have different positive rates (e.g. click 5% vs share 0.1%) and different feature dependencies — exactly the regime feed ranking lives in.

Multi-objective combination

You have p(click), p(like), p(share), p(complete), p(follow). What do you optimize? Three approaches:

Calibration

Critical when scores feed into auctions (ads), bid shading, or business rules expecting probabilities. Multi-task models are systematically miscalibrated because:

Common fixes: Platt scaling (logistic regression on top of logits, fit on holdout), isotonic regression (non-parametric monotonic mapping, more flexible but needs more data), temperature scaling (one scalar T fit to minimize NLL — under-fits but stable). For multi-task, calibrate each head separately, then combine. Track ECE (Expected Calibration Error) and reliability diagrams in dashboards.

1.5 Sequence-aware ranking — the deepest area of 2023–2026 RecSys research

The single biggest accuracy lift in modern recsys, beyond going deep, has been treating user history as a sequence with attention rather than a bag of average-pooled embeddings. The progression has gone: bag-of-items → RNN over history → target-attention (DIN) → transformer (BST) → long-sequence with two-stage retrieval (SIM, TWIN) → lifetime modeling with hierarchical clustering (TWIN-V2) → fully generative formulation (HSTU). Every interviewer at Meta, Kuaishou, TikTok, Pinterest, or Alibaba will probe at least three of these by name.

DIN — Deep Interest Network (Alibaba, KDD 2018)

arxiv 1706.06978. Idea: not all of a user's history is relevant to the current candidate. For target item v with embedding $e_v$ and history items $\{e_{u_1},\ldots,e_{u_T}\}$, compute attention weights $a_t = \mathrm{MLP}([e_{u_t}, e_v, e_{u_t} \odot e_v, e_{u_t} - e_v])$ (the element-wise product and difference are essential — they expose interaction signal to the MLP) then the user-interest representation given target is $u_v = \sum_t a_t \cdot e_{u_t}$. Solves a real production problem: users with broad interests had their representation diluted under sum/mean pooling. Production at Alibaba display advertising; the original paper reports +1.1% offline AUC over GBDT and substantial online RPM gain. Also introduced Dice activation (a data-adaptive variant of PReLU) and mini-batch aware regularization for sparse-feature L2.

DIEN — Deep Interest Evolution Network (Alibaba, AAAI 2019)

arxiv 1809.03672. Two-layer architecture on top of the history: (1) Interest Extractor — GRU over the click sequence to capture temporal hidden states $h_t$; (2) Interest Evolving Layer — AUGRU (GRU with attention-weighted update gate, where the attention weight is computed against the candidate item) so the evolution is target-conditioned. Adds an auxiliary loss at each timestep predicting the next click (essentially next-item prediction) which reportedly improves the hidden-state quality substantially. Handles "user moved from electronics to home goods last week" gracefully. By 2020 DIN/DIEN was the dominant production architecture for sequence-aware ranking in Chinese e-commerce.

BST — Behavior Sequence Transformer (Alibaba, DLP-KDD 2019)

arxiv 1905.06874. Replaces the GRU stack with a transformer encoder over the recent history (typically last 50–100 items). Each item position uses a learned positional embedding (relative time-since-now). The transformer output at the candidate-item position is concatenated with the static features and fed to the deep ranker MLP. By 2019 this was the dominant architecture for sequence-aware ranking; the rest of the field has spent 2020–2026 figuring out how to extend it to much longer sequences.

SIM — Search-based Interest Model (Alibaba/Pi, CIKM 2020)

arxiv 2006.05639. The first paper to convincingly tackle long-sequence (1K–10K item) user histories. The problem: target-attention over 10K items at serving time costs ~10K × d dot products per user per request, which is prohibitive. SIM splits into two stages:

This is the canonical two-stage long-sequence pattern, copied by every Chinese platform afterward. Online at Alibaba: +7.1% CTR over DIN baseline at 1K-length sequence. Critical interview point: the GSU's embedding space is not the same as the ESU's embedding space — they're trained separately — which causes embedding inconsistency that the next generation of models (TWIN) directly fixes.

ETA — End-to-end Target Attention (Alibaba, 2022)

arxiv 2108.04468. Replaces SIM's GSU with SimHash LSH so the coarse search becomes sub-linear in sequence length. Each history-item embedding gets a binary hash code (sign of random projection); target hashes to the same code; Hamming-distance filter yields candidates in $O(T)$ but with very small per-item cost. Co-trains the hash projection with the ranker so the hash bits are accuracy-aware. ETA hits 5K-length sequences in production with similar accuracy to SIM.

SDIM — Sample-based Deep Interest Model (Alibaba, 2022)

arxiv 2205.10249. Another long-sequence approach: hash history items into the same bucket as the target via SimHash, then average-pool within bucket. Sub-linear and collision-aware (uses multiple hash tables to control variance). Competitive with SIM/ETA at half the FLOPs.

CAN — Co-Action Network (Alibaba, KDD 2021)

arxiv 2011.05625. Tackles a different problem: capturing feature interactions with sequential structure. Each user-item pair generates an MLP whose weights come from a co-action unit; this gives orders of magnitude more expressivity per feature pair than a static dot product. Used at Alibaba alongside SIM. The interview-worthy line: "static feature interactions like DLRM can't capture history × target interaction at the depth a recsys needs; CAN gives every pair its own small network."

TWIN — Two-stage Interest Network (Kuaishou, KDD 2023)

arxiv 2302.02352. The Kuaishou breakthrough on long-sequence and arguably the most important industrial sequence paper of 2023. Insight: SIM's GSU and ESU use different embedding spaces, so the GSU's "relevance" is only a proxy for what ESU would actually score — top-K from GSU is not top-K under ESU. TWIN's fix:

Deployed at Kuaishou for short-video FYP ranking over sequences up to 100K items. The paper reports +1.6% Watch Time online over their prior long-sequence baseline. Interview signal: candidates who can explain why embedding consistency between stages matters (because GSU should approximate ESU's relevance, not some separate relevance function) — that's the bar-raising answer.

TWIN-V2 — Lifetime user behavior modeling (Kuaishou, 2024)

arxiv 2407.16357. Extends TWIN to lifetime sequences (think years of clicks per user — millions of items). Key idea: offline hierarchical clustering of each user's history into a tree (k-means at multiple levels), then online retrieval traverses the tree from root toward the leaves most relevant to the target. The GSU becomes "find the few cluster centroids that match target, descend into those subtrees, take their items as candidates"; the ESU runs over the few hundred surviving items. The hierarchy is rebuilt periodically (e.g., daily) offline; online updates only add new items. Production at Kuaishou for short-video; supports 10⁶-length user histories at single-digit ms GSU latency. The interview question this enables: "how would you do million-item user history?" — TWIN-V2 is the answer.

SASRec, BERT4Rec — the academic-canon sequence retrieval models

SASRec (Kang & McAuley, 2018): causal self-attention transformer trained on next-item prediction over user history. BERT4Rec (Sun et al., 2019): same backbone, trained with masked-item prediction (Cloze-style). Both produce strong item-sequence embeddings used heavily in academic benchmarks (MovieLens, Amazon Reviews). At industrial scale they're often frozen feature extractors feeding into the deep ranker — not the ranker itself — because ID-vocabulary issues and sparse-tail items break vanilla transformer training. A practical interview answer: "we use SASRec embeddings as one of many sequence-derived features fed into the DLRM/HSTU; we don't use vanilla SASRec end-to-end in production because of cold-start and freshness."

TransAct — Pinterest's Homefeed sequence ranker (KDD 2023)

arxiv 2306.00248. Pinterest's production sequence model. Combines a short-term transformer (last ~20 actions, captures session intent) with long-term features (aggregated stats over user history). The short-term transformer uses target-attention with action-type embeddings (save vs click vs hide vs close-up) injected at every token, so the model knows the kind of engagement that produced each history pin, not just the pin id. Online at Pinterest: +5.7% engagement on Homefeed at launch. The TransAct paper is one of the few public industrial deep-dives showing how to put a sequence transformer at ranking-tier latency budget (~60ms p99).

HSTU — Hierarchical Sequential Transduction Unit (Meta, ICML 2024)

arxiv 2402.17152 (Zhai et al.). Meta's flagship architecture, replacing DLRM at Reels/IG/Marketplace ranking. The most important industrial recsys paper of 2024. Key claims:

  1. Reformulates recommendation as generative sequence modeling. User-action sequence is tokenized as interleaved (item_id, action_type) tokens — so each token represents both "what was shown" and "what the user did." The transformer is trained to predict the next token (next item, or next action conditional on items).
  2. Custom HSTU attention. Replaces standard softmax-attention with a point-wise gated formulation: $\mathrm{HSTU}(Q,K,V) = \phi(Q K^\top) \odot \mathrm{Rel}(p) \cdot V$, where $\phi$ is a point-wise SiLU and $\mathrm{Rel}(p)$ is a learned relative-positional bias. No softmax — replaces the normalization with point-wise nonlinearity. This is the architectural surprise: it works, and it's faster (no softmax, no key-norm) at the same accuracy.
  3. Million-scale vocabulary handled via sharded embeddings across TorchRec — the same infra that powered DLRM extends naturally.
  4. M-FALCON inference: batched serving optimized for the gated-attention pattern. The paper reports 285× FLOP reduction at serving relative to the equivalent softmax-attention.
  5. Scaling laws. First industrial recsys paper to show clean scaling-law behavior: loss decreases as a power law in compute, parameters, and data. Meta has scaled HSTU to multi-trillion parameters.
  6. Production impact. The paper reports +12.4% E-Task and replaces DLRM at multiple Meta surfaces.

Interview probes: "why replace softmax with point-wise SiLU?" (answer: softmax saturates with very long sequences and the implicit normalization makes value-distribution sensitive to token count; a point-wise gating is more robust and shaves serving cost). "What does HSTU buy you that you couldn't get from stacking BST?" (scaling laws on industrial data, joint retrieval+ranking, generative formulation enables semantic-ID extensions).

MTGR — Meituan's adaptation of HSTU for sponsored search (2025)

arxiv 2505.18654. Meituan reproduced and adapted the HSTU recipe for sponsored search ranking and full-flow deployment. Notable for being the first non-Meta team to publish a working HSTU-class system at production scale. Reports +2.3% CTR over the existing DCN-V2-based ranker. The paper is candid about deployment cost (~3× FLOPs vs the prior ranker) and the engineering needed to fit HSTU in their serving stack. If you're interviewing at any non-Meta platform, this is the paper to mention as evidence that the recipe generalizes.

Comparison table — long-sequence sequence models

ModelYearMax sequenceWhere deployedGSU/ESU split
DIN2018~50Alibaba display ads
BST2019~100Alibaba
SIM2020~10KAlibabaYes, separate embeddings
ETA2022~5KAlibabaSimHash LSH
TWIN2023~100KKuaishou FYPYes, shared embeddings
TWIN-V22024~1M (lifetime)Kuaishou FYPHierarchical clustering
TransAct2023~20 + long-term featuresPinterest Homefeed
HSTU2024~10KMeta Reels/IG/MarketplaceGenerative joint retrieval+ranking
MTGR2025~10KMeituan sponsored searchHSTU-adapted

LLM-augmented (ReLLA, P5, M6-Rec, TallRec)

Use a pretrained LLM to encode item text/metadata and inject those embeddings into the ranker, or use the LLM directly as a reranker over the top-K. P5 (Geng 2022) reformulated all recommendation tasks as text-to-text. M6-Rec (Cui 2022) scaled this at Alibaba. TallRec (Bao 2023) showed LoRA-tuning a 7B LLM on user history can beat ID-based recsys at small scale. Status in 2026: helpful for cold-start and content-rich domains (news, e-commerce, podcasts) and for reranking the top 20–100 where latency budget is generous, but still too slow for top-of-funnel ranking at feed scale. The dominant production pattern is: traditional cascade does retrieval + first-pass ranking → LLM reranks the top 50.

1.6 Generative recommendation — the frontier any 2026 Sr Staff loop will probe

Three distinct generative families exist; conflating them is a fast way to fail an interview. (1) Semantic-ID generation (TIGER, RQ-VAE flavor): items are quantized to learned discrete codes, a decoder generates code sequences. (2) ID-token generation (HSTU flavor): item IDs are treated as a vocabulary, a decoder generates next ID directly. (3) Text generation (P5, TallRec, OneRec): an LLM-style decoder generates the item slug/title; either as text or constrained to known items via beam search. Know which family each paper sits in.

TIGER — Semantic IDs via RQ-VAE (Rajput et al., NeurIPS 2023)

arxiv 2305.05065. Pipeline:

  1. Train a content encoder (text + image, typically Sentence-T5 or CLIP) to produce dense item embeddings.
  2. Train an RQ-VAE (Residual Quantized VAE) to compress each item embedding into a tuple of $L$ codes (typically $L=4$, each code from a codebook of $K=256$ entries). The residual quantization is hierarchical: first codebook quantizes the item, the residual is quantized by the second codebook, etc. The result is the item's Semantic ID: semantically similar items share prefix codes.
  3. Train a vanilla T5-style transformer to autoregressively predict the next item's Semantic ID given the user's history of Semantic IDs.
  4. At serving, beam-search the top-K most likely Semantic IDs and look them up in a Semantic-ID → item table.

Why it matters: (a) generalizes to new items — their Semantic ID is computable from content with no interaction data, (b) the model size scales independently of corpus size (no per-item embedding row), (c) beam search controls retrieval and ranking jointly. The paper reports 14–34% Recall@5 gains on Amazon Reviews benchmark vs SASRec. Caveat for interviews: TIGER on academic benchmarks ≠ TIGER in production. Scaling Semantic IDs to billion-item corpora has known issues: codebook collapse (most items share a small set of codes), Semantic-ID drift when content drifts, and beam-search latency.

HSTU as a generative ranker (Meta, ICML 2024)

Covered architecturally in §1.5. The generative framing here: treat the user's interleaved (item, action) sequence as a sequence of vocabulary tokens, train next-token prediction, sample/score next items in the same forward pass. Retrieval and ranking are unified: the score $P(\text{next item} = v_i \mid \text{history})$ is the ranking score. This collapses the funnel from "retrieve top 500 then rank" to "score all candidate items with one model" — at HSTU's serving FLOPs that's now feasible on Meta-scale hardware. The 2024 paper is the first credible existence proof that the funnel can collapse for one of the top three platforms in the world.

OneRec — Kuaishou's end-to-end generative recsys (2024–2025)

OneRec arxiv 2402.10760. Kuaishou's production generative model for short-video. The most important generative-recsys paper after HSTU; deployed at Kuaishou serving 400M+ DAU. Key components:

Interview probes: "why does OneRec need a reward model — isn't next-item prediction enough?" (Answer: next-item prediction optimizes for what the existing system showed, which is already biased; the reward model lets you target a downstream business objective like long-term watch-time, off-policy from the data distribution.) "How does OneRec handle freshness?" (Encoder consumes recent history including very recent items; Semantic IDs of new items computable at upload; reward model retrained nightly.) "Compare OneRec vs HSTU." (Both generative, but HSTU uses ID tokens directly while OneRec uses learned Semantic IDs; OneRec adds explicit reward-model alignment; HSTU pioneered scaling laws while OneRec pioneered RLHF-style alignment for recsys.)

Other generative-rec systems worth knowing

The Sr Staff framing: "we are converging recommendation, search, and conversational interfaces into one autoregressive system because (a) Semantic IDs let us share parameters across tasks and across items, (b) scaling laws are starting to apply to recsys for the first time (HSTU, Wukong), and (c) the alignment toolkit from LLM post-training (reward models, DPO) transplants directly to recsys via OneRec. The 2026–2028 question is whether the existing cascade survives or collapses entirely."

Pros and cons vs traditional retrieval+ranking

GenerativeTraditional cascade
Cold-start itemsStrong — Semantic IDs from contentWeak — needs interaction data for embedding
Scaling with model sizeYes (HSTU shows scaling laws, Wukong confirms)Limited — sparse embeddings dominate
Retrieval latencyBeam search per request (~10–30ms)ANN sub-10ms
Ranking latencyJoint with retrieval30–60ms for fine ranker
ExplainabilityOpaque — only Semantic-ID lookupPer-source attribution
Filtering / business rulesHard to inject mid-generation; needs constrained decodingEasy — filter at ANN or post-rerank stage
Production maturity (2026)HSTU at Meta, OneRec at Kuaishou, MTGR at Meituan; rest researchStandard everywhere
Multi-objective optimizationVia reward model + DPO (OneRec)Via multi-task heads + weighted combination
FreshnessEasy at item level (new Semantic IDs); harder for modelReal-time learning solves this (Monolith)

The Sr Staff "is the cascade dead?" question

Expect this. Calibrated answer: "Not in 2026, but the next 2–3 years will tell. HSTU and OneRec have shown that generative formulations can replace one or two stages of the cascade at FAANG scale. But: (1) the cascade still wins on explainability and filterability — important for ads and policy; (2) cold-start interleaving with millions of new items per day is easier in the cascade because you can just add them to the ANN index; (3) generative models' beam-search latency hits a wall around 50–100ms which is the entire ranking budget on some surfaces; (4) the engineering cost of switching is enormous — Meta and Kuaishou are still running both. My bet: by 2028 the top 5 platforms have generative-first ranking, and the cascade survives for ads, long-tail platforms, and surfaces where filterability is constitutional."

1.7 Real-time learning systems — the freshness floor

For short-video, news, and any high-velocity catalog, model freshness is as critical as model quality. A recommender that learns yesterday's signals can't compete with one that learns the last 5 minutes. This is the engineering layer that powers TikTok, Kuaishou, and increasingly all the others.

Monolith — TikTok/ByteDance's collisionless real-time recsys (RecSys 2022)

arxiv 2209.07663. The most-cited real-time recsys infra paper. Two big innovations:

This is what powers TikTok FYP's per-minute freshness. Any TikTok / ByteDance interview will probe Monolith — they want to know if you understand why collisions matter (not just that they do).

Persia — Kuaishou + MSRA's hybrid sync/async PS (NeurIPS 2021)

arxiv 2111.05897. Scales to 100-trillion-parameter recsys models. Hybrid scheme: dense MLP layers train synchronously (low staleness, high accuracy) while sparse embedding tables train asynchronously (high throughput, tolerable staleness). Parameter server with worker-shard topology, all-to-all collective for the dense path, parameter-server pull/push for the sparse path. The paper's table of training-throughput numbers is widely cited; the key claim is that sync training of dense + async of sparse beats both fully-sync (too slow) and fully-async (degrades accuracy at large dense layers).

TorchRec + FBGEMM — Meta's recsys training stack

TorchRec paper (Ivchenko 2024). PyTorch-native; integrates with FSDP for the dense MLP path. Provides table-wise / row-wise / column-wise sharding for embedding tables, fused embedding-lookup kernels via FBGEMM (which is the FLOP-and-memory-optimized C++/CUDA library), and a "ShardingPlan" API that auto-suggests sharding based on table sizes and worker count. Production at Meta for DLRM, HSTU, Wukong. The reason TorchRec is competitive with the open-source TensorFlow ecosystem (which dominated 2018–2021 recsys) is that FBGEMM's quantized embedding ops are 2–4× faster than the cuBLAS equivalents for the small-batch, high-cardinality access patterns of recsys.

DeepRec, HugeCTR, EmbedX

Alibaba's DeepRec is TensorFlow-based with PS and async support; NVIDIA's HugeCTR / Merlin is GPU-first with hierarchical (HBM → host RAM → SSD) embedding storage; Tencent's EmbedX is graph-embedding-focused. Know that these exist as alternatives; in interview a one-line mention is enough unless the role is infra-heavy.

Feature stores and training–serving consistency

The classic recsys bug: feature definition diverges between offline training and online serving. Modern solutions: Feast, Tecton, in-house FAANG equivalents. Core idea: feature definitions are versioned code; online retrieval uses Redis/Cassandra with the same transformation logic; point-in-time joins at training so the feature value at training time matches what was logged at serving time. Without this, models silently train on values that don't match what they see live — debug-hostile, often the root cause when offline AUC doesn't translate to online win.

Streaming feature pipelines

Kafka → Flink → online store (Redis/RocksDB) → serving stack. Latency budget: feature value visible online within ~30 seconds of the underlying event. Flink job per feature; each job emits new feature values to the online store keyed by entity (user_id or item_id). The hard parts: schema evolution (old features in flight when you redeploy), exactly-once semantics for accounting features, and watermark handling for late-arriving events. Interview probe: "what's the difference between a streaming feature and a batch feature, and which would you use for last-7-day click count?" — answer: both are valid; the right choice is streaming for fast-decay features (last 5 minutes) and batch for slow-decay features (last 90 days), with care that the boundary aligns.

1.8 Multi-task learning — the canonical CTR/CVR/dwell-time problem

Every production ranker predicts multiple targets simultaneously: click, save, dwell, convert, like, share, hide, skip<5s, satisfaction-survey. The architectural question is how to share representation across tasks without (a) destructive interference between tasks pulling in opposite directions, or (b) one dominant task drowning out signal for the others.

Shared bottom — the baseline

Stack: input features → shared MLP → split into task-specific heads. Cheap, simple, and the default; works when tasks are highly correlated (click + save). Fails when tasks conflict (CTR ↑ via clickbait vs satisfaction-survey ↑) — the shared bottom forces a compromise representation that's mediocre for both.

Cross-stitch networks (Misra, CVPR 2016)

Each task has its own MLP stack; at each layer, a learnable cross-stitch unit blends the two task stacks' activations $\alpha \cdot h^A_l + \beta \cdot h^B_l$ before the next layer. Generalization of shared-bottom; rarely deployed because the next generation (MMoE/PLE) strictly dominates.

MMoE — Multi-gate Mixture of Experts (Ma, Google KDD 2018)

arxiv 1804.04266. The canonical multi-task architecture for recsys. Architecture: $E$ shared expert MLPs run in parallel on the input features; each task $k$ has its own gating network $g_k(x)$ that outputs a softmax over the $E$ experts; task $k$'s representation is the gated weighted sum $\sum_e g_k(x)_e \cdot \text{expert}_e(x)$, which feeds task $k$'s head. Per-task gates allow each task to attend to different experts, so the experts specialize in feature regimes (popular vs niche items, new vs returning users) without explicit clustering. The MMoE paper is the one that introduced multi-task to YouTube ranking; the 2019 Zhao et al. paper ("Recommending What Video to Watch Next") is the productionized YouTube case study.

PLE / CGC — Progressive Layered Extraction / Customized Gate Control (Tang, Tencent RecSys 2020, Best Paper)

RecSys 2020 paper. Strictly dominates MMoE in nearly every published benchmark. Insight: MMoE's experts are fully shared across all tasks, so even with gates a task can be polluted by another task's gradient signal during training (seesaw phenomenon — improving task A degrades task B). PLE introduces task-specific experts alongside shared experts:

Deployed at Tencent for video recommendation (+2.3% VTR, +1.5% VV). The interview-bar answer: "PLE's edge over MMoE is that task-private experts are protected from cross-task gradient interference, so when tasks conflict you don't get the seesaw. We default to PLE for any production multi-task ranker."

AITM — Adaptive Information Transfer Multi-task (Xi, SIGIR 2021)

arxiv 2105.08489. For sequentially-dependent tasks: impression → click → cart → purchase. The funnel is sparse (purchase rate is 1% of click rate); naïvely training a purchase predictor over-fits. AITM stacks the task heads in funnel order; each later head receives the previous head's hidden state through a learned transfer gate that decides how much info to pass. Trained jointly with multi-step losses. Used at Meituan and Alibaba for sequential funnels; the right architecture when CTR / CVR / GMV form a chain.

STAR — Star Topology Adaptive Recommender (Sheng, Alibaba CIKM 2021)

arxiv 2101.11427. For multi-domain recsys: same item catalog, different surfaces (search results page, product detail page recs, post-purchase recs). Each domain shares a "center" MLP (the shared root) and has its own "domain" MLP (the spokes of the star). Domain-specific final score combines center and spoke outputs. Used at Alibaba where they serve thousands of distinct rec surfaces. Beats domain-specific independent models because the shared center transfers learning across data-sparse domains.

PEPNet — Personal Embedding Plug-in Network (Kuaishou, KDD 2023)

arxiv 2302.01115. Kuaishou's multi-domain solution. Each user has a personal embedding that, instead of being a feature, is converted into a gating pattern that modulates every layer of a shared backbone. The PEPNet plug-in for domain $d$ also injects domain-specific gates at every layer. Result: the same backbone serves many domains and many users, but with per-user × per-domain modulation that gives near-domain-specialist accuracy. Deployed across Kuaishou's main feed, Kuaishou Lite, and Kuaishou international apps. Interview-bar answer: "PEPNet shows that gate networks indexed by entity are a general tool for personalization and multi-domain — preferable to giant per-domain models when domains share catalog and audience."

Sparse MoE for recsys (2024–2026)

The transformer-MoE pattern (Switch, GLaM, DeepSeek-V3) is starting to land in industrial recsys. Each ranker has $E$ experts (each a small MLP), a router selects top-$k$ ($k$=1 or 2), and only those experts run per token (per item × user pair). Used at Meta within HSTU and at Kuaishou within OneRec. Benefits: more capacity at the same FLOPs per request; specialization across content types (sports vs news vs entertainment) emerges naturally. Pitfalls: load balancing (some experts dominate, others starve — same problem as LLM MoEs), expert collapse at training start. Solutions inherited from LLM-MoE literature: aux-loss-free balancing (DeepSeek-V3), per-expert bias offsets.

Multi-objective combination — how product weights are tuned

The ranker outputs task probabilities $\{p_{\text{click}}, p_{\text{save}}, p_{\text{watch}}, p_{\text{hide}}\}$. The final score is a weighted combination $\sum_t w_t \cdot p_t$ (or $\sum_t w_t \cdot \log p_t$ for multiplicative). Weights are not learned end-to-end (they encode business priorities that change quarterly). Instead:

  1. Define a north-star metric (LT7 retention, GMV, watch-time/DAU).
  2. Offline: grid-search weight combinations on a holdout, predict counterfactual outcome via IPS/DR estimator.
  3. Online: ship the top 3–5 weight combinations as A/B variants; measure north-star delta over 2–4 weeks; pick winner.
  4. Iterate quarterly as product priorities shift.

The bar-raising Sr Staff answer: "weights are a product decision; we keep them out of the model so we can change them without retraining and so different surfaces can have different weights against the same shared backbone."

Loss balancing — when tasks have wildly different loss scales

Watch-time regression (loss ~10) drowns out CTR log-loss (loss ~0.4) if you sum them. Three canonical approaches:

Part 1B — Industry deep-dives by company

One paragraph per platform won't cut it for Sr Staff bar. Below, what each major recsys platform actually runs in production as of 2026, the published papers behind it, and what their interviewers will probe.

Meta — Facebook / Instagram / Reels / Marketplace

The architectural story: DLRM (2019) → DLRM-v2 (2021, ~10× scale) → HSTU (2024) → ongoing migration to HSTU + Wukong + sparse-MoE for ranking. Retrieval still cascade-style (two-tower + graph-based) feeding into HSTU as joint retrieval+ranker on some surfaces.

Key papers to know:

  • DLRM (Naumov 2019) — embedding tables + bottom MLP + pairwise dot products + top MLP. The reference architecture cited by every other recsys paper.
  • HSTU (Zhai 2024) — generative joint retrieval+ranking; replaces DLRM at Reels/IG.
  • Wukong (Zhang 2024) — stacked FM blocks (FMB + LCB) showing clean recsys scaling laws. Each FMB does compressed FM interaction with linear-compressed key and value projections; stacking gives controllable model size scaling.
  • TorchRec (Ivchenko 2024) — the recsys training stack.
  • Wide & Deep (Cheng 2016) — historical foundation, Cheng was at Google then but the architecture pervades Meta's history too.

Infra: TorchRec on PyTorch with FBGEMM kernels; FSDP for the dense path; hybrid TP + EP for HSTU at very large scale. Multi-region serving with regional KV caches for HSTU's autoregressive decode.

What Meta interviewers will probe: HSTU architecture and why softmax is replaced; DLRM-vs-HSTU migration considerations; scaling laws on recsys data; ranking-tier latency budgets; multi-surface architecture (Reels vs Feed vs Marketplace share the backbone or not?); cold-start for items uploaded in the last 5 minutes.

Kuaishou — short-video FYP (400M+ DAU, China + KS Lite + KS International)

Architectural story: Kuaishou is the most architecturally-published Chinese platform. Lineage: DIN-style ranker → SIM-class long-sequence → TWIN (KDD'23) for production long-sequence with shared embeddings → TWIN-V2 (2024) for lifetime modeling via hierarchical clustering → OneRec (2024) for generative end-to-end. PEPNet (2023) layers on top for multi-domain personalization. Persia trains everything; real-time learning on second-level freshness.

Key papers:

  • TWIN (KDD 2023) — long-sequence with embedding consistency between GSU and ESU. 100K-length user history at production latency.
  • TWIN-V2 (2024) — lifetime-scale user behavior via offline hierarchical clustering.
  • OneRec (2024) — end-to-end generative recsys with reward-model alignment.
  • PEPNet (KDD 2023) — multi-domain personalization via per-entity gate plug-ins.
  • Persia (NeurIPS 2021) — hybrid sync/async parameter server for 100T-param recsys.
  • COMIRec — multi-interest retrieval (multiple capsule-derived embeddings per user).
  • DCAF (2023) — dynamic cluster-based attention for recall.

Real-time learning: critical for short-video freshness; second-level pipelines push trained embeddings to the serving stack. Items uploaded in the last 60 seconds appear in retrieval candidates within minutes.

What Kuaishou interviewers will probe: TWIN vs SIM — explain the embedding-consistency argument; lifetime user modeling — how does TWIN-V2 maintain freshness when offline clustering is daily; OneRec's reward-model alignment — analogous to RLHF; multi-domain serving across Kuaishou main / Lite / international apps with PEPNet.

TikTok / ByteDance — FYP, Douyin, ad ranking

Architectural story: Less publicly-disclosed than Kuaishou and Meta, but the published Monolith paper and engineering blogs paint the picture: real-time learning is treated as a first-class architectural property, possibly the primary differentiator. Ranker is MaskNet-style with feature-aware masking; retrieval is multi-source two-tower + graph + content-based. Continuous training pipeline with seconds-scale freshness.

Key papers:

What TikTok / ByteDance interviewers will probe: Monolith collision-handling and why collisions kill recsys (the long-tail dilution argument); real-time training pipeline (parameter server, sync vs async, staleness measurement); MaskNet vs DCN-V2 architectural differences; freshness as a product property — what's the engagement loss from a 5-minute training delay?

Pinterest — Homefeed, Search, Related Pins, Ads

Architectural story: Pinterest publishes a lot; their stack is well-known. Graph-based retrieval (PinSAGE, ItemSAGE) feeds two-tower retrieval, which feeds TransAct sequence ranker, which feeds final business-objective blending. PinnerSAGE produces multi-cluster user embeddings for diverse retrieval. Ads pipeline shares the backbone but with separate calibration.

Key papers:

  • PinSAGE (KDD 2018) — GraphSAGE-style GCN at 3B-node graph scale via random-walk neighborhood sampling. The graph-rec milestone.
  • PinnerSAGE (KDD 2020) — multi-embedding user model (Ward-clustered actions → multiple user embeddings) for diverse retrieval.
  • ItemSAGE (KDD 2022) — multi-modal item embedding from visual + text + interaction signals.
  • TransAct (KDD 2023) — short-term transformer + long-term feature combo for Homefeed ranking; production at 60ms p99.

What Pinterest interviewers will probe: PinSAGE's random-walk sampling and why it scales when LightGCN's full propagation doesn't; PinnerSAGE's diversity rationale (why multiple user embeddings instead of one); TransAct's short-sequence + long-feature combo and why not just one transformer over everything; multi-objective scoring (saves, hides, repins, close-ups have different business weights).

Alibaba — Taobao / Tmall display advertising

Architectural story: The most architecturally-published lab in the world. DIN (2018) → DIEN (2019) → BST (2019) → MIMN (2019, GRU-based long sequence) → SIM (2020) → ETA / SDIM (2022) → CAN (2021) for feature interactions → STAR (2021) for multi-domain. Every Chinese e-commerce platform has copied this lineage.

Key papers (this is the survey):

What Alibaba interviewers will probe: the DIN lineage end to end; long-sequence cost/accuracy tradeoff (SIM vs ETA vs TWIN); CAN's co-action units vs DLRM's static dot products; STAR's star topology for multi-domain; production realities of 10K+ user histories at 30ms latency.

Google — YouTube, Google Ads, Google Play, Discover

Architectural story: The original commercial recsys. Recent stack: two-tower retrieval at YouTube → DCN-V2-style ranker with MMoE multi-task → calibration → bandit-driven exploration. Increasingly LLM-augmented for search-rec convergence (Bard / Gemini surfaces).

Key papers:

What Google interviewers will probe: the MMoE multi-task setup for watch-time + click + satisfaction; logQ correction in two-tower training; calibration for ranking scores; bandit-based exploration on the YouTube homepage; recent LLM-augmented patterns.

LinkedIn — Feed, Jobs, Network, Ads

Architectural story: 2024's LiRank paper documents the current feed ranker comprehensively. Multi-stage: retrieval (two-tower + heuristic) → first-pass ranker → fine ranker → diversification. Multi-task across CTR, dwell, share, hide, sensitive-event suppression. GDMix is the training infra for sparse + dense; GLMix is the older personalized GLM stack still used for some signals.

Key papers:

  • LiRank (Borisyuk 2024) — the full LinkedIn feed ranking architecture; residual cross-net for interactions, multi-task heads, isotonic calibration. One of the most comprehensive industrial recsys system papers of 2024.
  • GLMix (KDD 2016) — generalized linear mixed models for per-entity personalization.
  • GDMix — generalized deep mixture; the successor to GLMix.

What LinkedIn interviewers will probe: LiRank's residual cross-net architecture; calibration (LinkedIn uses isotonic regression on a held-out); sensitive-event suppression and how that interacts with the ranker; multi-task interference and how LiRank handles it; large-scale embedding sharding.

Amazon — product recommendations, "Customers who bought…"

Architectural story: The historical foundation paper (Linden 2003) introduced item-to-item collaborative filtering, the core method for "Customers who bought X also bought Y." Modern stack: DLRM-style ranker, knowledge graph augmentation (COSMO), heavy reliance on browse and purchase signals over impressions, and increasingly LLM-augmented for product search.

Key papers:

What Amazon interviewers will probe: item-to-item CF and where it still wins; Bayesian rating shrinkage (Amazon-style; small-sample items shrink toward category mean); the 2-stage retrieval+rerank pattern at amazon.com scale; multi-marketplace personalization; LLM-augmented product search.

Spotify — Discover Weekly, Home, Search, Podcasts

Architectural story: Heavy emphasis on session-level signals, content-based embeddings (audio + lyrics), and calibrated recommendations for genre balance. Two-tower retrieval over content + collaborative embeddings; multi-task ranker for skip / save / discover.

Key papers:

  • Calibrated Recommendations (Steck, RecSys 2018) — the canonical reference for genre-calibrated rec lists. Reranks top-N so the genre distribution matches the user's historical preference distribution.
  • The bandits paper for Spotify Home shelf personalization.
  • Session-based recsys (research lineage from GRU4Rec).

What Spotify interviewers will probe: calibration (Steck-style) — when do you reach for it, what's the metric; audio embedding from raw waveform vs lyric vs collab; podcast vs music — same backbone or different; cold-start for new releases on Discover.

Netflix & Snap — short publishing record but worth a mention

Netflix: Heavily bandit-based for row personalization (which row goes where on the homepage). Two-stage with calibration. Less architecturally published than peers since the original Netflix Prize era — most insights come from RecSys talks rather than peer-reviewed papers. Notable recent work: large-scale contextual bandits for Netflix homepage.

Snap: Friend-graph signals dominate; sponsored Spotlight ranking is two-tower + DLRM-style. Snap's published work on ad ranking covers calibration and sequence modeling.

Part 2 — Eval, calibration, debiasing

2.1 Offline evaluation

The classical metrics

AUC vs NDCG — when each matters

AUC is position-insensitive: it asks "given any random pos and any random neg, is pos ranked higher?" NDCG is position-sensitive: lifts at rank 1 matter much more than lifts at rank 50. For a two-tower retrieval model, AUC is fine — you only care that positives are roughly above negatives. For a feed ranker where users see 10 items, NDCG@10 (or even NDCG@3) is what predicts online wins. Sr Staff phrasing: "AUC for retrieval, top-heavy metrics for ranking, and never trust AUC alone for the final ranker."

The offline–online correlation problem

The biggest hard-earned lesson in industrial recsys: offline metrics often do not correlate with online A/B test outcomes. Reasons:

Counterfactual / IPS / DR estimators

For more honest offline eval, weight each logged event by 1/plogging(action), where plogging is the (logged or estimated) probability that the old policy showed this item to this user. This is the Inverse Propensity Score estimator. It's unbiased but has high variance when propensities are small. Doubly Robust (DR) combines IPS with a reward model: if either the propensity model or the reward model is correct, the estimator is unbiased. Production teams run replay eval (using IPS/DR) alongside traditional offline metrics, and trust the agreement.

Sr Staff red flag
If you say "we picked the model with the best NDCG" and stop there, expect follow-up: "How did you handle position bias? Did you do any counterfactual eval? What was your offline-online correlation in the last 5 launches?" Have a story.

2.2 Online evaluation

A/B test fundamentals

Sample size: n ≈ 16 σ² / Δ², for detecting a relative effect Δ at 80% power, 5% significance, two-sided. For typical CTR (5%) and a 1% relative MDE (so absolute Δ = 0.0005), n is in the tens of millions per arm. For low-traffic surfaces, this means month-long tests or no test at all. Sr Staff candidates should know:

CUPED variance reduction

Subtract a regression-predicted "expected metric value" (from pre-experiment user features) from the observed metric. The residual has lower variance, so you detect smaller effects with the same n. Conceptually: control for "this user was always going to click a lot." Reduces required sample size by 30–60% in most consumer experiments. Microsoft / Booking.com / Netflix all use it.

Interleaving

Instead of A/B (different users see A or B), each user sees a result list interleaved from both rankers (Team Draft Interleaving, Probabilistic Interleaving). Counts wins per ranker. Detects ranking improvements with ~10x less traffic than A/B because variance from "different users" is removed. Microsoft Bing's standard pre-A/B gating tool.

Multi-armed bandits

For exploration / cold-start / many-arm comparison:

Bandits in production usually serve either (a) cold-start exposure for new content, or (b) hyperparameter tuning across model variants. Pure bandit-driven feed ranking is rare — bandits don't naturally compose with the cascade.

Long-term metrics

The hardest, most Sr-Staff topic. Short-term CTR may go up while 30-day retention goes down (the "engagement bait" failure mode). Real production teams maintain:

The operationalized answer: any launch must move the primary metric without significantly hurting any guardrail. Long-term metrics are tracked in holdback experiments (5% of users on baseline indefinitely) so you can attribute multi-month effects.

2.3 Bias and fairness

Position bias

Items at the top of a list get clicked more regardless of relevance. If you train naively on click logs, your model learns "be like the previous model" rather than relevance. Two correction families:

Selection / exposure bias

Items never shown have no labels. Naive training converges to "show items the previous model would've shown." Mitigations: random exploration traffic (e.g. 1% of impressions are random), counterfactual reasoning (IPS), and explicit exploration sources in retrieval.

Popularity bias and item cold start

Popular items appear in training data far more often, both as positives and (via in-batch sampling) as negatives. The negative effect typically dominates and you under-rank popular items unless you correct. YouTube's logQ subtraction (subtract log of sampling probability from logits during training) corrects in-batch negatives. For cold items, hybrid retrieval (content tower) and explicit cold-item exploration boost are standard.

Calibrated logging

The single highest-leverage practice for honest training: log the propensity that the action was taken. If your serving system did Thompson sampling or stochastic rerank, log the probability. This lets you train with IPS or DR estimators, run honest counterfactual eval, and avoid the offline-online correlation collapse. Most teams ship deterministic ranking by default, then quietly add ε-randomization just to enable better training data.

Fairness — not just bias

Beyond position bias, "fairness" in recsys typically means: equal exposure across creator groups, demographic parity, or specific KPIs for protected categories. Common interventions: post-rank reordering to satisfy exposure constraints (Polyak / Lagrangian), in-training fairness regularizers, or pipeline-level changes (e.g. "ensure ≥ 30% of impressions go to creators with < 10k followers"). Be ready to discuss tradeoffs with primary metric.

Part 3 — Embedding tables at scale

The number-one infra problem in industrial recsys. A modern ranker has tens of billions of parameters, ~95% of which are in sparse embedding tables (user IDs, item IDs, creator IDs, all the cross IDs). A single user-id embedding table at Meta or YouTube can be ~100B rows × 128 dim × 4 bytes = ~50 TB. No single GPU has that memory.

Sharding strategies

Communication: all-to-all

For each minibatch, each GPU has some subset of needed embedding rows; the rest are on other GPUs. The pattern is:

  1. Forward all-to-all: each GPU sends "I need rows X, Y, Z from you" and receives back the embedding rows.
  2. Compute.
  3. Backward all-to-all: gradients flow the other way to update embeddings.

This is the hot loop of training. NVLink/IB bandwidth here is what limits throughput in production.

4 GPUs holding shards of one large embedding table GPU 0 GPU 1 GPU 2 GPU 3 rows 0..N/4 rows N/4..N/2 rows N/2..3N/4 rows 3N/4..N batch needs: batch needs: batch needs: batch needs: [5, 200k, 800k] [300k, 50, 999k] [600k, 7, 350k] [2, 500k, 850k] All-to-all: each GPU exchanges requested rows with every other Forward: send needed rows. Backward: send gradients. Bandwidth here = training throughput ceiling.
Sharded embedding all-to-all. The pattern dominates the training step in production recsys.

Compression and capacity tricks

Training challenges specific to embeddings

Stack landscape

Part 4 — Six worked ML system designs

Each at the depth a Sr Staff loop expects. The goal isn't to memorize architectures — it's to know which knobs you would turn and why. For every problem, walk the same template: clarifying Qs → scale → data → features → arch → training infra → serving infra → eval → monitoring → gotchas → "if I had more time."

Design 1 — YouTube recommendations (homepage feed + watch-next)

Clarifying questions

  • Which surface? Homepage (browse intent) vs watch-next (continuation intent) vs search results (intent-driven). I'll cover homepage primarily and contrast.
  • Logged-in only or include non-logged? Affects use of personal history.
  • What are we optimizing? Watch time historically, but also satisfaction surveys, long-term retention, creator diversity.
  • Are Shorts, Live, regular videos in one feed or separate? Assume mixed.
  • Latency budget? ~150 ms end-to-end.

Scale assumptions

  • ~2 B logged-in MAU, ~500 M DAU.
  • Corpus: ~5 B videos historically; ~hundreds of millions "active enough to recommend."
  • Peak QPS for homepage: ~200k.
  • ~30 trillion actions logged per day across all surfaces.

Data sources

  • User watch history (with watch-time fraction, completion, like, dislike, save, share, subscribe).
  • Search queries.
  • Video metadata: title, description, channel, tags, transcript.
  • Visual features: thumbnail and frame embeddings (a CNN/CLIP-style encoder offline).
  • Audio features for music/Shorts.
  • Creator features and creator-watcher graph.
  • Surveys (1–5 star satisfaction) — used as a label for re-ranker calibration.

Architecture

Retrieval (multi-source).

  • Two-tower neural retrieval. User tower over recent watch sequence (transformer encoder, 100 most recent items, attention pool) + demographic + context features. Item tower over content embeddings (text + thumbnail) + channel embedding + age/popularity. Trained on next-watch prediction with sampled-softmax + logQ correction. Output ~3000 candidates per request via HNSW shards (~100M item index, sharded by item ID hash, partitioned by language/region).
  • Co-watch / item-item. For users with a clear current session anchor, retrieve items most often co-watched in the next 1–3 watches, normalized by popularity (PMI). ~1000 candidates.
  • Subscription pull. Recent uploads from channels the user subscribes to or has watched recently. ~500.
  • Trending / freshness pool. Hot videos in the user's region/language. ~500.
  • Topic-personalized retrieval. User's top-K topics → top videos in those topics over last week. ~500.
  • Exploration source. Random sample of underexposed creators / topics. ~200, with a flag so the ranker can downweight if confidence is too low.

Total ~5–6k candidates after dedup.

Ranking. A multi-task DLRM-style or HSTU-style model. Inputs: user features, item features, ~100-item watch history (sequence), context (time of day, device, country), candidate-specific cross features (past interaction with channel, topic affinity). Outputs: heads for p(click), p(watch_time_fraction), p(like), p(share), p(skip<5s), p(satisfaction_high|surveyed). Final score is a calibrated linear combination tuned via product A/B tests. Multi-task with MMoE or PLE because completion and click-bait pull in opposite directions.

Re-ranking / policy. Diversity (MMR over channels, topics — never two from the same channel back-to-back). Frequency caps (don't show creator X more than once per session). Business / quality rules (downrank borderline content, upweight kid-safe in restricted mode). Freshness boost for very recent uploads from subscribed channels.

Training infra

  • Daily incremental training on the previous day's logs; weekly full retrain. Streaming online updates for the embedding table for hot items.
  • Several hundred GPU-days per training run; sharded embeddings (TPU embeddings or TorchRec).
  • Two-tower retraining nightly (item tower frozen between regen of item index every 4–6 h).

Serving infra

  • Edge → routing → recsys gateway → parallel retrieval fanout → feature hydration (online feature store, e.g. Bigtable/Spanner per-user; remote KV per-item) → ranker (GPU inference cluster, batched per request) → re-rank → response.
  • User embedding cached for ~minutes (sticky session).
  • HNSW shards run on CPU with SIMD, ~3 ms per query per shard.
  • Ranker on GPU (batch ~500 candidates per user per request), fp16, ~25 ms.

Evaluation

  • Offline: NDCG@10 on next-watch holdout, Recall@1000 for retrieval per source, calibration curves per task head, IPS-corrected replay for the ranker.
  • Online: watch-time per user, sessions per day, satisfaction surveys (5-star), 30-day retention, creator-side metrics (uploads engaged, creator earnings if monetized).
  • Holdback for long-term metrics (1% on baseline indefinitely).

Monitoring

  • Online prediction quality: continuous calibration tracking (predicted vs actual CTR per slice).
  • Coverage / diversity: distribution of impressions over creators/topics.
  • Latency P50/P95/P99 per stage; auto-rollback if P99 > 200ms for > 5 min.
  • Feature freshness: alert if any feature lag > 2 h.

Gotchas

  • Click-bait. Optimizing CTR alone ruins the product. Watch-time-weighted training plus the satisfaction head are the bandages; ultimately you need a survey-informed re-rank.
  • Filter bubbles. Collab-only retrieval narrows recommendations. Mandatory exploration source.
  • Creator side. If small creators never get exposure, ecosystem dies. Track creator coverage as a guardrail.
  • Cold videos. Two-tower with content embeddings handles this; explicitly boost first-24h impressions for new uploads from subscribed channels.

If I had more time

  • Move to HSTU-style generative ranker, replacing DLRM trunk.
  • Joint optimize retrieval and ranking (gradient flow from ranking loss back through retrieval source weights).
  • Train an LLM-based re-ranker over the top-50 to inject content understanding for niche topics.
  • Causal-aware ranker (counterfactual reasoning about what user would have watched in absence of recommendation).

Design 2 — Pinterest home feed

Clarifying questions

  • Single image-heavy feed; what's the unit? "Pins" (image + link). Mostly photo, some video.
  • Are we optimizing repins, clickthroughs, hides, or session length? Pinterest has historically used a multi-objective combo with strong weight on long-term repin behavior (intent signal).
  • Cold-start critical because users come for inspiration and many sessions are exploration — so retrieval needs to surface fresh, diverse content.

Scale

  • ~500 M MAU, ~100 M DAU.
  • Corpus: ~10 B pins.
  • Each pin has rich visual + text; visual similarity is the dominant signal.

Architecture — distinctively visual

Retrieval.

  • PinSAGE-style graph embeddings. Bipartite user×pin graph + pin–pin board co-occurrence. Aggregate via random-walk-sampled neighborhoods. Embeddings precomputed offline for all 10B pins.
  • Visual content embedding. A vision transformer (or CLIP-aligned) embedding for every pin. Used for "more like this" (item-item retrieval), and as input feature.
  • Two-tower neural retrieval. User tower over recent pins/boards/searches; item tower over content + graph embeddings.
  • Board-personalized retrieval. For each of user's recent boards, retrieve pins similar to that board's centroid. Captures user's stated intent.
  • Trending visual cluster source. Use a clustering of pin embeddings to surface what's new and trending in clusters the user shows interest in.

Ranking. Multi-task DLRM/transformer over user × pin × context. Heads: p(click), p(repin), p(hide), p(close-up view), p(long-engagement). Sequence model over the user's recent pin interactions (BST-style transformer). Input includes the pin's visual embedding directly — the visual is a first-class feature, not just an ID.

Re-ranking. Spatial layout matters: home feed is a Masonry grid. Re-ranker has to balance top-K relevance with visual diversity in adjacent positions (avoid 5 lookalike images in a row → MMR over visual embedding). Frequency caps on advertisers and creators. Topic balance.

Features

  • Visual: CLIP/ViT embedding, dominant color, image dimensions, aesthetic score.
  • Text: title, description, board names where pinned.
  • Graph: PinSAGE embedding, board centroid embeddings.
  • Engagement counters per pin (CTR, repin rate by segment).
  • User: recent searches, recent boards created, demographic.
  • Context: time of day, season (Halloween → spooky).

Training

  • Two-tower: trained on positive (impression+repin or impression+long-view) with in-batch + hard negatives mined from the previous version.
  • Ranker: incremental daily training on logged events with calibration head per task.
  • PinSAGE: batch retrained weekly with MapReduce-style neighborhood aggregation.

Serving

  • Visual embedding pre-baked at upload time (vision model on a dedicated GPU pool).
  • HNSW for visual + neural retrieval; sharded by category + region.
  • Ranker on GPU; batch per user per request.

Evaluation

  • Offline: NDCG@10 with repin labels weighted higher than clicks.
  • Online: long-term repin rate, sessions/week, hide rate (guardrail), creator coverage.
  • Visual diversity metric: average pairwise visual distance among shown items.

Gotchas

  • Visual repetition. The product looks broken if 4 of the top 8 pins are the same outfit photo. Diversity in re-rank is non-negotiable.
  • Seasonal shift. Christmas pins explode in November and tank in February. Recency and seasonal adjusters.
  • Cold pins. New pins have no graph neighbors. Vision embedding is the bridge; cold-start exposure pool boosts first-24h pins.
  • NSFW / unsafe. Visual + text moderation classifier as a hard filter pre-ranking.

If more time

  • Multimodal LLM to score "is this pin a creative match for what user is exploring on board X?" as a re-rank signal.
  • Replace MMR with learned diversity head.
  • Generative pin retrieval via TIGER over visual semantic IDs.

Design 3 — TikTok For You Page

Clarifying questions

  • Single-video feed, very rapid feedback (every swipe is data). Watch-time fraction is the dominant label; like/share/follow are secondary.
  • Latency: critical because users swipe fast and the next video must be ready. Need to pre-fetch next 2–3 videos.
  • Cold start for both users (first session) and creators (first upload).

Scale

  • ~1.5 B MAU, ~1 B DAU.
  • Corpus: ~hundreds of millions of videos active.
  • Daily uploads: tens of millions; new content's first hour is critical.
  • Average session length: tens of swipes ⇒ tens of inference calls per session.

Architecture — sequential and exploration-heavy

Retrieval. Multi-source, but with strong emphasis on:

  • Two-tower over recent watch sequence (heavy weighting on last 5–10 videos).
  • Co-engagement (item-item) anchored on the just-watched video.
  • Trending pool (a few thousand currently surging videos).
  • New-creator exposure pool. A meaningful fraction (~5–10%) of impressions go to new content with little engagement data, because the FYP's life depends on the creator funnel staying healthy. This is the "TikTok secret sauce" — aggressive controlled exploration of new content.
  • Audio-based retrieval (matching trending sounds).

Ranking. Sequence-aware deep ranker. Input is the user's last 100 watch events (with rich per-event features: video ID, watch fraction, like, share, follow, skip-time). HSTU-style transformer is the modern choice. Outputs: p(complete), p(watch_>60%), p(like), p(share), p(follow_creator), p(skip<3s). The combined score is heavily weighted toward complete/watch_fraction because TikTok lives or dies on dwell time.

Re-ranking. Diversity over creators, topics, visual styles. Frequency caps. Reinforcement-learning style policy for "should I show this exploration video here?" — TikTok has been public about using RL/bandits on top of the ranker to manage exploration vs exploitation across the session.

Why RL fits TikTok specifically

The single-video format gives clean, fast feedback (watch time of the next video is observed within seconds). The session is a sequence of decisions where the state evolves. This is closer to a true sequential decision problem than most recsys. Use cases: deciding when to inject exploration content, when to push a follow recommendation, when to insert ads. Implementations are typically batch-RL with policy gradient or off-policy correction (DQN-style with importance sampling), not pure online RL.

Serving — pre-fetching is the trick

  • While user watches video N, system already retrieves and ranks for slot N+1, N+2, sometimes N+3.
  • If user does an action mid-video (like, skip), a re-rank can happen for N+2 onward.
  • Edge cache video files for the next 2 candidates so playback starts in <100 ms.

Evaluation

  • Offline: NDCG-watch (positions weighted by watch-time), AUC on per-task heads.
  • Online: average watch time per session, session count, retention D7/D30, creator coverage (Gini coefficient of impressions over creators).
  • Long-term: holdback to detect "shorts addiction collapse" — the cohort of users who spend a lot then churn from satiation.

Gotchas

  • Optimization for short-term watch time can be net-negative. Aggressive watch-time chasing produces "doomscroll" content that users regret. Survey labels and "satisfaction" model heads counterbalance.
  • Hot-start cold-start for users. First 10 videos for a new user are a multi-armed bandit selecting topics rapidly.
  • Adversarial creators. SEO-style content gaming. Need a separate "low-quality / engagement-bait" classifier.
  • Latency. Pre-fetch failures are visible — empty feed.

If more time

  • Move ranker fully to HSTU; collapse retrieval+ranking into one generative model for the long-tail user (those with rich history).
  • End-to-end trainable session policy via offline RL with confidence intervals.
  • World-model simulation to evaluate ranker policy changes without A/B traffic.

Design 4 — Twitter / X home timeline

Clarifying questions

  • Two timelines historically: "Following" (chronological) and "For You" (ranked). Focus on For You.
  • Tweets are short, real-time, network-driven. Freshness is critical — minute-level decay.
  • Network effects are first-class: who you follow, who they retweet, who replies — all signals.

Scale

  • ~500 M MAU.
  • ~500 M tweets/day; spikes during live events (sports, breaking news).
  • Most tweets have a useful lifetime of hours, not days.

Architecture — fanout vs query at read

The classic Twitter design choice. Two strategies, both used:

  • Fanout-on-write. When user A tweets, push the tweet ID into a per-follower timeline materialized list. Read is fast (just read your list). Write is expensive — celebrities with 100M followers can't fanout per tweet, would create write storms.
  • Query-on-read. At read time, fetch recent tweets from people you follow. Slow but no write amplification.
  • Hybrid. Fanout for normal accounts; query-on-read for celebrities ("Bieber tweets" exception). Twitter implemented this for years.

Retrieval — sources for For You.

  • In-network candidates. Recent tweets from people you follow + their retweets + their replies. ~hundreds to a few thousand.
  • Out-of-network candidates. Tweets from people you don't follow but might engage with. Two-tower retrieval (user × tweet author embedding) over recent tweets. ~hundreds.
  • Topic-based. Tweets in topics you follow.
  • Co-engagement / collab-filter. Tweets liked by users similar to you.
  • SimClusters (Twitter's own). Sparse community memberships for users and tweets; recommend tweets in your communities.

Ranking. Twitter's ranker (open-sourced in 2023 in part) uses a mix of heavy features: tweet text embedding, author embedding, rich engagement signals, recency, tweet metadata (has-image, is-reply, reply-count). Multi-task heads for p(like), p(reply), p(retweet), p(profile-click), p(longer-dwell). Aggregated via a learned weight vector.

Re-ranking. Author diversity (avoid one user's tweets clustered), conversation completeness (if showing a reply, ensure parent context), recency boost (decay older tweets), filter blocked / muted, downrank low-quality / spam.

Real-time pipeline

  • Tweet ingestion → Kafka → real-time feature extraction (tweet embedding, classifier scores) → fanout or candidate index update within seconds.
  • User-level engagement events also stream into the feature store; user embedding can be refreshed every few minutes.

Eval

  • Offline: NDCG@K with multi-objective labels.
  • Online: time spent, sessions per day, reply / retweet rate (engagement loops), reported satisfaction, controversial-content guardrails, hide rate.
  • Track creator reach: are mid-tier creators getting enough impressions to keep tweeting?

Gotchas

  • Outrage/engagement bait. Optimization for engagement amplifies controversy. Need explicit reward shaping or post-rank dampening.
  • Real-time freshness. 30-min-old tweets are usually stale. Strong recency decay in score.
  • Live events. Sports / breaking news cause query spikes; auto-scaled retrieval and dynamic candidate budget.
  • Network effects in eval. Treatment of one user changes what their followers see — A/B randomization should be at the cluster (community) level for ranking changes that affect retweet/reply patterns.
  • Spam / coordinated inauthentic behavior. Adversarial; need bot detection and suppression as a separate pipeline.

If more time

  • Generative retrieval over semantic IDs of tweets (cluster tweets first, semantic-tokenize them).
  • LLM scoring for "is this tweet of interest to user given their last 10 reads?"
  • Conversation-level scoring rather than tweet-level (rank thread, not individual replies).

Design 5 — DoorDash store ranking

Clarifying questions

  • Surface: home feed of restaurants/stores. Goal: maximize conversions while keeping operations sane (don't recommend a store that is overloaded or out of delivery range).
  • Constraints: geospatial (must be in delivery radius), temporal (must be open + have prep capacity), supply-aware (Dasher availability).
  • Optimize for first-order conversion, but also long-term retention and marketplace health (don't starve smaller stores).

Scale

  • ~30 M MAU, US + INTL.
  • Stores: ~hundreds of thousands; each city-level corpus is much smaller (~hundreds to low thousands per user).
  • Strong daypart variation: lunch/dinner peaks shape both demand and supply.

Architecture — geospatial + supply-aware

Critical observation: candidate set is inherently small per user (in-radius stores). Retrieval is more about filtering than ANN.

Retrieval.

  • Spatial filter: stores within delivery radius (geohash / S2 cell intersection), open right now, with ETA < threshold.
  • Within that, optionally further pre-filter to top ~500 by engagement/historical conversion to bound ranking compute.

Ranking. Deep multi-task model. Inputs:

  • User: order history (restaurants / cuisines / spend per category), demographic, device, recency.
  • Store: cuisine, price tier, popularity, ratings, menu embedding, photo embedding.
  • Cross: user × store CTR / conversion / repeat-rate.
  • Context: time of day, day of week, weather (rain shifts demand).
  • Operations: current ETA prediction, prep-time estimate, Dasher availability, store kitchen-load score.

Heads: p(click_into_store), p(add_to_cart), p(order), p(reorder_within_30d). Final score is a calibrated combination, with explicit downweight when operations score is unhealthy (long ETA, low capacity).

Operations-aware rerank. The reranker is allowed to adjust based on supply: if 5 high-ranked stores would all overload the same kitchen / same Dasher pool, spread out. This is closer to two-sided marketplace optimization than pure recsys. Often modeled as a bid-shading layer or LP solver across the home page.

Features unique to delivery

  • Live ETA model output (separate ML model, fed as a feature).
  • Live store load (how many open orders).
  • Delivery fee, surge / peak pricing (if applicable).
  • Promotional state (is this store running a $5-off promo? changes conversion).

Training

  • Logs are smaller than feed-style products but cleaner (each impression has rich operational context). Daily retraining is enough.
  • Holdouts per metro because behavior is regional.

Serving

  • Spatial index (geohash buckets in Redis or S2 in a custom service) returns candidates in < 5ms.
  • Feature hydration includes near-real-time ops features (push-updated by an ops service).
  • Ranker on CPU is often fine because candidate count is small (~500 ranked).

Eval

  • Offline: NDCG@K on conversion labels.
  • Online: conversion rate, GMV per session, order completion (canceled orders are bad), repeat order rate, marketplace health (impression share for small/new merchants).
  • Operations metric: ETA accuracy of recommended stores (penalize recommending stores that under-deliver on ETA).

Gotchas

  • Supply collapse. Recommending only the 10 most popular stores creates a load spike that hurts ETAs across the board. Operations-aware rerank is non-negotiable.
  • Daypart shift. 11am vs 7pm vs midnight have completely different distributions. Time-of-day must be a feature; consider per-daypart sub-models or a temporal embedding.
  • Cold metros. A new market has no engagement data. Use cuisine-popularity priors and content (menu text, image) features.
  • Promo gaming. A store running a discount looks artificially good. Disentangle promo lift from intrinsic preference (often a separate "promo-adjusted" score).

If more time

  • Joint optimize ranking + ETA prediction (currently two separate models — gradients should flow).
  • Per-user reorder model that handles "I order pizza every Friday at 7pm" patterns explicitly.
  • LLM-generated personalized store summaries on cards to lift click-through.

Design 6 — Spotify Discover Weekly

Clarifying questions

  • It's a 30-track playlist, refreshed weekly per user, intended to be a personal mix of new (to user) discoveries.
  • Goals: high listen-through, high "save to library" rate, novelty (mostly tracks the user has never heard).
  • Different from feed: batch-generated, fixed-length, must hold together as a coherent listening experience.

Scale

  • ~600 M MAU.
  • Catalog: ~100 M tracks.
  • Generation runs Sunday night for everyone; pipeline must finish in ~hours.

Architecture — playlist generation, not single-shot ranking

Stage 1 — Candidate generation.

  • Collaborative filter: ALS or two-tower over user × track listen history. Returns top ~5000 tracks.
  • Audio content model: CNN/transformer over audio (mel-spectrogram or learned audio embeddings). Useful for long-tail tracks with little engagement.
  • NLP model over track metadata, lyrics, artist tags.
  • Playlist-co-occurrence: tracks frequently appearing together in user-created playlists.

Stage 2 — Filter and qualify.

  • Remove tracks the user has already heard (the novelty constraint).
  • Remove tracks by artists the user has actively avoided.
  • Remove tracks not licensed in the user's market.
  • Apply quality filter (skip tracks with very low listen-through globally).

Stage 3 — Rank and select 30.

  • Per-track score from a model trained on historical "did the user listen to this track to the end / save it to library" labels.
  • Diversity / coherence constraint: select 30 tracks subject to diversity over genres, tempo, mood, and a soft constraint that adjacent tracks flow well (transition-friendly).
  • This is a constrained selection problem — often formulated as DPP (Determinantal Point Process) or a greedy MMR variant. Modern Spotify likely uses a learned re-rank with diversity reward.

Stage 4 — Order the 30.

  • Order matters. First few tracks are an audition — if user bails, the playlist failed. Place high-confidence relevant tracks early; sequence the rest for arc (energy curve).

Features

  • User: listen history, saved tracks, playlists created, top genres/artists, time-of-day listening patterns, device.
  • Track: audio embedding, metadata (genre, tempo, key, energy), popularity, artist embedding.
  • Cross: user × artist plays, user × genre affinity.
  • Sequence: recent listening sessions to capture mood drift.

Training

  • Predictive model: trained on past Discover Weekly logs — "given the playlist we generated, predict listen-through and save."
  • Counterfactual: for tracks not in past playlists, use general listen-through priors.
  • Refresh weekly with the previous week's outcomes.

Serving

  • Batch pipeline (Spark / Beam) on weekend; writes 600 M playlists to a per-user blob.
  • Read at request time is just a key-value lookup.

Eval

  • Offline: predicted listen-through, save rate.
  • Online: average tracks listened per playlist, save rate, share rate, "play next week" rate (does the user come back for the new one?).
  • Long-term: D90 retention of users who consume Discover Weekly vs control.

Gotchas

  • Stale-feeling playlists. If users keep getting similar music week to week, the product loses its magic. Track week-over-week diversity per user.
  • Cold-start tracks. Indie / niche tracks with no listens. Audio model is critical here.
  • Artist obsessions. A user who listens to 90% of one artist would get a playlist of just that artist's deep cuts. Cap per-artist in the playlist.
  • Repeated dislikes. If user skips a track 3 weeks running, never again.
  • Genre drift. User goes through phases. Use recent vs all-time differently.

If more time

  • Move from track-by-track scoring to playlist-level scoring — train a model on "rate this playlist 0–1," generated by language-model paraphrase of human DJ playlists.
  • Add LLM rationale ("this week we mixed X and Y because…") rendered in the UI to lift trust and click-through.
  • Conversational refinement ("more upbeat") with a small interactive playlist agent.

Part 5 — RecSys + LLM convergence (the 2025–2026 frontier)

The most asked-about topic in 2026 Sr Staff loops. Be opinionated. Below: how LLMs are actually used in production recsys, and where they aren't yet.

LLMs as feature extractors

The most boring and most useful pattern. For any item with text (titles, descriptions, reviews, transcripts, captions), pre-compute LLM embeddings (OpenAI text-embedding-3, Cohere, in-house Llama-style encoder). These plug into ranking models as a continuous feature. Wins:

This is in production at virtually every modern recsys team. Cost is dominated by one-time embedding compute, refreshed only for changed items.

LLMs as rerankers

Take the top-50 from your traditional ranker, send to an LLM with a prompt like "User has been browsing {history}. Rank these items by relevance: {items}." Used in:

Tradeoff: latency. A GPT-4-class call adds 500ms+. Production deployments use distilled smaller models, batch reranking offline for "warm" content, or only invoke LLM rerank for high-value queries (high commercial intent, low-latency tolerance).

Generative recommendation (autoregressive item generation)

TIGER, HSTU, and the broader RecGPT framing — covered in Part 1.6. The future direction. As of 2026, HSTU is in production at Meta scale; most other "generative recsys" are research or small/medium scale.

Conversational recommendation

"Recommend me a sci-fi movie like Arrival but happier." A user expresses preferences in language; an agent translates into retrieval, ranks, presents, and refines based on follow-up. Hot research area, increasingly shipping in product (Amazon Rufus, Klarna, Shopify, Google's product search). Architecture pattern:

Personalized agents (multi-step research / shopping)

"I want to switch from gas to induction stove — what should I buy?" The agent reads product specs, reads reviews, does spec comparisons, answers tradeoffs, narrows to recommendations, possibly checks out. This is recsys + tool use + reasoning. Companies betting here: Anthropic (computer-use agents), Amazon, Klarna, Perplexity. Recsys engineer's role: design how recommendations are surfaced inside an agent loop, how to ground in user history without violating privacy, and how to attribute conversion.

World models for simulation-based eval

The dream: rather than running an A/B test for 14 days, simulate the new ranker against a learned model of user behavior to predict the outcome offline. Active research area (Meta, Google, academia). Risk: the world model itself is just a learned predictor and can suffer from distribution shift. Promising for narrowing the candidate set of A/B tests, not for replacing them.

Sr Staff opinion to have ready
Don't just list these. Be ready with: "I think LLM rerank is overhyped at the top of the funnel because the latency math doesn't pencil out, but it's transformative for cold items and conversational surfaces. The deeper bet is generative retrieval — semantic IDs unlock parameter sharing across items, which is the bottleneck that limits scaling laws in classical DLRM-style systems."

Part 6 — Common interview questions, with Sr Staff answers

Q1. Walk me through the architecture of YouTube's recommendation system.

The system is a cascade. Retrieval narrows ~5B videos to ~5–10k candidates via parallel sources: a two-tower neural retrieval over the user's watch sequence and item content embeddings, item-item co-watch from the current session anchor, subscription pulls, trending in language/region, topic-personalized retrieval, and an exploration source that injects underexposed long-tail content. Each source is independently sharded with HNSW indexes. The union goes to a multi-task deep ranker — historically DLRM-style with sparse embeddings + dense MLP + dot-product interactions, in 2024+ moving toward HSTU-style sequential transformers — that produces calibrated heads for click, watch-time, like, share, and survey-satisfaction. A linear combination of those heads, with weights tuned by product, scores each candidate. A re-ranking pass enforces diversity (MMR over creators and topics), frequency caps, and policy / safety rules. Latency budget end-to-end is ~150ms; ranking inference is GPU-batched per user request, retrieval shards run on CPU with SIMD. The interesting parts are: (a) the multi-task structure resolves the conflict between click-bait short watches and long-watch satisfaction; (b) the calibration pipeline fixes the systematic miscalibration introduced by negative downsampling and multi-task gradient interference; (c) the exploration source plus survey-trained satisfaction head guard against feedback loops. The biggest lever in the last few years has been moving from average-pooled history to attention-over-history, and ultimately to a transformer over the action sequence.

Q2. How would you handle cold start for a new user / new item?

New user. The user has no embedding signal. Strategies, in increasing sophistication: (1) Onboarding: ask the user 3–5 quick taste questions; map to topic embeddings. (2) Demographic / device priors: country, language, device type — decent baseline. (3) Bandit over a small set of broad-appeal content, with Thompson sampling, for the first ~10 impressions. (4) Once you have ≥ 5 interactions, the two-tower starts to produce a meaningful user embedding. Architecturally, the user encoder must work with empty history — typical fix is a learned "no-history" token.

New item. The item id has no usage. Solutions: (1) Content-based retrieval — text/image/audio embeddings give the item a starting point; the item tower reads those features so the embedding is non-degenerate from day one. (2) Creator priors — if a known creator uploads a new item, inherit creator's average engagement. (3) Cold-item exposure boost in retrieval (small fraction of impressions reserved for first-24h items). (4) Generative retrieval (TIGER) is particularly strong here because the semantic ID is content-derived. The Sr-Staff caveat: cold-start solutions trade off against short-term engagement metrics; you must guardrail with creator coverage so the team doesn't quietly turn off the boost in pursuit of CTR.

Q3. Your CTR model has high offline AUC but loses an A/B test. Diagnose.

Common causes, in order of frequency:

  1. Selection / position bias. Offline you train and evaluate on logged impressions ranked by the old model, so AUC measures "agreement with old model." A new model that genuinely surfaces different items gets penalized offline by the missing labels for the items it would surface.
  2. Calibration shift. AUC is calibration-invariant. If the new model is better-ranked but worse-calibrated, downstream consumers (auction, multi-task combination, business rules) make worse decisions.
  3. Multi-task interference. AUC was on click only. The new model raises click but lowers the other heads (like, share, complete) used in the combined score. Look at per-head deltas in A/B and per-head AUC offline.
  4. Distribution shift. Train data is from time T-7; you serve at time T. Trends drift.
  5. Engagement-bait failure mode. Higher predicted CTR comes from clickbait that hurts dwell, satisfaction, or downstream retention.
  6. Cold-item starvation. The old model had implicit cold-item priors (calibration, exploration); the new model doesn't, and the corpus gradually concentrates on a narrower set.
  7. Bug. Always check: feature parity offline-vs-online, no leakage, no stale features, prediction logging matches scoring.

The diagnostic protocol is: check feature-parity diffs first, then look at A/B segments by traffic source, item age, user tenure; check calibration; then go back to offline replay with IPS to estimate counterfactual lift.

Q4. Why does an MMoE outperform a shared-bottom multi-task model?

In shared-bottom, all tasks compute their head from one trunk representation. The trunk's gradient at each step is a weighted sum of per-task gradients; if tasks have negatively correlated labels (e.g. fast-click vs long-watch), those gradients destructively interfere and the trunk learns a weak average. In MMoE, each task has its own gating network selecting a soft mixture over N expert MLPs. Tasks can specialize on different experts — the negative correlation gets expressed as the two tasks routing to disjoint experts, and gradient interference at the parameter level disappears. Empirically this matters most when the tasks have (a) different positive rates and thus different gradient scales, and (b) different feature dependencies. CGC/PLE pushes this further by giving each task its own private experts plus shared experts, which helps when conflict is severe. The honest caveat: MMoE adds parameters, and on very tightly-correlated tasks (e.g. p_click and p_dwell on the same item) shared-bottom can actually win because the inductive bias of "share representation" is correct.

Q5. How do you debias position effects in a learned ranker?

Position bias is the confound that items at the top get clicked more regardless of relevance, so naively trained rankers learn to mimic the previous ranker rather than learn relevance. Two correction families:

(1) Examination hypothesis / IPS. Decompose click = examine × relevant. Estimate p(examine | position) — typically from a small "swap" experiment where you randomly permute a few positions for ε% of traffic, then fit a position propensity curve. At training, weight each click loss by 1/p(examine | position). Unbiased; high variance for low-position items.

(2) PAL (Position-Aware Learning). Add position as a feature into a separate "bias" head. Total prediction = relevance_head(features) + bias_head(position). At serving, fix position to a constant (say "no position" or position 1). The model offloads position-dependent variance into the bias head, leaving a clean relevance head. Used in production at Huawei, Pinterest, and elsewhere because it's lower-variance than IPS and trivial to deploy.

(3) Combine with calibrated logging. Always log the position the impression was at, plus optionally a propensity if you randomized. Without this, no debiasing is possible.

Sr-Staff nuance: position is just one bias. Selection bias (only items the old policy showed are in your data), trust bias (users trust the system's first item), and presentation bias (different surface treatments) all interact. Debiasing one without the others can shift the system to a new biased equilibrium, not an unbiased one.

Q6. What's the tradeoff between in-batch negatives and explicit hard negatives?

In-batch negatives are free — you reuse the items already loaded in the batch as negatives for each positive. Cheap, scales with batch size. Two problems: (a) popularity bias — popular items are over-represented as positives so they're over-represented as negatives, and the loss systematically pushes them down; YouTube's logQ subtraction (subtract log(sample frequency) from logits) corrects this. (b) Easy negatives — random items from the batch are usually trivially distinguishable from the positive, so the model gradient signal saturates and the model under-discriminates among similar items.

Hard negatives are items the current model scores high but are not positives. They produce strong gradients and force the model to refine fine-grained distinctions. Two risks: (a) false negatives — items mined as "hard negatives" may actually be positives the user just hasn't seen; this poisons the loss. (b) Cost — mining hard negatives requires either a previous-version model to generate them or expensive on-the-fly retrieval.

Production recipe is almost always a mix: large in-batch negative pool (with logQ correction) for coverage and easy distinguishability, plus 1–5 mined hard negatives per positive (usually top-100 from a previous model, sampled with some randomness, filtered for known positives in the user's history). MoCo-style cross-batch negative queues are a popular intermediate — bigger negative pool than the batch without per-step extra work.

Q7. Walk me through how HNSW works and when you'd pick it over IVF-PQ.

HNSW is a multi-layer proximity graph. Each point sits in layer 0; with exponentially decreasing probability, it also sits in higher layers. Within each layer, every node has up to M edges to its closest neighbors. Search starts at the top entry point, greedily walks to the neighbor closest to the query, descends one layer when it can no longer improve, and at layer 0 performs a beam search of width efSearch to collect top-K. The intuition: the upper layers are like long-distance highways, the bottom layer is local roads. Build is O(N log N), query is O(log N) on average. Knobs: M (graph degree, controls memory and recall), efConstruction (build-time beam width, controls graph quality), efSearch (query-time beam width, controls recall vs latency).

IVF-PQ first clusters all vectors into nlist coarse Voronoi cells (k-means). At query time, it visits the nprobe nearest cells. Within a cell, vectors are stored in product-quantized form: each d-dim vector is split into m sub-vectors, each sub-vector is replaced by the cluster ID (out of K=256) of its nearest k-means centroid in that subspace. So each item is m bytes. Distances are computed via per-query precomputed lookup tables, very cache-friendly.

Pick HNSW when: corpus fits in RAM (≤ few hundred million for typical d=128), latency must be very low and predictable (~1ms), recall must be very high (≥ 95%), and memory budget is generous. It's the default for everything from ad ranking to in-doc embedding lookup.

Pick IVF-PQ when: corpus is huge (≥ 1B), memory is the bottleneck, you can tolerate a slight recall hit (or refine top candidates with exact distance after IVF-PQ shortlist). DiskANN is the disk-resident variant for "1B vectors on a single box." Many production systems do both: IVF-PQ for the very long tail with a refinement pass against full vectors for the top-K.

Q8. Your retrieval layer returns the same 1000 items for everyone. What's wrong?

Classic symptom of collapsed personalization. Likely causes, ranked:

  1. User tower under-trained or under-fed. The user tower output may be near-constant — check the variance of user embeddings across users. If it's low, the model isn't conditioning on user features. Common bug: user features have wrong dtype, are zeroed, or the user-id embedding wasn't restored from checkpoint.
  2. Severe popularity bias. Without logQ correction or random negatives, the model converges to "rank popular items high" and the user signal is washed out.
  3. Hot ANN cache. If your serving caches the top-K of the global query (no user vector), you'd see this.
  4. Wrong feature serving. User features at serving time aren't the ones the model trained on — the user tower is effectively running on zeros.
  5. Index issue. The ANN index was rebuilt with stale item embeddings while user embeddings drifted; everyone's nearest neighbors degenerate to the most common items in embedding-space.
  6. Filter collapse. A safety filter or business rule cuts out 99.9% of candidates, and the same surviving 1000 are returned to everyone.

Diagnostic plan: log user embedding variance, log per-user candidate-set Jaccard similarity, sample 100 users and inspect their top-10 candidates and embeddings. The Sr-Staff move is to have these as standing dashboards before the bug ever happens.

Q9. How do you calibrate a multi-task ranker where each task has different positive rates?

Each task head needs its own calibration because:

  • Positive rates differ by orders of magnitude (click 5%, share 0.1%, follow 0.02%).
  • Negative downsampling, often per-task, distorts predicted probabilities differently per head.
  • Multi-task gradient interference pulls each head toward an "average" calibration that fits no single task.

The pipeline:

  1. For each head, compute predicted probabilities and labels on a held-out, unbiased (or IPS-corrected) calibration set — distinct from the training set.
  2. Fit a per-head monotonic calibrator: Platt scaling (logistic regression on the logit) for low-data heads; isotonic regression for high-data heads where you want a flexible monotonic mapping. Temperature scaling (one scalar per head) is a stable fallback when data is very limited.
  3. If you used negative downsampling at rate r, recover the true probability before calibration: p_true = p_pred / (p_pred + (1 - p_pred) / r). Apply per task because sample rates may differ.
  4. Track ECE (Expected Calibration Error) and reliability diagrams per head, sliced by traffic segment (item age, user tenure, region) — calibration often drifts on slices.
  5. Recalibrate periodically (daily or per training run) because logging policy changes and data distribution shifts both invalidate old calibrators.

Sr-Staff nuance: in multi-task systems where the heads are summed into a serving score, miscalibration of one head propagates into the score combination. If p(share) is 5x too high, the share-weighted term dominates and the entire ranker drifts. Calibration is not optional — it's the glue that lets multi-task and multi-objective optimization actually work.

Q10. How would you migrate a DLRM-style ranker to a generative recommender like TIGER/HSTU? Risks?

This is the migration-of-the-decade question. The plan I'd defend:

Phase 1 — De-risk through shadow deployment. Train an HSTU-style model in parallel; serve it in shadow (predict alongside DLRM, log scores, do not affect served results). Validate offline-online correlation: does HSTU's predicted ranking agree with what DLRM produces in production? Where it disagrees, do the disagreements correspond to plausibly better items?

Phase 2 — Replace the ranker only. Keep the existing retrieval cascade. Swap DLRM with HSTU as the ranking model. A/B test with strict guardrails on per-task heads, calibration, and long-term metrics. This isolates whether HSTU itself adds value, separate from any retrieval changes.

Phase 3 — Collapse retrieval into HSTU (if it pencils). Once the ranker is HSTU and stable, evaluate generative retrieval (TIGER-style semantic IDs or HSTU's joint retrieval head) to replace some retrieval sources. Likely keep some specialty sources (e.g. spatial / freshness / safety-filtered) outside the model — generative retrieval doesn't naturally compose with hard constraints.

Phase 4 — Scale up. Run scaling-law experiments to find the sweet spot of model size vs serving cost. HSTU's appeal is precisely that it scales like an LLM, so spend the compute.

Risks:

  • Latency. Beam search is slower than ANN retrieval. May force you to keep the generative model ranker-only.
  • Filtering / business rules. Hard to inject mid-generation. May need a post-generation filter that occasionally returns < K items if too many are filtered out — design for graceful degradation.
  • Cold items. Semantic IDs help, but if the RQ-VAE wasn't trained on the cold item's content type, you're back to no signal.
  • Eval comparability. Different model = different gradients = different miscalibrations. Don't compare AUC across architectures naively; rebuild calibration and re-set serving weights.
  • Cost. HSTU at scale is more compute than DLRM at the same accuracy tier; the bet is that you spend it once and get scaling-law lifts that DLRM can't match.
  • Org risk. The ranker is the highest-value model in the company. Migration is a multi-quarter effort with executive visibility. The plan above gives clear "kill switch" points (after each phase) so leadership stays comfortable.
  • Drift in semantic IDs. If RQ-VAE codes shift between retrains, item identity in the generative model becomes unstable. Either freeze the codebook or version it carefully.

The Sr-Staff framing: this is a 6–12 month bet, not a refactor. The win condition is not "HSTU beats DLRM in offline metrics" — it's "we have a system whose accuracy improves with compute, so we can keep winning by buying GPUs." The DLRM ceiling is set by sparse embedding tables; HSTU lifts that ceiling.

Industry-paper deep-probes (added 2026-05-13)

Q11. Why does HSTU replace softmax in attention with a point-wise SiLU gating?

Two reasons. First, numerical and scaling behavior. Softmax's denominator normalizes over the entire sequence, so a single high-attention token can saturate the distribution and the resulting representation depends heavily on sequence length. Industrial recsys sequences are very long (10K+ items) and have heavy-tailed action distributions; softmax over them becomes brittle. Point-wise SiLU $\phi(QK^\top) \cdot V$ has no global normalization, so attention is locally calibrated and scales cleanly. Second, serving cost: softmax requires the full reduction across keys (you can't stream the dot products); point-wise can. M-FALCON inference exploits this. The paper reports 285× FLOP reduction at serving vs the equivalent softmax-attention variant. Interview probe answer: it's not just speed — softmax's implicit length-dependent normalization breaks the scaling behavior the paper wants.

Q12. Walk me through TWIN vs SIM. Why does embedding consistency matter so much?

SIM's General Search Unit (GSU) and Exact Search Unit (ESU) are trained separately: GSU uses its own light embeddings (often just category indicator vectors), ESU has the main DIN-style embeddings. Result: GSU's top-K is not what ESU would have chosen — it's just what GSU's lightweight scorer thinks is close. So you're not retrieving the right top-K; you're retrieving the GSU-approximation of the right top-K, then ranking that. The retrieval bias is uncorrectable downstream.

TWIN's fix: GSU and ESU share embeddings. GSU uses a compressed-projection scoring function on the same embedding space ESU uses; the compression is a linear map that's cached per history item. Now GSU's top-K is a true subset of what ESU would rank highly — the retrieval is correct, just done faster. The Kuaishou paper reports +1.6% Watch Time online from this single change at the same FLOP budget. Bar-raising answer: "any two-stage retrieval has to ask the question — is your first stage approximating the second, or doing something different? TWIN realized the answer to that question is the entire engineering problem."

Q13. Walk me through Monolith's collisionless hash table. Why do collisions kill recsys at the long tail?

Standard embedding tables size $V$ rows for $N \gg V$ IDs, hashing collide many IDs into one row. For popular IDs this is fine: their gradient signal dominates and the embedding is meaningful. For long-tail IDs colliding with popular ones, the gradient update is dominated by the popular ID's gradients (because that ID is in the batch 100× more often), so the long-tail ID's embedding effectively becomes the popular ID's embedding minus epsilon — never learning its own identity. Result: new and cold items get systematically misranked.

Monolith uses cuckoo hashing: each ID has two candidate slots from independent hash functions; on collision, the existing entry is "kicked out" to its alternate slot, potentially triggering a chain. The table can be sized exactly to the number of unique IDs — no collisions, by construction. Every ID gets its own row with its own gradient. The paper measures +1% engagement just from collision elimination — that's enormous, larger than most architecture changes. Interview probe: "what's the failure mode that gradient signal averaging causes?" — answer is the long-tail dilution above.

Q14. PLE vs MMoE — when do you reach for PLE? What's the seesaw phenomenon?

Seesaw phenomenon: in MMoE, all experts are shared across tasks. Gradients from task A flow back through all experts; gradients from task B flow through the same experts. When tasks conflict (e.g., predicted CTR ↑ via click-bait vs predicted satisfaction-survey ↑), training task A's loss degrades task B's accuracy, and vice versa. You can see this in training curves: one task's loss is improving while the other's is regressing — "see-saw."

PLE's CGC layer adds task-private experts: shared experts are still in the gate's option set, but each task also has its own private experts that only it can use. Private experts get gradient only from their own task's head, so task B can't pollute task A's private experts. The shared experts are still subject to interference but the per-task representation is protected.

Reach for PLE when: (a) tasks measurably conflict in your data (seesaw visible in MMoE training), (b) you have enough parameter budget for private experts. The 2020 RecSys paper reports +2.3% VTR at Tencent video; the Sr-Staff bar is to know that PLE is the default in 2024+ production multi-task recsys, not MMoE.

Q15. What does PEPNet do differently from MMoE/PLE? When does multi-domain matter?

MMoE/PLE handle multi-task over a single domain. PEPNet handles multi-domain: same backbone serving many distinct surfaces (Kuaishou main app, Kuaishou Lite, international app, search results, profile page) where the underlying catalog is shared but user intent and engagement patterns differ. The trick: each user has a personal embedding that, instead of being concatenated as a feature, gets projected into gate vectors that modulate every hidden layer of a shared backbone. Domain-specific PEPNet plug-ins inject domain gates the same way. Result: shared backbone with billions of params is personalized per user and per domain via small gate networks, beating per-domain independent models when domains share catalog and audience. Reach for PEPNet when: 5+ surfaces, shared catalog, per-surface specialization would be too expensive to train and maintain separately.

Q16. Walk me through the Wukong scaling-law setup. Why is this paper a big deal?

Wukong stacks N FMB+LCB blocks; varying N (and embedding sizes) sweeps a compute axis. The paper plots loss-vs-compute and loss-vs-params and fits power laws (loss = a · C^-b + irreducible), getting clean Chinchilla-style scaling on industrial recsys data. This is the first time recsys has exhibited LLM-style scaling laws in the deep-ranker (not just sequence) setting.

Why it matters: historically recsys ROI plateaus quickly with model size because (a) sparse embeddings dominate parameter count and they don't benefit from being bigger past a point, (b) feature interaction architectures saturate around 4–8 layers in practical CTR benchmarks. Wukong's scaling-law behavior implies that with the right architecture you can keep buying accuracy with compute — same value proposition LLMs offer. Together with HSTU's scaling laws (on the sequence/generative side), this changes the calculus on what compute to spend on recsys. The Sr-Staff framing: "for 5 years we thought recsys had hit the engineering ceiling. Wukong + HSTU say it hasn't — we just had the wrong architecture."

Q17. How would you design Kuaishou's short-video FYP given the TWIN-V2 + OneRec + PEPNet components?

This composes the Kuaishou stack. Components:

  • Retrieval: multi-source. (a) Two-tower over recent watch history + content embeddings (visual + audio + text). (b) PinSAGE-style graph retrieval over user-creator and user-tag bipartite graphs. (c) Trending and live-streaming injection.
  • Long-sequence ranker: TWIN-V2 over lifetime watch history. Offline hierarchical clustering (daily refresh) gives the GSU; online ESU runs target attention over ~100 surviving items.
  • Multi-task heads: predicted watch-time, like, share, completion, skip<5s, follow. PLE-style architecture so task interference is minimized.
  • Multi-domain personalization via PEPNet: same backbone serves Kuaishou main, Kuaishou Lite, international; per-user + per-domain gates modulate every layer.
  • Generative ranker (OneRec) on a slice of traffic: encoder-decoder transformer over the user's recent Semantic-ID history, generates the next-video Semantic ID. Beam search at serving. Reward model trained on watch-time + like + share alignment.
  • Real-time learning: Persia trains the dense path synchronously, sparse embeddings asynchronously; second-level freshness so 1-min-old uploads enter retrieval candidates quickly.
  • Diversification re-rank: DPP or MMR over creator, topic, format; frequency caps; live-stream balance.
  • Calibration + business-objective combination: per-task isotonic calibrators; final score is product-tuned weighted sum.

The Sr-Staff probe is the handoff between TWIN-V2 (cascade ranker) and OneRec (generative). Likely answer: A/B by user bucket; OneRec on traffic where its scaling-law win exceeds TWIN-V2; TWIN-V2 on the rest plus all surfaces where filterability matters more.

Q18. Why is FinalMLP / FinalNet a surprising result?

10 years of CTR-model research focused on increasingly elaborate explicit-interaction structures: FM, CIN, DCN, AutoInt, attention, etc. FinalMLP (Mao 2023) showed that a pure two-stream MLP, with feature-aware gating in one stream and feature-aware bilinear in the other, beats nearly all of them on the FuxiCTR benchmarks. The surprise: feature-aware non-linearity matters more than explicit polynomial-feature-crossing structure. Practically: if you're building a CTR model from scratch in 2025 and your dataset isn't huge, start with FinalMLP-style. If you're at FAANG scale where you can afford 100× more parameters, DLRM / DCN-V2 / HSTU still have niches because their structural priors help at extreme scale. The bar-raising answer is: "what's the right architecture is data-distribution-dependent. The FinalMLP result tells us we over-fit our model search to certain benchmarks; in industrial deployment, the differences between top architectures are small relative to feature engineering and calibration."

Q19. Explain CAN's co-action units. Why static dot products aren't enough?

DLRM's interaction is a static dot product ⟨user_emb, item_emb⟩ — one scalar capturing how "compatible" the pair is. This is enforced 2nd-order and the inductive bias is "compatibility decomposes into latent-factor similarity." For some feature pairs that's right; for others it's catastrophically wrong (think user-history × target-item interactions, where the same user×item pair has very different meaning depending on which history slot we're looking at).

CAN (Alibaba KDD 2021) replaces the static dot product for selected high-value pairs with a co-action unit: a small MLP whose weights are dynamically generated from one of the two features' embedding, applied to the other. Effectively each pair gets its own learned interaction function with $O(10^2)$ parameters, vs DLRM's 1 parameter (the bias of the dot product). The interaction lookup is more expressive but only applied to "co-action features" (manually chosen high-value pairs like user×target-item); other interactions use cheaper DLRM-style dot products. Production at Alibaba; widely cited as the canonical solution when DLRM's interaction floor isn't enough.

Q20. What does OneRec's reward model do that next-item prediction can't?

Next-item prediction trains on what the existing system showed and what users did — both confounded by the existing recommender's biases. If yesterday's model only showed users clickbait, today's next-item-prediction model learns to predict clickbait clicks. There's no signal for "what would the user have wanted if they'd seen it?" or "what produces watch-time vs just clicks?"

OneRec's reward model is a separate model trained on user feedback signals (watch-time, like-rate, share-rate, retention) to score (history, generated-video) pairs by an explicit business-objective reward $r(s, a)$. The generative model is then DPO-style preference-tuned: for each history $s$, sample multiple completions, score them with $r$, and update the generator to prefer high-$r$ completions over low-$r$ ones via a Bradley-Terry-style log-loss. This is RLHF for recsys — same trick that aligned ChatGPT, applied to short-video generation. The win is twofold: (1) you can target metrics that are off-policy from the data (watch-time isn't what users clicked, but it's what business cares about); (2) you can correct for the existing system's biases by training the reward model on randomized exploration data.

Q21. How is TransAct different from BST? When would you pick which?

BST is a transformer over the full recent history (say last 100 items); it spends model capacity learning intra-history relationships. TransAct splits the modeling: a short-term transformer over the last ~20 actions (captures session intent, which is where the freshest signal is) plus long-term aggregated features for the rest of the history (count of saves in last 90 days, distinct topics interacted with, etc.). The split's win: in Pinterest's data, the marginal value of history items 20+ is small for session-intent prediction, and a transformer that has to attend to all 100 wastes FLOPs on noise.

Pick TransAct when latency is tight and recent-session intent dominates engagement (Pinterest Homefeed, Twitter timeline). Pick a full-history transformer (BST → TWIN → HSTU lineage) when long-range patterns matter (Kuaishou short-video where rewatching favorites is common, Alibaba where multi-month shopping intent matters). TransAct also documents short-form: action-type tokens (save, click, hide, close-up) injected at every history position so the transformer knows the kind of engagement that produced the pin id, not just the pin id itself.

Q22. Why would you pick HSTU over a much larger DLRM at the same FLOPs?

Two reasons. First, scaling laws: DLRM's accuracy-vs-parameters curve plateaus by a few billion non-embedding parameters because the sparse-embedding tables dominate model capacity. HSTU exhibits clean power-law scaling — every doubling of compute reliably yields fixed loss reduction. So at the same FLOPs today DLRM may match HSTU, but at 10× the compute next year HSTU is decisively ahead. Second, generative joint retrieval+ranking: HSTU collapses two stages of the cascade into one, which is impossible with DLRM. The unified model means consistent representations across retrieval and ranking, no quality gap between stages, and one model to deploy/monitor instead of two. Caveats: HSTU's serving latency on long-context generation isn't yet at DLRM's level for all surfaces; mixed deployment (HSTU on some surfaces, DLRM on others) is the current Meta reality.

Q23. Walk me through Pinterest's PinnerSAGE. Why multiple embeddings per user?

Most two-tower retrieval gives each user ONE embedding. Problem: Pinterest users typically have multiple distinct interests (cooking + woodworking + fashion); a single embedding averages them, and nearest-neighbor lookup pulls items closest to the average, which may not match any actual interest. PinnerSAGE clusters each user's recent actions via Ward hierarchical clustering, takes K cluster centroids as K user embeddings, and at retrieval runs K separate ANN queries — one per cluster — taking K small candidate sets that span the user's diverse interests. Diversity emerges naturally from the clustering, no MMR post-hoc.

Production at Pinterest 2020+; the paper reports significant repin gains on Homefeed at launch. The deeper lesson: for any user with diverse-interest profile, one embedding loses; the question is how to derive multi-cluster embeddings cheaply (Ward clustering is offline, action-stream-based, regenerated daily).

Q24. What's the "embedding inconsistency" trap that TWIN fixes? Why is it the bar-raiser answer?

Already covered above (Q12) — the key signal is that you understand two-stage retrieval's correctness depends on stage 1 approximating stage 2's relevance function, not having its own. Most candidates know SIM and TWIN as "long-sequence methods" but miss the architectural argument. The bar-raising answer: "this is the same problem distillation has — you can only distill a teacher correctly if the student's representation space can express the teacher's preferences. SIM's GSU and ESU are like two independent models pretending to be one; TWIN unifies them in one embedding space and uses score-compression rather than feature-compression."

Q25. Design a real-time learning system for a news-feed ranker.

Constraint: news article relevance decays in hours, not days. Components:

  • Event pipeline: clicks, dwell, likes, shares, hides → Kafka → streaming aggregator → online feature store + training stream.
  • Monolith-style training: parameter server with collisionless cuckoo-hashed embedding tables. Trainer continuously consumes the event stream, computes gradients, pushes updates to PS. Serving stack reads PS within seconds.
  • Async embeddings, sync dense: sparse embeddings tolerate staleness (Persia argument); dense MLP must be trained synchronously for stability.
  • Bandit exploration on new articles: first hour of article life, allocate ~5% of impressions to exploration buckets; cold-start article embeddings get formed from real interactions quickly.
  • Hot-content cache: top-trending articles cached at edge; ranker doesn't need to score the same top-100 articles for every user.
  • Calibration drift monitor: real-time logging of (predicted, observed) per-task pairs; alert if Brier score drifts > 5% in any hour.
  • Roll-forward strategy: training-serving lag < 30s p99; if PS update lag exceeds threshold, alert. Don't bother snapshotting embeddings — too large; instead checkpoint dense layers daily and replay-from-event-log for embeddings.

Probe: "how do you handle a viral article that changes from 100 RPM to 10K RPM in 5 minutes?" — answer: hot-content cache + asynchronous gradient updates from the explosion of new events; the architecture is built to absorb this.

Q26. Why is LiRank a comprehensive industrial paper? What's residual cross-net?

LiRank (Borisyuk 2024) is unusually candid about LinkedIn's full production stack: ranker architecture, multi-task heads, calibration pipeline, latency budgets, and ablation studies. Most industrial recsys papers focus on one component; LiRank covers the system. Worth reading end-to-end for "what does a 2024 industrial feed ranker actually look like."

Residual cross-net: variant of DCN-V2 that adds a residual connection at each cross-layer, $x_{l+1} = x_0 \odot (W_l x_l) + x_l + x_l$ (note the extra $x_l$ residual on top of the standard formula). Result: deeper cross-nets train stably without gradient vanishing. LiRank uses this with 8+ cross layers, whereas standard DCN-V2 typically caps at 3–4.

Q27. How does Spotify's calibrated recommendations work, and when is it the right tool?

Steck 2018 (Spotify): rerank the top-N so the genre distribution of the served list matches the user's historical genre distribution. Formally: minimize a KL-style divergence between served genre distribution and target genre distribution, subject to maintaining list relevance score above a threshold. Implementation: a marginal-relevance algorithm that selects items one-by-one, at each step picking the item that maximizes a weighted combination of (relevance score, KL-improvement from adding this item).

When the right tool: domains where users have multi-modal preferences and the system tends to over-concentrate on the dominant mode (Spotify users like 70% pop, 30% jazz; a relevance-only model gives 100% pop). Calibrated reranking enforces the long-tail without manual diversity rules. Less useful when users have unimodal preferences (TikTok mostly).

Q28. Compare TIGER's Semantic IDs vs HSTU's ID-tokens. When is each better?

TIGER's Semantic IDs are content-derived: an RQ-VAE quantizes item embeddings into $L$ codes from learned codebooks. Two items with similar content get similar prefixes. Pros: zero-shot generalization to new items (compute Semantic ID from content at upload); model size scales independently of corpus size (codebook is fixed). Cons: codebook collapse and drift; content encoder quality bottlenecks the whole pipeline; not all items have rich content (consider e-commerce where item id is mostly behavior).

HSTU's ID-tokens treat item IDs directly as vocabulary tokens, with sharded embeddings. Pros: every item has a unique token, no collisions or codebook issues; the architecture matches Meta's existing TorchRec infra; scales to billion-item vocabularies as proven in production. Cons: cold-start needs a content-tower bolt-on to provide initial embeddings; vocabulary grows with corpus, so models must support sharded embedding tables (which Meta has invested heavily in).

Reach for TIGER-style when: cold-start dominates (news, products, content with rich text/image), and you can afford the RQ-VAE training pipeline. Reach for HSTU-style when: catalog is relatively stable, you have warm interaction data, and you're already running TorchRec-class infra. The 2026 production answer is often both: HSTU as ranker with item-ID tokens, TIGER-style retrieval head with Semantic IDs for cold-start.

Q29. Why is the SIM family more popular in China than the US?

Three reasons. (1) Catalog scale and intent depth: Chinese e-commerce (Alibaba) and short-video (Kuaishou, Douyin) have user histories that span years and thousands of items per user, vs typical Western data where median user history is much shorter. Long-sequence methods have bigger lifts when the data is actually long. (2) Engineering culture: Alibaba and Kuaishou publish architectural papers more freely than Meta, Google, or Pinterest, so the SIM lineage is well-documented and replicated within China. The same problems exist at Meta but the solutions are internal. (3) Latency budgets: Chinese mobile-first products tolerate slightly larger ranking latency budgets, accommodating ETA/SDIM-style sub-linear long-sequence methods that need a bit more compute. The convergence in 2024–2026: HSTU and OneRec are Meta and Kuaishou independently arriving at generative end-to-end formulations; the "long-sequence" problem is being subsumed by generative.

Q30. The "is the cascade dead" question. What's your honest take?

Not in 2026, but the next 2–3 years will be decisive. Evidence the cascade is alive: (a) every major surface still uses retrieval+ranking, including at Meta which has HSTU available. (b) Hard business rules and policy filters compose more naturally with cascade. (c) ANN retrieval at sub-10ms is hard to beat for the retrieval stage. Evidence the cascade is shrinking: (a) HSTU+OneRec both replace at least one cascade stage. (b) Scaling laws apply to generative formulations, not to the cascade. (c) The engineering cost of maintaining the cascade (two models, two training pipelines, two calibration pipelines, two A/B systems) is starting to look high relative to a unified generative model. My bet: by 2028, the top 5 platforms have generative-first ranking and retrieval-only specialty sources; the cascade survives for ads (filterability is constitutional), long-tail platforms (can't afford generative scale), and any surface where business rules are explicit. Hedge: I'd be unsurprised if a generative model that ingests filter constraints natively (via constrained decoding or via training-time conditioning on filter labels) appears in 2027 and eats the remaining cascade.