Lists of films, search results, suggested songs, "you might also like": all of these are ranked lists. Someone, or something, decided what comes first. This part explains the general ideas behind ranking and recommendation in plain words. It describes standard techniques only. It makes no claims about how any particular company's system works, because those details are private and change over time. Each section has a plain layer and an Expert view.
Step one: score, then sort
The score is often a weighted sum: each signal is multiplied by a weight that says how much it matters, and the results are added. Sorting is then a solved problem (see the sorting part of this series).
- FeedbackLikes, ratings, saves
- FreshnessHow new the item is
- MatchHow well it fits what was asked
- PopularityHow many people chose it
Expert viewScores in practice
The weights can be set by hand or learned from data (see the machine learning part). Scores are usually only meaningful for comparison: a score of 0.8 does not mean 80 percent of anything. Real systems often work in two stages: a cheap method picks a few hundred candidates from millions, then a more expensive model ranks only those. Only the top of the list is ever seen, so small differences near the top matter most.
Takeaway. Cheap filtering first, careful ranking second, so the costly step handles few items.
- User to App The user opens a page that shows a list
- App to Ranker The app asks for the best items for this user
- Ranker (to itself) It picks candidates, scores each one and sorts by score
- Ranker to App (reply) It returns a short ordered list
- App to User (reply) The app shows the list, best first
- User to App A click is feedback that can improve later scores
Takeaway. The ranking service turns a request into a scored, sorted list and learns from the reaction.
Similarity: taste as numbers
Close together
- Both people rate the same films high and the same films low
- Their lists of numbers point in nearly the same direction
Far apart
- One loves what the other dislikes
- Their lists of numbers point in different directions
The same trick works for items: describe a film by numbers (how much action, how much comedy) and find films whose numbers are near a film you liked.
Expert viewMeasuring closeness
Each person or item becomes a vector, a list of numbers. Cosine similarity measures the angle between two vectors: it is 1 when they point the same way, 0 when they are unrelated (at right angles), and negative when they point in opposite directions. It ignores length, so someone who rates everything high and someone who rates everything low can still match in direction. Euclidean distance, the straight-line gap, is another common choice. With many items, vectors are mostly empty (most people rate few films), so systems store only the non-empty entries.
People who liked this also liked that
Expert viewCollaborative and content-based
This counting idea is part of collaborative filtering: use the behaviour of many users to predict one user's taste, without looking at what the items are. Content-based filtering does the opposite: recommend items whose own features resemble things you liked. A popular collaborative approach, matrix factorisation, imagines a big table of users against items with many blanks, and finds a small set of hidden "taste dimensions" for every user and item such that combining them approximately fills in the table. The blanks are then predicted. Hybrids combine both families.
The PageRank idea
The usual picture is a random surfer who keeps clicking links at random. Over a very long time, the pages the surfer visits most often are the ones with the highest importance.
Expert viewDamping and convergence
In the standard PageRank formulation, at each step the surfer follows a random link with probability d (the damping factor, commonly chosen near 0.85 in descriptions of the method) and otherwise jumps to a random page. The jump handles pages with no outgoing links and prevents the surfer being trapped in a small cluster. The scores are the steady-state probabilities of this process. They can be found by power iteration: start with equal scores and repeatedly apply the update, which converges, so the changes shrink until they are negligible. The same idea applies to any network of links, not just web pages.
When the system has nothing to go on
A new user
- No history, so nothing to compare with
- Common fixes: ask a few questions, show popular items
A new item
- No one has rated it yet
- Common fixes: use its description and features
Feedback loops and bubbles
Popular items get seen, so they get more clicks, so they become more popular. Newer or niche items may never get a fair chance. If you are shown only what resembles your past choices, your view can narrow: a filter bubble.
A recommender knows what I truly want.
It estimates from past behaviour, and past behaviour is only part of the picture.
A high rank means high quality.
A high rank means a high score under the chosen signals, which may reward attention more than quality.
Expert viewBias, explainability and privacy
Popularity bias is the tendency to over-recommend what is already popular. Training data reflects past behaviour, so it can carry human and historical bias forward, and groups that are under-represented in the data may be served worse. Mitigations include adding exploration (occasionally showing less certain items), diversifying results, and auditing outcomes by group.
Explainability helps users and reviewers: "recommended because you watched X" is easier to check than an unexplained score. Recommenders also use personal data, so data minimisation, clear consent and letting users reset or remove their history are good practice. Privacy law varies by place and I do not give legal advice here.
Is it any good?
- Offline testHide some past choices and check whether the system would have predicted them
- Online testCompare versions with real users, such as an A/B test
- Look past clicksAsk whether people were helped, not just attracted
- Check fairness and varietyLook at who and what is shown
Expert viewEvaluation traps
Offline evaluation uses historical data and standard measures such as precision at k (how many of the top k were relevant) and ranking quality measures that reward putting relevant items first. Its weakness is that the history was itself shaped by an earlier system. Online evaluation measures real behaviour but needs care: short-term clicks can reward attention-grabbing items over useful ones, so teams also track longer-term signals such as satisfaction, returns and complaints. No single number captures "good".
Try it by hand
Score three films with weights: story 3, acting 2, pace 1. Ratings out of 5.
| Film | Story | Acting | Pace |
|---|---|---|---|
| Film A | 5 | 3 | 2 |
| Film B | 4 | 5 | 4 |
| Film C | 3 | 4 | 5 |
Score = 3 x story + 2 x acting + 1 x pace. Work out all three and sort. (Film A: 15 + 6 + 2 = 23. Finish B and C.) Then change the weights to favour pace and see whether the order changes.
A ranking is a score plus a sort, and the weights are a choice someone made.
Frequently asked questions
Does a recommender understand what I like?
No. It finds patterns in numbers, such as ratings and clicks, and predicts from them.
Why do I keep seeing similar things?
Systems often favour what resembles past choices, which can narrow results unless variety is added on purpose.
What is the damping factor in PageRank?
The probability that the random surfer follows a link rather than jumping to a random page.
How can a recommender be unfair?
If its data under-represents some people, or reflects past bias, it may serve them worse unless it is checked.