59

Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

  • Upload
    mlconf

  • View
    432

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016
Page 2: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

Personalized content blendingIn the Pinterest home feed Stephanie deWet, Pinterest Engineer

Pinterest

Page 3: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

What is a home feed? Blending model.

Agenda

1

2

Page 4: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

What is a home feed?

1

Page 5: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

Pinterest is a personalized catalog of ideas.

Page 6: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

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

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

Followed topics

Page 9: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

Followed users

Page 10: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

Recommendations

Page 11: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

The result is…

Page 12: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

RecommendationSocial

New content

How does the home feed work?

Page 13: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

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

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

Content rankingWe have different models for each type of content.

Page 16: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

Content rankingWe have different models for each type of content.Why?

Page 17: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

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

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

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

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

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

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

The blending problemGoal: Combine the results from the pools into one sorted feed.

Page 24: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

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

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

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

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

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

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

Pinterest

Blending model

2

Page 31: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

Which model?

Page 32: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

Which model?• Fixed ratio

Page 33: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

Which model?• Fixed ratio• Calibrate ranking models

Page 34: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

Which model?• Fixed ratio• Calibrate ranking models• Multi-armed bandit approach

Page 35: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

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

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

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

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

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

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

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

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

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

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

Example

Rewards

Positive action 1

Negative action -1

Page 46: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

Example

Prior Values

Positive action 50

Negative action 0

View 1000

Page 47: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

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

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

User with history

Page 50: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

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

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

New user

Page 53: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

How did we do?

Page 54: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016

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

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

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

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

Thanks!We’re hiring [email protected]

Page 59: Stephanie deWet, Software Engineer, Pinterest at MLconf SF 2016