HON 4013 · AI, FINANCE, AND HUMAN FUTURES

How to Build the Doom Scroll

Reinforcement learning, predictions about you, and the ads that pay for it
Dr. Jesse Roberts · Tennessee Technological University · Fall 2026
All slides, one per page
© 2026 Dr. Jesse Roberts
Learning from rewards
Goal: find the best move in every square, the one that leads to the most total reward
Agent
World
action
new state, reward
Agent: the learner · the black dot
State: where it is · its square
Action: what it does · up, right, down, left
Reward: the score it gets · −1 a move, +10, −10
Policy: its rule for acting · the arrows
Arrow = a possible move · number = its estimated total reward · thick = current best move
lowhigh−100+10
Learned: the best move in every square
+10−10S
4.3
−2.0
6.2
1.4
8.0
4.6
4.4
10
−9.8
6.0
1.0
−3.2
6.2
−10
2.7
9.4
1.6
−7.5
−2.3
−3.6
4.6
1.7
6.4
−0.6
−3.5
−1.4
−4.4
1.8
−2.5
−3.6
3.1
−1.2
0.0
3.4
−2.0
−4.1
−0.4
0
0.6
−2.2
1.8
−2.9
−3.0
−1.7
−3.3
0.4
−2.6
1×
Nobody tells the agent the route: it finds one from rewards alone.
Our Q-learning run: 100 episodes, learning rate 0.5, discount 0.9, random moves falling from 100% to 10% (seed 32). Every episode ends at the goal or the pit. The notebook reproduces every frame.
Explore or exploit?
?
Same three machines, same luck. The only difference is the strategy
Try them all, then always play the best so farMachine Atruly pays 30%WINLOSSMachine Btruly pays 50%WINLOSSMachine Ctruly pays 70%WINLOSSExplore 10% of the timeMachine Atruly pays 30%WINLOSSMachine Btruly pays 50%WINLOSSMachine Ctruly pays 70%WINLOSS
71 wins total
won 71 of 198
win rate 36%
won 0 of 1
win rate 0%
won 0 of 1
win rate 0%
120 wins total
won 14 of 43
win rate 33%
won 1 of 7
win rate 14%
won 105 of 150
win rate 70%
200 pulls done
Average over 2,000 games · best possible 140
Always play the best so far
118.7 wins
best machine 63% of pulls
Explore 10% of the time
127.5 wins
best machine 76% of pulls
Why did the first player never try machine C again?
Multi-armed bandit: named for slot machines
Contextual bandit: the best arm depends on who pulls
A few pulls can’t tell you which machine is best, so a little exploring pays.
Our simulation: each machine’s run of wins and losses is fixed, so both players get the same luck (seed 13). Explorer: ε-greedy, ε = 0.1. Averages: 2,000 independent games of 200 pulls (seed 7).
Rewards that arrive later
Most moves pay nothing right away. Their value comes from the rewards that follow
Return from here on
G = r₁ + γ·r₂ + γ²·r₃ + …
γ = 0.9: one step later counts 90%
Value along the route, walking back from the goal
4.36.2+101.0−109.4-2.36.4-1.41.83.4S-1.70.4
10.0
8.0
6.2
4.6
3.1
1.8
0.6
-0.4
10.0
×0.9−1
8.0
×0.9−1
6.2
×0.9−1
4.6
×0.9−1 ↓
3.1
×0.9−1
1.8
×0.9−1
0.6
×0.9−1
-0.4
blue outline = learned route · grey = off-route values
A good move now can pay off much later, so RL learns the value of a state, not just its reward.
Values from our Q-learning run (γ = 0.9, 100 episodes). The start’s −0.4 is the exact value of the 8-step route.
You’re the company
?
A free app full of posts. Advertisers pay. Where does the money come from?
Revenue =
Users
people who open the app
Come back tomorrow?
Minutes
time per user per day
Keep them scrolling
Ads per minute
ad slots shown
More slots, more cost
Price per ad
what advertisers pay
Better targeting, higher price
Attention: what users give you Ads: what you sell
For scale: Meta, third quarter of 2025
$50.1B ads
impressions +14% · price per ad +10%
What one number would you reward the feed for, after each swipe?
Every engineering choice in this lecture pulls on one of these four terms.
Meta Platforms Q3 2025 earnings call (Oct 29, 2025): family of apps ad revenue $50.1B; ad impressions +14%; average price per ad +10%.
What the business needs
Revenue = users × minutes × ads per minute × price per ad. What feeds each term?
Users
Users who come back
New users, new posts
Minutes
Creators who keep posting
Knowing what’s good
Ads per minute
Patience for ads
Price per ad
Ads that convert
Data about you
Each need has to become a number before a machine can optimize it.
The feed is an RL agent
Same loop as the grid world. Click to swap in the feed
Grid world
The feed
Agent
World
the dot
the ranking system
the grid
you
action
up, right, down, left
the next post, or an ad
new state
reward
its square
you + this session
−1 a step, +10 goal
watch time, likes, back tomorrow?
stand-in for revenue
policy
the arrows
the ranking it serves
Admoney nowPostpatience, ads later
The tension
The feed learns whatever the reward measures, so choosing the reward is choosing the product.
From words to people
The trick that places words on a map also places you
Last time: words
Kimi K2: each word is 7,168 numbers
catkittendogpuppyinvoicetaxreceipt
Today: you and every post
on one shared map
CookingBasketballGamingLocal newsYou
Event log
close = similar meaning
each event nudges your point
close = likely to engage · outlined = shown first
A word is known by the company it keeps, and so are you.
Both maps are illustrations squashed to two dimensions; real embeddings have hundreds to thousands of numbers. Kimi K2 hidden size: Moonshot AI model card, 2025.
Click to play
From words to people
The trick that places words on a map also places you
Last time: words
Kimi K2: each word is 7,168 numbers
catkittendogpuppyinvoicetaxreceipt
Today: you and every post
on one shared map
CookingBasketballGamingLocal newsYou
Event log
close = similar meaning
each event nudges your point
close = likely to engage · outlined = shown first
A word is known by the company it keeps, and so are you.
Both maps are illustrations squashed to two dimensions; real embeddings have hundreds to thousands of numbers. Kimi K2 hidden size: Moonshot AI model card, 2025.
The funnel: millions to ten
Each request, the feed narrows everything it could show down to what fits on your screen
All posts
millions
everything that could be shown
Retrieval
thousands
nearest points to you on the map
Light ranker
hundreds
a small, fast model trims the list
Heavy ranker
about 100
the big model scores each carefully
Final mix
10 or so
filters, variety, ads slotted in
X, 2023 code: ~1,500 candidates per request · heavy ranker ≈ 48M parameters
Cheap models filter, expensive models decide, so each request stays fast.
Counts per stage vary by platform and are typical orders of magnitude. X figures: Twitter engineering blog and the twitter/the-algorithm repositories, March 2023.
One net, many guesses
For each candidate post, one network predicts the chance of everything you might do with it
Inputs
you (your point on the map, history)
the post (its point, its stats)
context (time, session so far)
Shared trunk
one network reads all the inputs once
Skips within 3 seconds0.22
Watches longer than 95% of viewers0.31
Likes it0.08
Comments0.01
Reshares it0.02
Taps the audio0.01
one post, one viewer (illustrative values)
Heads: Meta’s published Reels list · each trained on what viewers actually did
The model never decides; it predicts a probability for each thing you might do.
Prediction list: Meta Transparency Center, “Instagram Reels Chaining AI system” (predictions include watching under 3 s, watching more than 95% of viewers, liking, commenting, resharing, tapping the audio). Probabilities shown are illustrative.
The post scorecard
?
Many guesses become one number, the way insurers score drivers
Insurance scorecard
points for facts about you (illustrative)
Age 25–34+20
No claims in 5 years+35
5+ years at address+15
Good credit tier+10
Score80 → your price
Facts: checkable, disputable
X’s feed score, 2023
score = Σ weight × predicted probability
p(Reply, and the author replies back)+75
p(Reply)+13.5
p(Opens author’s profile and engages)+12
p(Clicks into the post and engages)+11
p(Repost)+1
p(Like)+0.5
p(Watches half the video)+0.005
p(“Show less”, mute or block)−74
p(Report)−369
Predictions × chosen weights
A report costs −369. If the model predicts you would report a post, will you ever see it? Who still might?
Same shape as an insurance scorecard, but every line is a prediction. There are side effects...
X weights: twitter/the-algorithm-ml, projects/home/recap README (heavy ranker, as published April 2023); X says weights can change at any time. Insurance points are illustrative.
The ad side: an auction every request
Advertisers bid for your attention, and the same kind of prediction model decides who wins
value = bid × p(click) × p(buy | click)
Ad
Bid per sale
p(click)
p(buy | click)
Expected value
Running shoes
$40
1.0%
4%
$0.016
Phone game
$10
3.0%
8%
$0.024 wins
Luxury watch
$80
0.5%
2%
$0.008
Lowest bid wins the highest expected payout: you are predicted 3× likelier to click, 2× likelier to buy
Then: one slot, two contenders
Ad
money now
vs
Post
keeps you here
your next slot
who wins: the ad-load dial, next
The better the feed predicts you, the more each ad slot sells for: that is why your data is the asset.
Illustrative bids and probabilities. Real auctions add quality and relevance terms, but rank ads by expected value per impression in the same way.
The ad-load dial is a bandit
Same slot machine, new arms: 0, 1 or 2 ads in the next load, chosen per person, per moment
User A
2 minutes in
14 posts since last ad
Postslot 1Adslot 2Postslot 3Postslot 4Postslot 5
User B
18 minutes in
just saw 2 ads
Postslot 1Postslot 2Postslot 3Postslot 4Postslot 5
rewardad revenue+still scrolling(stand-in for “back tomorrow?”)
ShareChat A/B test · 80M users · 200M sessions: satisfaction ↑ and ad revenue ↑
How many ads you see is learned for you, from how people like you reacted.
Sagtani, Jhawar, Mehrotra and Jeunen, “Ad-load Balancing via Off-policy Learning in a Content Marketplace,” WSDM 2024 (ShareChat). The two users are illustrative.
Optimizing the whole session
Two rankers on the same toy user. P = provocative post
Next post only · best single item each time (an ad pays 1.0, a post 0.1)
Ad
Ad
user leaves
Whole session · best total, the grid-world way
P
P
P
P
P
P
Ad
P
P
Ad
P
P
P
P
Ad
P
P
Ad
P
P
user leaves
Items per session
2
19.2
Revenue per session
2
5.07
next post only
whole session
Once the reward spans the session, the feed optimizes the sequence, not just the next post.
Our toy feed, averages over 20,000 simulated sessions. Real systems: YouTube’s RL recommender (Chen et al., WSDM 2019); Meta credits recommendations with +5% Facebook time spent (Q3 2025 call).
Always learning
The model and the product both keep changing, all day
The model retrains as you scroll
The company tests itself
your swipesmodelBasketballGamingCookingyour feedA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/BA/B tests this year
v1,049
20,000+
ByteDance Monolith: new model about every minute (1 s here)
Google, LinkedIn, Microsoft: 20,000+ tests a year each · blue = shipped
The model updates in minutes, the product by experiment: two learning loops, one target.
Liu et al., “Monolith: Real Time Recommendation System With Collisionless Embedding Table,” 2022 (ByteDance). Kohavi, Tang, Xu et al., “Online randomized controlled experiments at scale,” Trials, 2020.
One swipe, about 200 milliseconds
Everything so far runs between your swipe and the next post
Request~20 msRetrieve~30 msLight rank~20 msHeavy rank~60 msAd auction~40 msMix, send~30 ms0 ms
200 ms
~10 posts to your screen
next posts already on your phonestages often run in parallel
All of it finishes before your thumb does, billions of times a day.
Stage times are an illustrative budget, not measurements from one platform. 1,500 candidates: X’s 2023 open-source timeline code.
The loop closes
Each swipe feeds the next one
You watch
a post, an ad
Events stream back
watch time, skips, replays, likes
The model updates
and your point on the map moves
The next request
is ranked with the new you
reward
learning
new state
action
blue labels = the RL loop from the start, with you as the world
Every swipe is both a reward and a training example.
Nobody coded the hook
Three ordinary choices add up to a slot machine
uncertain predictor
exploration
greedy ranking
greatboringfineboringboringgreatfineboringgreatboringfineboringboringgreatfineboringWINsame schedule: unpredictable wins
7
7
7
X, 2023: every reply scores
Great point, thanks for sharing!
+13.5
Worst take I have ever read.
+13.5
Arousal wins the score
The hook falls out of the optimization; no one has to design it.
Feed ratings illustrative. Reply weight 13.5: twitter/the-algorithm-ml recap README (2023); the scoring has no tone or sentiment term. Variable-ratio rewards: a standard result in behavioural psychology.
No natural end
Every request is a fresh decision
One toy-feed session: the user’s hidden hook level (0–5) and what the feed showed · P = provocative post · ads land at the peaks
012345PPPPPPAdPPAdPPPPAdPPAdPP
The action list, at every request
post 1post 2post 3…adstop
“stop” is not an action
Where it ends
END
newspaper
CREDITS
TV episode
∞
feed
Nothing in the action list says “stop”, so the policy never learns to.
Run the feed
?
Toy feed, simulated user, Q-learning. Reward: 0.1 per post, 1 per ad. Nothing else
What it learned to show, by hook level
hook 0
Ad
hook 1
Provoke
hook 2
Provoke
hook 3
Provoke
hook 4
Provoke
hook 5
Ad
calm post: never chosenads: at the peak, and at hook 0
best possible 5.07080,000 sessions of practice1.76
Revenue per session while it learns
Fixed rule
Learned
Items per session
5.6
19.2
Ads per session
1.1
3.5
Revenue per session
1.56
5.07
Fixed rule: calm posts, an ad every fourth item.
Why an ad at hook 0? What is missing from the reward?
Every piece is a reasonable choice for the revenue equation. Together they build the doom scroll.
Our simulation (notebook): hook level 0–5; we assumed provocative posts raise it more often than calm ones (60% vs 40%) and lower it less (10% vs 20%), an ad lowers it by 2, and users leave more often at low levels. Best policy by value iteration; Q-learning seed 11.