stephanie dewet, software engineer, pinterest at mlconf sf 2016
TRANSCRIPT
![Page 1: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/1.jpg)
![Page 2: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/2.jpg)
Personalized content blendingIn the Pinterest home feed Stephanie deWet, Pinterest Engineer
![Page 3: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/3.jpg)
What is a home feed? Blending model.
Agenda
1
2
![Page 4: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/4.jpg)
What is a home feed?
1
![Page 5: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/5.jpg)
Pinterest is a personalized catalog of ideas.
![Page 6: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/6.jpg)
men’s styleJacob Hinmon
End ClothingMen’s blue jacket
Pin A visual bookmark saved from the internet by a user.
![Page 7: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/7.jpg)
We serve more than 3 trillion Pins every year, or about 10 billion a day.
![Page 8: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/8.jpg)
Followed topics
![Page 9: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/9.jpg)
Followed users
![Page 10: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/10.jpg)
Recommendations
![Page 11: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/11.jpg)
The result is…
![Page 12: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/12.jpg)
RecommendationSocial
New content
How does the home feed work?
![Page 13: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/13.jpg)
Recommendations Ranking Model
Social Connections
Ranking Model
Source
Source
RecommendationSocial
New content
How does the home feed work?
![Page 14: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/14.jpg)
How does the home feed work?
Recommendations Ranking Model
Social Connections
Ranking Model
Source Recs pool
Social poolSource
RecommendationSocial
New content
![Page 15: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/15.jpg)
Content rankingWe have different models for each type of content.
![Page 16: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/16.jpg)
Content rankingWe have different models for each type of content.Why?
![Page 17: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/17.jpg)
Content rankingWe have different models for each type of content.Why?• Parallelizes model development
![Page 18: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/18.jpg)
Content rankingWe have different models for each type of content.Why?• Parallelizes model development• Different content types may have different important features
![Page 19: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/19.jpg)
Content rankingWe have different models for each type of content.Why?• Parallelizes model development• Different content types may have different important features• Different content types may have different objective functions
![Page 20: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/20.jpg)
Content rankingWe have different models for each type of content.Why?• Parallelizes model development• Different content types may have different important features• Different content types may have different objective functions• Easy to add new types of content
![Page 21: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/21.jpg)
Content rankingWe have different models for each type of content.Why?• Parallelizes model development• Different content types may have different important features• Different content types may have different objective functions• Easy to add new types of content• Works well in practice
![Page 22: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/22.jpg)
The blending problem
Recs pool
Social poolBlender ?
home feed
Goal: Combine the results from the pools into one sorted feed.
![Page 23: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/23.jpg)
The blending problemGoal: Combine the results from the pools into one sorted feed.
![Page 24: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/24.jpg)
The blending problemGoal: Combine the results from the pools into one sorted feed.Constraints
![Page 25: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/25.jpg)
The blending problemGoal: Combine the results from the pools into one sorted feed.Constraints• Must maintain the ranking of each pool.
![Page 26: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/26.jpg)
The blending problemGoal: Combine the results from the pools into one sorted feed.Constraints• Must maintain the ranking of each pool.• Scores are not comparable across pools.
![Page 27: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/27.jpg)
The blending problemGoal: Combine the results from the pools into one sorted feed.Constraints• Must maintain the ranking of each pool.• Scores are not comparable across pools.
Desired traits
![Page 28: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/28.jpg)
The blending problemGoal: Combine the results from the pools into one sorted feed.Constraints• Must maintain the ranking of each pool.• Scores are not comparable across pools.
Desired traits• Users with significant prior history should see more of the content types they prefer.
![Page 29: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/29.jpg)
The blending problemGoal: Combine the results from the pools into one sorted feed.Constraints• Must maintain the ranking of each pool.• Scores are not comparable across pools.
Desired traits• Users with significant prior history should see more of the content types they prefer.• We should be able to control the blending rate for users with little prior history; these users
should see some of all types of content.
![Page 30: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/30.jpg)
Blending model
2
![Page 31: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/31.jpg)
Which model?
![Page 32: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/32.jpg)
Which model?• Fixed ratio
![Page 33: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/33.jpg)
Which model?• Fixed ratio• Calibrate ranking models
![Page 34: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/34.jpg)
Which model?• Fixed ratio• Calibrate ranking models• Multi-armed bandit approach
![Page 35: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/35.jpg)
Model: Multi-armed banditEach arm of the bandit represents one of the pools.
Recommendations Friends
![Page 36: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/36.jpg)
Sampling technique• Unlike the classical bandit problem, we do not get
feedback after every sample. • Instead, we will sample content in batches. • In each round, we will map the pool affinities onto
an integer ratio.
![Page 37: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/37.jpg)
DataFor each user and pool, we have historic engagement data.
Total number of: • Positive Actions (Clickthroughs, Repins, Closeups,…)
• Negative Actions (Hides)
• Views
![Page 38: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/38.jpg)
Beta distribution
Beta(5, 10)
Beta(10, 5)Beta(50, 50)
E(Beta) = # actions / # views
![Page 39: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/39.jpg)
Response distributionWe should represent each type of action with its own beta distribution, and its own reward.
We have a linear combination of responses from each bandit.
+ … + rhide *rsave *
Recs
HideSave
Friends Recs Friends
![Page 40: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/40.jpg)
Response distributionWe should represent each type of action with its own beta distribution, and its own reward.
In essence, we have a linear combination of bandits.
So we end up with the full utility of a pool:
![Page 41: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/41.jpg)
How did we do?Goal: Combine the results from the pools into one sorted feed.Constraints • Must maintain the ranking of each pool.• Scores are not comparable across pools.
Desired traits
• Users with significant prior history should see more of the content types they prefer. • We should be able to control the blending rate for users with little prior history; these users
should see some of all types of content.
![Page 42: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/42.jpg)
Prior distributionFor users with little data, we want to enforce that “they should see some of each of the types of content in every page.”
We can enforce this with additional prior action counts.
Prior actions can be selected to give us the desired initial blend for new users, and the desired rate of change.
![Page 43: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/43.jpg)
Sampling technique• In each round, we will map the expected values
of the pool utilities onto an integer ratio.
![Page 44: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/44.jpg)
How did we do?Goal: Combine the results from the pools into one sorted feed.Constraints • Must maintain the ranking of each pool.• Scores are not comparable across pools.
Desired traits
• Users with significant prior history should see more of the content types they prefer. • We should be able to control the blending rate for users with little prior history; these users
should see some of all types of content.
![Page 45: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/45.jpg)
Example
Rewards
Positive action 1
Negative action -1
![Page 46: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/46.jpg)
Example
Prior Values
Positive action 50
Negative action 0
View 1000
![Page 47: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/47.jpg)
Pool# Positive
Actions# Negative
Actions# Views Utility Function
Friends
5000 + 50 0 + 0 10000 + 1000
Recommendations 0 + 50 500 + 0 10000 + 1000
User with history
![Page 48: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/48.jpg)
Pool Utility Function Expected Utility Mapped To Ratio
Friends
0.46 10
Recommendations
-0.04 0
User with history
![Page 49: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/49.jpg)
User with history
![Page 50: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/50.jpg)
New user
Pool# Positive
Actions# Negative
Actions# Views Utility Function
Friends
2 + 50 0 + 0 100 + 1000
Recommendations
2 + 50 0 + 0 10 + 1000
![Page 51: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/51.jpg)
Pool Utility Function Expected Utility Mapped To Ratio
Friends
0.047 5
Recommendations
0.051 5
New user
![Page 52: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/52.jpg)
New user
![Page 53: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/53.jpg)
How did we do?
![Page 54: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/54.jpg)
A/B experiment results
4
3
2
0
% C
hang
e of
ena
bled
vs
cont
rol
Fraction of users who take 1+ positive action
1
Days in the experiment5 10 15 20
![Page 55: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/55.jpg)
A/B experiment results
4
3
2
Days in the experiment
% C
hang
e of
ena
bled
vs
cont
rol
Rate of positive actions on viewed content
1
0 5 10 15 20
![Page 56: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/56.jpg)
Personalizing the ratio
.25Fraction Pins seen from social pool
Frac
tion
of u
sers
.4
.3
.2
.1
.4
.3
.2
.1
.50 .75 .25 .50 .75
Control Enabled
![Page 57: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/57.jpg)
ConclusionsThis model seems simple, but it worked incredibly well in practice.Why was it successful? • Tunable variables give us control over business objectives.• Easy to add new pools of content.• Didn’t rely on any information from the ranking models.
![Page 58: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/58.jpg)
Thanks!We’re hiring [email protected]
![Page 59: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016](https://reader033.vdocuments.site/reader033/viewer/2022051300/58727c231a28abc7068b5639/html5/thumbnails/59.jpg)