and adaptable recommendation algorithms -...

52
OpenRec: A Modular Framework for Extensible and Adaptable Recommendation Algorithms 1 Funders: Longqi Yang Eugene Bagdasaryan Deborah Estrin Cheng-Kang(Andy) Hsieh Joshua Gruenstein

Upload: doanbao

Post on 11-Jul-2019

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

OpenRec: A Modular Framework for Extensible and Adaptable Recommendation Algorithms

1

Funders:

Longqi Yang Eugene Bagdasaryan Deborah EstrinCheng-Kang(Andy) Hsieh

Joshua Gruenstein

Page 2: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

Promising future of personalization and recommender systems

2

Education Healthcare Social network

Media Food and Diet e-Commerce

Page 3: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

3

Recommendation algorithms are increasingly complex

Page 4: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

4

Recommendation algorithms are increasingly complex

Diverse user feedback signals

click

like skip followrating

save watch listen …

Page 5: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

5

Recommendation algorithms are increasingly complex

Diverse user feedback signals

Heterogeneous data streams and context

click

like skip followrating

save watch listen

user demographics user social media posts

Item descriptions videos images

activities location mood

Page 6: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

6

Recommendation algorithms are increasingly complex

Diverse user feedback signals

Heterogeneous data streams and context

Complex goals

click

like skip followrating

save watch listen

user demographics

accuracy

diversity

novelty

quality

user social media posts

Item descriptions videos images

activities location mood …

… interpretability

fairness

Page 7: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

7

Bag of algorithms

Page 8: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

8

However, current recommendation algorithms lack simplicity and modularity.

Bag of algorithms

Page 9: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

9

O penRec

Modularity

o Easy to extend and adapt to various scenarios.

o Quick experimentation (e.g., model selection) and idea exploration.

o Comparable (sometimes even better) performance.

Apache License 2.0

Page 10: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

10

Current practice vs. OpenRec

Prior research Your research/application

current practice

News recommender Music recommender

Page 11: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

11

Current practice vs. OpenRec

Prior research Your research/application

current practice

News recommender Music recommender

different user feedback signalsdifferent data sourcestangled implementations

Page 12: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

12

Current practice vs. OpenRec

Prior research Your research/application

current practice

OpenRec

News recommender Music recommender

user clicks

news keywords

twitter following

user clicks

user demographics

audio

different user feedback signalsdifferent data sourcestangled implementations

Page 13: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

13

1

2

3

4

Abstraction and interface

Implementations

Simple use cases

Takeaways and Future work

Page 14: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

14

Abstract entities in recommendation algorithms

user (or group)

context (environment) item

1 Abstraction and interface

Page 15: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

15

Entity User Context Item

Building a recommendation algorithm

1 Abstraction and interface

Page 16: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

16

Entity

Profile

User Context Item

Building a recommendation algorithm

1 Abstraction and interface

Page 17: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

17

Entity

Profile

User Context Item

… … …

Building a recommendation algorithm

1 Abstraction and interface

Page 18: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

18

Entity

Profile

User Context Item

… … …

… … …

Building a recommendation algorithm

1 Abstraction and interface

Page 19: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

19

Entity

Profile

User Context Item

… … …

… … …

Building a recommendation algorithm

1 Abstraction and interface

Page 20: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

20

Entity

Profile

Interaction

User Context Item

… … …

… … …

Building a recommendation algorithm

1 Abstraction and interface

Page 21: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

21

Entity

Profile

Interaction

User Context Item

… … …

… … …

Building a recommendation algorithm

1 Abstraction and interface

Page 22: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

22

Entity

Profile

Interaction

User Context Item

… … …

… … …

…Ground-truth interactionsGround-truth interactions

Building a recommendation algorithm

1 Abstraction and interface

Page 23: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

23

Entity

Profile

Interaction

User Context Item

… … …

… … …

…Ground-truth interactionsGround-truth interactions

Extractiondata representation

1 Abstraction and interface

Extraction: extract representations

Page 24: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

24

Entity

Profile

Interaction

User Context Item

… … …

… … …

…Ground-truth interactionsGround-truth interactions

Fusion representation…

representationrepresentation

representation

1 Abstraction and interface

Fusion: fuse representations

Page 25: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

25

Entity

Profile

Interaction

