Intermediate · 14

How recommendations work

"Because you watched...": how apps guess what you'll like next, from similar users to embeddings, and the loops that can narrow what you see.

7 min read · Tap underlined words for a definition

Every time a streaming app suggests a film or a shop shows "you might also like", a recommender system is at work. Its job is to guess how much you'd like things you haven't seen yet. There are two classic approaches, and most real systems blend them.

Collaborative filtering

Collaborative filtering uses only behaviour: who watched, rated or bought what. If you and another person loved the same five films, you'll probably like their sixth favourite too.

It needs no knowledge of what the items actually are. The crowd's patterns do the work.

Content-based filtering

Content-based recommenders look at the items themselves: genre, actors, ingredients, the words in an article. If you read lots of gardening pieces, it suggests more gardening.

It works even for brand-new items, but tends to serve more of the same.

Run itFind your taste twin
Edit anything, then run. Python runs in your browser.

Cosine similarity compares the pattern of ratings, not the totals. Change Ana's ratings and see who her new twin becomes.

Quick check

A collaborative filtering system recommends you a film. What is it mainly based on?

Users and items as embeddings

Modern systems learn an embedding, a list of numbers, for every user and every item. The numbers are tuned so that a user's vector sits close to items they like.

Nobody labels the dimensions, but they often end up capturing things like "cosy", "action-heavy" or "for kids". Recommending becomes finding the nearest items to you.

The cold start problem

A new user has no history; a new item has no ratings. has nothing to go on. This is the cold start problem.

Common fixes: ask a few questions at sign-up, fall back on popular items, or use content features until behaviour builds up.

  • Feedback loops: the system shows you things, you click some, and it learns from those clicks. Items it never showed can never earn clicks.
  • Over time this can narrow what you see, sometimes called a filter bubble.
  • Popular items get shown more, so they get more popular, while niche items struggle to be found.
  • Many systems deliberately mix in some variety and new items to keep exploring.
Quick check

Why can a recommender's own suggestions narrow what users end up seeing?

Before you drift off

  • Collaborative filtering uses similar people's behaviour; content-based uses the items' features.
  • Modern recommenders place users and items as embeddings in the same space.
  • Cold starts and feedback loops are the big challenges, and variety helps with both.

Terms in this lesson

Go deeper, free and open

That's the lesson

How recommendations work · 7 min

Finish & continue · Next level: AdvancedAttention is all you needAdvanced · 8 min

Spotted a mistake? Suggest an edit

Previous: How text becomes tokens