Ranking

Ranking is the machine learning task of putting a list of items, such as search results, products or videos, in order of how relevant or useful each one is likely to be.

Many AI systems do not produce a single answer; they put many candidates in order. A search engine decides which of millions of pages comes first, a shop decides which products to show, and a video app decides which clip plays next. Google's machine learning glossary defines ranking as a type of supervised learning whose goal is to order a list of items. Training a model to do this is usually called learning to rank. The training data is lists of items with relevance judgements, from grades given by human raters to signals such as clicks, and the model learns to order new lists the same way.

There are three broad approaches. Pointwise methods score each item on its own, which turns ranking into ordinary regression or classification. Pairwise methods learn which of two items should come higher. Listwise methods optimise a measure of the whole ordered list. The usual measures reward getting the best items near the top: normalised discounted cumulative gain (NDCG) gives most credit for relevant results in the first few places, and mean average precision is another common choice.

Search engines were the proving ground. Microsoft Research devised RankNet in 2005, a pairwise method, and Microsoft's Bing launched in 2009 using it. Yandex announced its own machine-learned ranking system, MatrixNet, in November 2009. In June 2010 Chris Burges of Microsoft Research published an overview tracing the line from RankNet to LambdaRank and LambdaMART, a version built on boosted decision trees; an ensemble of LambdaMART rankers won Track 1 of the 2010 Yahoo! Learning to Rank Challenge.

In practice ranking runs as a pipeline. Google's course on recommendation systems describes three stages. Candidate generation cuts a huge pool down fast; in YouTube's case, billions of videos become hundreds or thousands. A more precise scoring model then orders those candidates and picks roughly ten to show. A final re-ranking step applies rules the score alone does not capture, such as removing items the user disliked, favouring fresh content and promoting diversity and fairness. AI search tools and retrieval systems for chatbots use the same pattern: fetch broadly, then rerank carefully.

The practical lesson is that a ranker learns whatever it is rewarded for. A model trained on clicks learns what people click, which is not always what serves them best, and that is why the business rules in re-ranking exist. When a platform changes what its ranking optimises, what millions of people see changes with it.

Common questions

What is learning to rank?

Learning to rank is the use of machine learning to build models that put items in order of relevance, mainly for search engines and recommendation systems. The model is trained on lists of items with known relevance, such as ratings from human judges or user clicks. Once trained, it orders new lists it has not seen before.

What is the difference between ranking and classification?

Classification assigns each item a label, such as spam or not spam. Ranking cares about relative order: what matters is that the most relevant item comes first, not the exact score it gets. Pointwise ranking methods do treat the problem as classification or regression, but pairwise and listwise methods learn the ordering directly.

What is NDCG?

NDCG, or normalised discounted cumulative gain, is a standard measure of ranking quality. It gives credit for relevant results and discounts that credit the further down the list they appear, then scales the total against the best possible ordering. A perfect ranking scores 1.

How do recommendation systems rank items?

Most use several stages. A fast candidate generation step narrows a vast catalogue to hundreds or thousands of items, a more expensive scoring model orders those candidates, and a re-ranking step applies final rules such as removing disliked items or promoting fresh and diverse content.

Finding more

Search for "learning to rank", "LambdaMART", "NDCG" or "recommendation system candidate generation scoring re-ranking" to see how ranking models are built and judged. Reliable sources include Microsoft Research and Google developer documentation, the original papers from information retrieval conferences, and encyclopedia articles that cite them. Treat claims about how a particular platform ranks content with care unless they come from the company's own documentation or a regulator's findings.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.