User Context Item

… … …

… … …

…Ground-truth interactionsGround-truth interactions

Interactionpredicted

interactions

user representationcontext representation

item representation

1 Abstraction and interface

Interaction: predict clicks/likes/ratings…

Page 26: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

26

A hypothetical music recommendation algorithm

demographical information

tweets

latent factor

LSTM

concat

location

spatial-temporal

audio

MFCC CNN

lyrics

MLP

music id

latent factor

user id

(skip) (like)

masking

PointwiseMSE PairwiseLog

1 Abstraction and interface

Page 27: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

27

demographical information

tweets

latent factor

concat

location

spatial-temporal

audio

MFCC CNN

lyrics

MLP

music id

latent factor

user id

(skip) (like)……

… ……

………

……

1 Abstraction and interface

A hypothetical music recommendation algorithm

Page 28: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

28

demographical information

latent factor

concat

mood

LSTM

artist

latent factor

music id

latent factor

user id

(skip) (like)

masking

PointwiseMSE PairwiseLog

1 Abstraction and interface

A hypothetical music recommendation algorithm

Page 29: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

29

ModuleInteraction

PointwiseMSE

PointwiseMLP…

Fusion

Concatenation

Average

Weighted sum

Extraction

LF

ResNet MLP

LSTM

AutoEncoder…

Recommender

R-1:clicklogs,textposts,andcontenttopicmodeling.

R-2:watchhistory,contentvisualanalysis,and activitydetection.

Utility

SamplerPairwisesampler

Pointwisesampler…

Evaluator

AUC

Recall@K

Pairwise distance

… R-n:…

OpenRec framework structure

2 Implementations

Page 30: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

30

Inside a Recommender

Recommender

build_inputs(train)

build_user_extractions(train)

build_item_extractions(train)

build_extra_extractions(train)

build_default_fusions(train)

build_custom_fusions(train)

build_default_interactions(train)

build_custom_interactions(train)

build_extractions(train)

build_fusions(train)

build_interactions(train)

build_optimizer()

iftrain==true

build_training_graph() build_serving_graph()

train=true train=false

train(...) serve(…) save(…) load(…)

2 Implementations

Page 31: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

31

Inside a Recommender

Recommender

build_inputs(train)

build_user_extractions(train)

build_item_extractions(train)

build_extra_extractions(train)

build_default_fusions(train)

build_custom_fusions(train)

build_default_interactions(train)

build_custom_interactions(train)

build_extractions(train)

build_fusions(train)

build_interactions(train)

build_optimizer()

iftrain==true

build_training_graph() build_serving_graph()

train=true train=false

train(...) serve(…) save(…) load(…)

2 Implementations

Page 32: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

32

Inside a Module

build_shared_graph()

build_training_graph()

build_serving_graph()userrepr.

itemrepr.

contextrepr.

train=True train=False

outputs

loss

data

module#1

module#n

Extraction

Fusion

Interaction

2 Implementations

Page 33: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

33

Inside a Module

build_shared_graph()

build_training_graph()

build_serving_graph()userrepr.

itemrepr.

contextrepr.

train=True train=False

outputs

loss

data

module#1

module#n

Extraction

Fusion

Interaction

2 Implementations

Page 34: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

34

Inside a Module

build_shared_graph()

build_training_graph()

build_serving_graph()userrepr.

itemrepr.

contextrepr.

train=True train=False

outputs

loss

data

module#1

module#n

Extraction

Fusion

Interaction

2 Implementations

Page 35: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

35

3 Simple use cases

• Conduct model selection (E-commerce book recommendation).

• Develop new algorithms -- brief

• Compare modular and monolithic implementations.

Page 36: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

36

Two kinds of model selection

structure selection: what data traces to incorporate and how

module selection: select best modules given a structure

3 Conduct model selection - E-commerce book recommendation

Page 37: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

37

Amazon dataset [McAuley et. al. 15]

User data: user id & purchases in other categories

Book data: book id & book cover image

Interaction data: user reviews

3 Conduct model selection - E-commerce book recommendation

Page 38: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

38

Exp 1. structure selection

PMF

user id book id

PointwiseMSE

latent factor latent factor

3 Conduct model selection - E-commerce book recommendation

Page 39: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

39

user id other purchases

MLP

book id

average

