Learning to Rank — When Machine Learning Takes Over Relevance

BM25 ranks by a fixed formula, but real search engines have hundreds of relevance signals — freshness, popularity, personalization, link quality, and dozens of text features — and no human can hand-tune how to weigh them all. Learning to rank hands that job to machine learning: train a model on examples of good and bad rankings, and let it discover the optimal combination of signals. This post is where search ranking becomes a machine-learning problem, and the bridge to the neural retrieval behind modern AI.

Posts 4–5 covered formula-based ranking (BM25) and how to measure it. This post is the next evolution: using ML (from the Machine Learning from First Principles series) to learn the ranking function from data. It’s how large-scale search actually ranks today, and it leads directly into the neural and embedding-based retrieval this blog covers elsewhere.

Why hand-tuned ranking hits a wall

BM25 (post 4) is one strong signal, but production relevance depends on many signals at once: - Text relevance — BM25 scores on the title, the body, the headings (each a separate signal). - Document quality — popularity, link authority, spam signals, freshness. - User/context signals — location, device, personalization, time, prior behavior. - Engagement — historical click-through and dwell time for this query-document pair.

A modern ranker might combine hundreds of such features. The problem: how do you weigh them? Is a fresh, popular, weak-text-match document better or worse than a stale, obscure, strong-text-match one? Hand-tuning the weights for hundreds of features is hopeless — the combinations are too many and the right trade-offs too subtle for human intuition. This is exactly the situation machine learning was made for (ML series, post 1): when the rules are too complex to write, learn them from examples.

Learning to rank: the ML formulation

Learning to rank (LTR) treats ranking as a supervised machine-learning problem. The ingredients map directly onto the ML series:

The subtlety that makes LTR its own topic is that the objective is a ranking, not a single prediction, and there are three ways to frame it: - Pointwise — predict an absolute relevance score per document (plain regression/classification), then sort. Simple, but it ignores that ranking is about relative order. - Pairwise — learn from pairs: for two documents, predict which should rank higher. This directly optimizes relative order and is a very effective, widely-used framing (the well-known LambdaMART family is pairwise/listwise). - Listwise — optimize the quality of the whole ranked list directly against a metric like NDCG (post 5). The most principled (it optimizes what you actually measure) and often the best-performing, though harder to train.

In practice, gradient-boosted trees (ML series, post 4) have long dominated learning to rank on the kind of tabular feature vectors described above — the same reason trees win on tabular data generally applies to ranking features. LTR is, for most of the industry, “compute good ranking features, then train a gradient-boosted ranker on relevance judgments.”

From learned ranking to neural retrieval

Learning to rank is the bridge from classical IR to the modern neural and embedding-based retrieval this blog covers, and seeing the progression clarifies the whole landscape:

The throughline across the whole progression is the same idea escalating: ranking is too complex to hand-specify, so learn it — first learning to weigh features (LTR), then learning relevance from text (neural), then learning representations of meaning (embeddings). Each step hands more of the relevance judgment to learned models. And crucially, these don’t fully replace each other: production systems layer them — BM25 for cheap candidate generation, learned ranking or neural rerankers for precision — which is exactly the hybrid, multi-stage architecture of modern retrieval and RAG. Learning to rank is where search stopped being a formula and became a machine-learning system, and it’s the direct conceptual ancestor of the retrieval stack behind today’s AI.

The throughline: production relevance depends on hundreds of signals (text, quality, freshness, personalization, engagement) that are hopeless to hand-weight — so learning to rank makes ranking a supervised ML problem: features per query-document pair, relevance judgments (post 5) as labels, and a model trained so its scores reproduce good rankings. Because the objective is order, it’s framed pointwise, pairwise (optimize relative order — the effective default), or listwise (optimize the whole list against NDCG — most principled), typically with gradient-boosted trees on tabular ranking features. LTR is the bridge to neural retrieval: from learning to combine features → neural ranking (learn relevance from text) → embedding/dense retrieval (relevance as vector similarity — modern RAG’s engine) → cross-encoder rerankers — the same idea escalating, layered in multi-stage hybrid systems rather than replacing each other.

Key takeaways

Further reading

Sources & References