[son of anton]
Recommendation & search

Information retrieval

site search, document search, semantic search

Return the most relevant documents for a query, within a latency budget.

Linear algebra
Probability & Bayes
Information theory
Foundations
TF-IDF and BM25 come from information theory and probabilistic relevance; dense retrieval lives in an inner-product space.
Frame the problem
Frame
Define relevance: clicks, judgments, or both. The latency budget decides the architecture.
Labeling & data collection
Data & labels
Click logs carry position bias. Graded judgments are expensive. Use both.
Modalities → vectors
Tokenization
word2vec & GloVebackground
Represent
Tokenisation and analysers for the lexical side; a text encoder for the dense side.
Split the data
Split
By query, never by document, or the ranker memorises documents.
Dumb baseline
TF-IDF + linear
BM25 & lexical search
Dense retrieval
Bi-encoder plus an ANN index. Train with in-batch negatives and hard negatives mined from BM25.
Metric learning
Two-tower retrieval & ANN
Hybrid
Union of lexical and dense candidates.
The funnel & cold start
Re-rank
LambdaMART on features, or a cross-encoder over the top k.
Learning to rank
Bi- vs cross-encoders
Model
BM25 is hard to beat. Ship it first.
Fine-tuning a pretrained model
Loss functions
Train
Contrastive loss for the bi-encoder; listwise for the ranker.
Ranking & recsys metrics
Embedding geometry & retrieval eval
Evaluate offline
Recall@k for retrieval, NDCG for the ranker. Sanity-check embedding geometry.
A/B testing & interleaving
Evaluate online
Interleaving.
Serving & release
Inference optimisation
Ship & monitor
Index refresh cadence. ANN recall against latency.
Mini Map