PointwiseMSE

latent factor latent factor

Exp 1. structure selection

UserPMF

3 Conduct model selection - E-commerce book recommendation

Page 40: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

40

user id book id visual feature

MLP

average

PointwiseMSE

latent factor latent factor

Exp 1. structure selection

VisualPMF

3 Conduct model selection - E-commerce book recommendation

Page 41: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

41

user id other purchases

MLPlatent factor

book id visual feature

MLPlatent factor

averageaverage

PointwiseMSE

Exp 1. structure selection

UserVisualPMF

3 Conduct model selection - E-commerce book recommendation

Page 42: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

42

user id book id visual feature

MLP

average

PointwiseMSE

latent factor latent factor

Exp 2. module selection

VisualPMF

3 Conduct model selection - E-commerce book recommendation

Page 43: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

43

user id book id visual feature

MLP

average

PointwiseMSE/PairwiseLog/PairwiseEuDist/PointwiseGeCE

PMF[Salakhutdinov et. al. 08]

BPR [Rendle et. al. 09]

GMF[He et. al. 17]

CML[Hsieh et. al. 17]

latent factor latent factor

Exp 2. module selection

VisualPMF/VisualBPR/VisualCML/VisualGMF

3 Conduct model selection - E-commerce book recommendation

Page 44: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

44

20 40 60 80 100.

0.20

0.25

0.30

0.35

0.40

5eFall@.

30F, A8C 0.6379iVual30F, A8C 0.7008VeU30F, A8C 0.6718VeU9iVual30F, A8C 0.689

Experimental Results

20 40 60 80 100.

0.15

0.20

0.25

0.30

0.35

0.40

5eFall@.

VLVualG0F, A8C 0.713VLVual30F, A8C 0.700VLVualB35, A8C 0.673VLVualC0L, A8C 0.710

3 Conduct model selection - E-commerce book recommendation

Structure selection Module selection

Page 45: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

45

3 Simple use cases

• Conduct model selection (E-commerce book recommendation).

• Develop new algorithms -- brief

• Compare modular and monolithic implementations.

Page 46: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

46

Iterative recommendationNetflix dataset

a static algorithm

t t+1 t+2 user id

latent factor

movie id

latent factor

PointwiseMSE

Page 47: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

47

Iterative recommendationNetflix dataset

a static algorithm

t t+1 t+2 user id

temporal latent factor

movie id

PointwiseMSE

temporal latent factor

6% MSE improvements compared to static model

Page 48: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

48

Takeaways

Share the same programming model and low-level APIs with Tensorflow/Keras.

OpenRec for researchers:

• Demonstrate model generalizability.

• Facilitate comparisons.

• Encourage usage.

OpenRec for practitioners:

• Select models/parameters.

• Adapt state-of-the-art solutions.

4 Takeaways and future work

Page 49: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

49

Future work

Enriching modules, recommenders and utility functions.

• Your recommendation paper/code.

• Your favorite recommendation algorithms.

• Become a contributor.

Non-neural network models.

• Tree and graph based models.

4 Takeaways and future work

Page 50: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

50

Programming language

Machine language

Specify where to store each bit

High-level languages

OS, file system, virtual memory

Modern languages

More abstractions, e.g., save, load.

Pre-caffe era

Write CUDA code for any matrix

operation

caffe era

Some layer implementations

in C++

Post-caffe era (Tensorflow, Pytorch,

mxnet, etc.)

High-level python APIDNN

Modularity in other domains

Page 51: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

51

“Modularity based on abstractions is the way things get done”

- Barbara Liskov

“You will never succeed in extracting simplicity If don’t recognize it is different from mastering complexity.”

- Scott Shenker

Page 52: and Adaptable Recommendation Algorithms - cs.cornell.eduylongqi/presentation/YangBGHE18Slides.pdf · Media Food and Diet e-Commerce. 3 Recommendation algorithms are increasingly complex

52

O penRechttp://www.openrec.ai

Github link, documents, and tutorials

Longqi YangPh.D. candidate

Computer Science, Cornell Tech, Cornell University

Email: [email protected]

Web: bit.ly/longqi

Twitter: @ylongqi

Connected Experiences Lab

http://cx.jacobs.cornell.edu/

Small Data Lab

http://smalldata.io/

Funders: