You are the algorithm.
I can… explain that a feed is a ranking problem, read a scoring formula, and build a tiny ranker of my own.
How it works: 8 beats — Hook, Frame, Diagnose, Model, Compare, Build, Prove, Keep. Each beat has something to read, something to do, and a check. Answer a check right to unlock the next beat. Your progress saves on this device only — no account, nothing sent anywhere.
A note on what's real: the ideas in this lesson come from how recommendation systems are described publicly. The exact numbers inside a real app like TikTok are not public — this lesson teaches the mechanism, not secret numbers. Where a claim comes from one creator's breakdown, we say so.
Warm-up
Think of the last video app you opened. Did you search for something — or did it show you things first?
A video app keeps showing you videos you actually like.
What did it learn from?
Now live it: you are the feed
Here are 6 videos the app is considering. For each one, tap what you would do. Watch how the feed learns from you.
0 of 6 judged.
Check 1 of 9
Is a feed a search?
Input → algorithm → output
Every AI follows one path: input (data in) → algorithm (steps to follow) → output (result out). Tap each card to flip it.
Fill in the blank
A photo tagged “cat” by a person has a ___.
Step 1: candidate generation
A feed does not score every video in the world. First it pulls a few hundred things you might see — from people you follow, people like you, what's trending, and your history. Cheap and broad. Only that shortlist gets scored.
Pool (thousands) → shortlist (a few hundred) → scored & ranked → you see the top few
Put the steps in order
Tap the steps in the right order: first the dataset, then the learning algorithm, then the prediction.
Check 2 of 9
What is output?
Check 3 of 9
What does candidate generation do?
Will it work — or is it missing what it needs?
An engineer wants an AI to label photos of recyclables as “plastic” or “paper.” Sort each plan: will it work, or is it missing what the AI needs? Tap a plan, then tap a bucket.
Will work
Missing what it needs
Same test, ranking version
Now sort ranker plans the same way.
Will rank
Missing what it needs
What does each machine learn from?
Sort each card into the right kind of learning. Tap a card, then tap its group.
Check 4 of 9
A store groups shoppers by habits, with no group names given. Which type is this?
Where the math runs
The train-line analogy. Machine learning is like learning a new train line by riding it. You notice patterns — the express skips 23rd, it's packed at 8am — and start predicting. More rides (data) = better predictions.
In the analogy, each ride is…
“It'll be packed at 8am” is the…
On the phone, or on a server?
Scoring a video on your phone means no round-trip per swipe, and it works offline. The phone model is a compressed version of the server model — same shape, fewer parameters. Context — time of day, battery, mute, brightness — can shift what gets shown. In the model this lesson uses, raw context stays on the phone: the server sees scores, not necessarily the raw signals.
Try it: flip the switches and watch one video's score move. Each switch says where that piece was computed.
Base score 1.00. Evening +0.10 (on-device) · Low battery −0.15 (on-device) · Muted −0.05 (on-device) · Bright screen +0.05 (on-device) · On mobile data −0.10 (server).
Check 5 of 9
Why run a model on the phone at all?
Two teams, one winner
Two teams build an AI to spot which cafeteria meals students will skip. Vote for the better plan before you see the pros and cons.
Feeds the AI 3 days of lunch data and launches.
Feeds it a full semester of meals with how much was thrown away, then tests predictions on a new week.
Same comparison, ranking version
Two teams build a feed ranker. Which one wins?
One day of clicks, launch tomorrow.
A month of labeled watch-and-skip data, tested on a brand-new week.
Vote: pick the better answer in each pair
Pair 1. A feed that shows only what you already liked, or a feed that mixes in one new thing each day?
Pair 2. A ranker that only counts likes, or one that counts finish + comments + skips?
Check 6 of 9
Recommendation algorithms mainly do what?
Build it yourself — with Byte
Byte, your AI Engineer Mentor — curious, precise, asks “what does the machine learn from?” Byte never designs the system for you. Your turn first.
Build 1: an AI that predicts which students might need extra help in math
What data goes in? Keep privacy in mind.
Which type, and why?
What does it produce, and who uses it?
Build 2: the Score Lab
Now the formula itself. Each video has predicted chances — the chance you'll finish it, like it, comment, follow, how long you'll stay, and the chance you'll skip. The score adds them up, each multiplied by a weight. The weights are the product decision: raise one, and a different kind of video wins.
score = wfinish×P(finish) + wlike×P(like) + wcomment×P(comment) + wfollow×P(follow) + wstay×stay − wskip×P(skip)
Nothing in the formula knows what a video is — only what people like you did with things like it. Stay time is counted in minutes, so a 42-second watch counts as 0.70.
Build 3: the same machine, different data
Rank Pattern Flip levels instead of videos. Same shape, new numbers — these are illustrative, not measured from real players:
level_score = wcomplete×P(complete) + wretry×P(retry) − wquit×P(quit)
Near-miss idea: a level players almost finish but then quit is a “1 flip away!” moment — a great hook, a bad first level. The flagged level above is the one with the highest finish × quit combination.
Check 7 of 9
If you raise the follow weight, what kind of video wins?
Check 8 of 9
Why is there a minus sign on skip?
Prove it — fast warm-ups
Two fast ones before the exit ticket. No timer on screen — just answer from what you know now.
Warm-up 1. A robot vacuum gets better at avoiding chairs by bumping into them. That's…
Warm-up 2. The steps a computer follows are the…
Check 9 of 9
Your ranker can surface one Flip level next. Which should go first — and why?
Reflect
Many apps learn from you to keep you watching. Who benefits when you stay longer — the company, advertisers, you, or more than one?
When would you want a feed to show you something hard?
Keep it
Your recap:
My ranker → Input: … · Weights: … · Output: …
Takeaway: Input → algorithm → output. Ask what it learns from: labels, no labels, a few labels, or rewards.
Summary
1. A feed is a ranking problem, not a search. 2. It narrows to candidates, scores each one by predicting your actions, then sorts. 3. The weights are the product decision — they pick the winner. 4. Small models can run on your phone; context can shift the scores. 5. The same math ranks videos, levels, or anything else you can score.
Two things people get wrong
“The feed knows what I like.” It doesn't. It predicts what people statistically like you did — and the gap is where the feed feels wrong. “More data always wins.” More good data, tested on new examples, wins. A tiny dataset, however fast, makes shaky predictions.
How sure are you?
How sure are you that you can explain how ranking works — 1 (not at all) to 4 (I could teach it)?
Exit ticket
One question stands between you and the badge. Get it wrong and you can retry as many times as you like — the badge waits until it's right.
A feed shows you a video because…
Glossary
- Candidate
- One thing the feed is considering showing you.
- Ranking
- Putting candidates in order by score, best first.
- Score
- One number per candidate, built from predicted actions and weights.
- Probability
- How likely something is — a number from 0 (never) to 1 (always).
- Weight
- How much one predicted action counts in the score. The product decision.
- Model
- A trained system that makes predictions from patterns in data.
- On-device
- Computed on your phone, not on a server.
- Server
- A faraway computer that does the heavy work and sends results back.
- Context signal
- Something about the moment — time, battery, mute — that can shift a score.
- Retention
- Keeping you watching, or bringing you back.
Sources & honesty note: the ranking mechanism in this lesson is drawn from public descriptions of recommendation systems and from the LearnQuest v1 lesson “How Machines Learn.” The exact weights and signals inside any real app are not public, and the numbers here (video predictions, Flip level numbers) are illustrative teaching numbers, not measured data.