and adaptable recommendation algorithms -...
TRANSCRIPT
OpenRec: A Modular Framework for Extensible and Adaptable Recommendation Algorithms
1
Funders:
Longqi Yang Eugene Bagdasaryan Deborah EstrinCheng-Kang(Andy) Hsieh
Joshua Gruenstein
Promising future of personalization and recommender systems
2
Education Healthcare Social network
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 …
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
…
…
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
7
Bag of algorithms
8
However, current recommendation algorithms lack simplicity and modularity.
Bag of algorithms
…
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
10
Current practice vs. OpenRec
Prior research Your research/application
current practice
News recommender Music recommender
11
Current practice vs. OpenRec
Prior research Your research/application
current practice
News recommender Music recommender
different user feedback signalsdifferent data sourcestangled implementations
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
13
1
2
3
4
Abstraction and interface
Implementations
Simple use cases
Takeaways and Future work
14
Abstract entities in recommendation algorithms
user (or group)
context (environment) item
1 Abstraction and interface
15
Entity User Context Item
Building a recommendation algorithm
1 Abstraction and interface
16
Entity
Profile
User Context Item
Building a recommendation algorithm
1 Abstraction and interface
17
Entity
Profile
User Context Item
… … …
Building a recommendation algorithm
1 Abstraction and interface
18
Entity
Profile
User Context Item
… … …
… … …
Building a recommendation algorithm
1 Abstraction and interface
19
Entity
Profile
User Context Item
… … …
… … …
Building a recommendation algorithm
1 Abstraction and interface
20
Entity
Profile
Interaction
User Context Item
… … …
… … …
Building a recommendation algorithm
1 Abstraction and interface
21
Entity
Profile
Interaction
User Context Item
… … …
… … …
…
Building a recommendation algorithm
1 Abstraction and interface
22
Entity
Profile
Interaction
User Context Item
… … …
… … …
…Ground-truth interactionsGround-truth interactions
Building a recommendation algorithm
1 Abstraction and interface
23
Entity
Profile
Interaction
User Context Item
… … …
… … …
…Ground-truth interactionsGround-truth interactions
Extractiondata representation
1 Abstraction and interface
Extraction: extract representations
24
Entity
Profile
Interaction
User Context Item
… … …
… … …
…Ground-truth interactionsGround-truth interactions
Fusion representation…
representationrepresentation
representation
1 Abstraction and interface
Fusion: fuse representations
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…
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
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
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
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
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
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
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
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
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
35
3 Simple use cases
• Conduct model selection (E-commerce book recommendation).
• Develop new algorithms -- brief
• Compare modular and monolithic implementations.
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
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
38
Exp 1. structure selection
PMF
user id book id
PointwiseMSE
latent factor latent factor
3 Conduct model selection - E-commerce book recommendation
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
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
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
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
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
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
45
3 Simple use cases
• Conduct model selection (E-commerce book recommendation).
• Develop new algorithms -- brief
• Compare modular and monolithic implementations.
46
Iterative recommendationNetflix dataset
a static algorithm
t t+1 t+2 user id
latent factor
movie id
latent factor
PointwiseMSE
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
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
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
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
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
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: