Go deeper · Ai at work

Why does the app think I want that?

Because it compared you with something. A recommendation system ranks items by guessing what you will pick next. It can look for items like the ones you chose before, or for people who chose like you. Its guesses come from what people clicked, watched or borrowed, and what it shows changes what people do next.

Grades 6+15 minutesLight math: counting and addingSimpler version for grades 3–5

What you will be able to do

Explain content-based and collaborative filtering, rank a small library collection both ways by hand, describe the cold-start problem, and explain how a feedback loop can narrow what people get to see.

Before you start

Before this: How can examples become a rule? Helpful: finding groups, since “readers like you” is a kind of similarity.

1 · You have already seen this

The row that says you might also like

Shops, video apps and library catalogs all put a short list of picks in front of you.

Open an online shop and a row of items appears before you search for anything. A video app lines up what to watch next, and a library catalog can suggest another book after you borrow one. Each list is short, because a screen only has room for a few.

Behind each list is a recommendation system. It gives every item a score for you, a guess at what you will pick next based on what people clicked, watched or borrowed, and shows the top of the list. The rest of this page shows how that works, lets you try it, and shows where it goes wrong.

2 · What happens, step by step

From past choices to a short list

A recommender in five steps. The next section goes deeper into steps 3 and 4, and the one after it into step 2. After the lab, one more section goes deeper into steps 1 and 5.

How a recommender works

Five steps

  1. 1 · Collect what people didThe system keeps a record of what people clicked, watched, borrowed or rated.
  2. 2 · CompareIt compares items, such as books that share topics, or people, such as readers who liked the same books. Most real systems mix both.
  3. 3 · Score every itemEach item the person has not tried yet gets a score for that person.
  4. 4 · Show the top of the listOnly a few items fit on the screen, so the highest scores are shown, best first.
  5. 5 · Learn from what happens nextWhat people choose from that list becomes new data for the next round.

Going deeper · steps 3 and 4

A recommender is a ranking machine

A video app, a music service, an online shop and a library catalog all face the same problem: too many items, too little screen.

You cannot show someone ten thousand books. You can show five. A recommendation system decides which five, and in what order. Its task is ranking: give every item a score for this person, then show the top of the list.

The simplest ranking ignores who you are: show the most popular items. That is a fair baseline, and a good one for someone the system knows nothing about. To do better, a recommender needs a way to compare. There are two classic ideas, and most real systems mix them.

Content-based filtering compares items. Each book has features, such as its topics. If you liked two mysteries, another mystery gets a high score. Collaborative filtering compares people. It ignores what the books are about and looks only at who liked what. If readers who agreed with you in the past loved a book you have not read, that book gets a high score. It is called “collaborative” because everyone’s ratings help everyone else’s recommendations.

Star ratings from six made-up readers (blank = not read yet)
ReaderThe Clockwork Fox
mystery, animals
Moonbase Maple
space, funny
Goal Line Ghosts
sports, mystery
Dragons Skip Homework
fantasy, funny
The Last Lighthouse
history, mystery
Comet Cup
space, sports
Owl Post Island
animals, fantasy
The Pyramid Puzzle
history, mystery
Ava5245
Ben5435
Chen4245
Dara34254
Eli5534
Faye5443
Borrowed by44543320

Predict first

Ava loves mysteries. Which book will “most borrowed” suggest to her first?

Show the answer

Dragons Skip Homework, a funny fantasy book, because 4 of 6 readers borrowed it. It has nothing to do with Ava’s taste; Goal Line Ghosts was borrowed by 5, but Ava has read it already. Popularity is the same list for everyone, minus what you have read.

Going deeper · step 2

Similar books, or similar readers

Similar books (content-based). For each book Ava has not read, count the tags it shares with every book she liked (4 or 5 stars). The Pyramid Puzzle shares “history” and “mystery” with The Last Lighthouse, and “mystery” with two more of her favorites, so it scores 4. The reason is easy to explain: “because you liked The Last Lighthouse.” The weakness: it only finds more of the same, and someone has to describe every item well.

Readers like you (collaborative). First measure how similar each reader is to Ava: here, the number of books they both liked. Then score each unread book by adding up the similarity of the readers who liked it. This can surprise Ava with a book whose tags she would never pick, because people like her enjoyed it. The weakness: it knows nothing about a book until people have rated it.

For older students: real systems measure similarity with formulas such as cosine similarity, which treats each reader’s ratings as a vector and compares directions. Large systems learn an embedding for every person and every item, so that people land near the items they are likely to choose. “Readers like you” is also a cousin of nearest neighbors.

Worked example

“Readers like you” for Ava

  1. Ava’s likesAva gave 4 or 5 stars to The Clockwork Fox, Goal Line Ghosts and The Last Lighthouse. She has not read Dragons Skip Homework, Comet Cup, Owl Post Island or The Pyramid Puzzle.
  2. SimilarityCount the books each other reader liked too. Chen: Fox and Lighthouse = 2. Eli: Fox and Goal Line = 2. Ben: Goal Line = 1. Faye: Goal Line = 1. Dara: none = 0 (Dara gave Goal Line 2 stars and Fox 3).
  3. Score each bookAdd up the similarity of every reader who liked it. Comet Cup: Ben (1) + Eli (2) = 3. Owl Post Island: Chen (2) + Dara (0) = 2. Dragons Skip Homework: Faye (1) + Dara (0) = 1. The Pyramid Puzzle: nobody has read it = 0.
  4. RankingComet Cup 3, Owl Post Island 2, Dragons Skip Homework 1, The Pyramid Puzzle 0.
  5. Compare“Most borrowed” would put Dragons Skip Homework first (borrowed by 4 of 6). “Similar books” puts The Pyramid Puzzle first: it shares history and mystery with The Last Lighthouse and mystery with Fox and Goal Line, 2 + 1 + 1 = 4 shared tags. Three methods, three different first picks.

All readers, books and ratings are made up. Real systems use many more people and smarter similarity scores, but the idea is the same: people who agreed before will probably agree again.

3 · Try it

Rank a made-up library

Six readers, eight books, three ways to rank. Then meet Gus, who just joined, and watch the front shelf for six weeks.

Predict first

Which of the three methods can ever recommend The Pyramid Puzzle, the new book nobody has borrowed?

Show the answer

Only similar books. “Most borrowed” ranks it last because it has 0 borrows, and “readers like you” gives it 0 because no reader has liked it yet. This is the cold-start problem for new items. Content tags let a brand-new book compete.

Lab

Three rankings and a feedback loop

Pick a reader and a method to see the ranked list and the reason for each book. Try Gus, the new reader. Then run the front shelf week by week with each shelf rule and compare.

Simulated in your browser with made-up readers, books and ratings. No real accounts or data.

Reader
Method

Feedback loop: the front shelf

Each week the library’s front shelf shows three books. Toy assumption: a shelf book gets 3 more borrows a week, every other book gets 1. Which books the shelf shows depends on the borrow counts, which depend on the shelf.

Week0
Different books shown0
Top 3 share of borrows52%

    The interactive version needs JavaScript. Here are the same results as tables. A reader “likes” a book if they gave it 4 or 5 stars. Ties keep the catalog order.

    Three ranked lists for Ava
    MethodBook (best first)Why
    Most borrowedDragons Skip Homeworkborrowed by 4, average 3.5 stars
    Most borrowedComet Cupborrowed by 3, average 4 stars
    Most borrowedOwl Post Islandborrowed by 2, average 4.5 stars
    Most borrowedThe Pyramid Puzzleborrowed by 0 (new arrival)
    Similar booksThe Pyramid Puzzle4 shared tags with books Ava liked
    Similar booksComet Cup1 shared tags with books Ava liked
    Similar booksOwl Post Island1 shared tags with books Ava liked
    Similar booksDragons Skip Homework0 shared tags with books Ava liked
    Readers like youComet Cupscore 3
    Readers like youOwl Post Islandscore 2
    Readers like youDragons Skip Homeworkscore 1
    Readers like youThe Pyramid Puzzlescore 0

    For Gus, a new reader with no ratings, only “most borrowed” works until he tells the library something about his taste. In the feedback-loop toy model, each week the three shelf books get 3 more borrows each and every other book gets 1. At the start the top 3 books have 13 of 25 borrows (52%).

    The feedback-loop toy model, six weeks
    Shelf ruleShelf this weekDifferent books shown so farTop 3 books’ share of borrowsDragons Skip HomeworkThe Pyramid Puzzle
    Popular only, week 1Goal Line Ghosts, The Clockwork Fox, Moonbase Maple322/39 = 56%51
    Popular only, week 2Goal Line Ghosts, The Clockwork Fox, Moonbase Maple331/53 = 58%62
    Popular only, week 3Goal Line Ghosts, The Clockwork Fox, Moonbase Maple340/67 = 60%73
    Popular only, week 4Goal Line Ghosts, The Clockwork Fox, Moonbase Maple349/81 = 60%84
    Popular only, week 5Goal Line Ghosts, The Clockwork Fox, Moonbase Maple358/95 = 61%95
    Popular only, week 6Goal Line Ghosts, The Clockwork Fox, Moonbase Maple367/109 = 61%106
    2 popular + 1 explore slot, week 1Goal Line Ghosts, The Clockwork Fox, The Pyramid Puzzle320/39 = 51%53
    2 popular + 1 explore slot, week 2Goal Line Ghosts, The Clockwork Fox, Owl Post Island427/53 = 51%64
    2 popular + 1 explore slot, week 3Goal Line Ghosts, The Clockwork Fox, The Pyramid Puzzle434/67 = 51%77
    2 popular + 1 explore slot, week 4Goal Line Ghosts, The Clockwork Fox, The Last Lighthouse542/81 = 52%88
    2 popular + 1 explore slot, week 5Goal Line Ghosts, The Clockwork Fox, Comet Cup649/95 = 52%99
    2 popular + 1 explore slot, week 6Goal Line Ghosts, The Clockwork Fox, Moonbase Maple757/109 = 52%1010

    Hard cases

    Cold starts and feedback loops

    Cold start is the problem of having no data yet. A new user like Gus has no ratings, so collaborative filtering has nobody to compare him with. A new item like The Pyramid Puzzle has no ratings, so it never rises. Common fixes: ask new users a few questions (“Which kinds of books do you like?”), use content features for new items, and show popular items until the system learns more.

    A feedback loop is subtler. A recommender learns from what people did, but people mostly act on what they were shown. Items on the front shelf get borrowed, so they look popular, so they stay on the shelf. Items that are never shown produce no data, so the system never learns whether people would have liked them. In the lab, Dragons Skip Homework starts tied with two shelf books at 4 borrows and misses the shelf only because of a tie-break. After six weeks of “popular only” it has 10 borrows and they have 22.

    One fix is exploration: save some slots for items the system knows little about. With an explore slot, the shelf shows 7 different books in six weeks instead of 3, and the top 3 books’ share of borrows stays near 52% instead of climbing to 61%. Researchers have found the same pattern in computer simulations of recommenders: feedback loops make people’s choices more alike.

    The recommendation feedback loop A cycle of four steps. The system recommends some items. People see those items and click, watch or borrow some of them. Those actions become new data. The model learns from that data and makes the next recommendations. Items that were never shown produce no data. Recommendshow a few items People actclick, watch, borrow New dataonly about shown items Model learnswhat “works”
    A recommender learns from data it helped create. Borrows measure what was shown and chosen, not what people would have liked best.

    What is it aiming for?

    Engagement is not the same as wellbeing

    A recommender gets better at whatever it is scored on. Choosing that score is a human decision.

    Many apps measure success with things that are easy to count: clicks, minutes watched, items bought, books borrowed. These signals are called engagement. They say something about what people choose, but not whether people are glad afterward, learned something, or got a fair view of the options. A recommender trained to maximize minutes watched will get good at keeping people watching, which is not automatically the same as being good for them.

    Researchers who study this argue that recommenders should be designed around human values such as wellbeing, fairness to the people who make the items, and variety, and they point out that these are much harder to measure than clicks. The honest answer is that the effects depend on the app, its goals and its users, and are still being studied. Some things you can do today: look for “why am I seeing this?” explanations, use settings that let you reset or shape your recommendations, and search for things yourself sometimes, so your own curiosity is part of the data.

    4 · Common mix-ups

    What the app does not know

    Four ideas that trip people up, and what to think instead.

    • Mix-up: The app knows what I want.

      Better: It ranks items by patterns in past behavior, yours and other people’s. It can be wrong, and it only knows what it was able to observe.

    • Mix-up: Popular means good.

      Better: Popular can mean “shown a lot.” A feedback loop can keep the same items on top no matter how good the others are.

    • Mix-up: Collaborative filtering understands the books.

      Better: It never looks at what a book is about, only at who liked what. That is its strength and why it cannot handle new items.

    • Mix-up: If a recommender increases clicks, it is working well for people.

      Better: Clicks and watch time are easy to measure; wellbeing, learning and fairness are not. Which goal a system optimizes is a human choice.

    5 · Check yourself

    Three quick questions

    Answer in your head or on paper before you open each one.

    1. Use the ratings table. How similar is Faye to Ben, counting books they both liked (4 or 5 stars)?

      Check your answer

      Both liked Moonbase Maple (Ben 5, Faye 5) and Goal Line Ghosts (Ben 4, Faye 4). Comet Cup does not count, because Faye gave it 3. Similarity = 2.

    2. A music app has just added a song nobody has played yet. Why can’t collaborative filtering recommend it, and what could the app do?

      Check your answer

      Collaborative filtering needs other people’s reactions, and there are none: a cold-start problem. The app can use content features (genre, tempo, artist), put it in a small “new releases” slot, or show it to a few listeners to collect first reactions: exploration.

    3. A video app only recommends the videos with the most views. Describe the feedback loop in three steps.

      Check your answer

      1. The most-viewed videos are recommended. 2. Recommended videos get seen and played more. 3. Their view counts grow, so they are recommended again, while videos that are never shown get no new views and no chance to prove themselves.

    For younger learners

    A grades 3–5 version

    No numbers needed: recommend a book to a classmate two ways.

    20 minutes · teacher-led

    Two kinds of tips

    1. Each student writes two favorite books or shows on a card.
    2. Way 1: find a book in the class library “about the same things” as a classmate’s favorites.
    3. Way 2: find another student with a matching favorite and recommend their other favorite.
    4. Ask the classmate which tip they like better, and why.

    Exit question

    What about a new student?

    A new student has no cards yet. How would you recommend a book to them? Good answers: ask them a question, or suggest a class favorite until you know them. That is exactly what apps do.

    Honest limits

    What this page leaves out

    What this page leaves out

    Matrix factorization, deep-learning recommenders, how search results are ranked, how systems test changes on real users (A/B tests), privacy and what data apps collect, and how advertising fits in are all left out. The toy shelf model is built to show a mechanism; real platforms are far more complicated. The Google course in the sources goes further.