SlideShare a Scribd company logo
Déjà Vu
The Importance of Time and
Causality in Recommender
Systems
Justin Basilico & Yves Raimond
August 29, 2017
@JustinBasilico @moustaki
But first…
Goodbye
& Cinematch
But first…
Goodbye
& Cinematch
% Match
Hello
&
But first…
Goodbye
Why?
+200% ratings volume
Clear link to personalization
& Cinematch
% Match
Hello
&
Image from Domiriel (cc by-nc)
● This moment can be controlled
by the user
○ Visit time
○ Session length
● … or influenced by the system
○ Notifications, emails
● And must choose an action
○ … that has consequences
Recommendations are actions
at a moment in time
● Time and causality are critical
aspects in any recommender
system
○ Data collection
○ Experiment design (offline & online)
○ Algorithm & objective design
○ System design
Time-aware data
collection
Data collection
Observed
labels
Training
time
Serving
time
Serving
input data
collected
Violation of the space-time
continuum!
Observed
labels
Training
input data
collected
Training
time
Serving
time
Serving
input data
collected
Data collection
Observed
labels
Training
input data
collected
Training
time
Serving
time
Serving
input data
collected
Time machines
Observed
labels
Training
input data
collected
Training
time
Serving
time
Serving
input data
collected
Distributed Time Travel for Feature Generation
● Be careful when splitting dataset
○ Don’t overfit the past
○ Predict the future
● Rule of thumb: Split across what you need to generalize
○ Time!
○ Users or Items?
● May need to train/test at multiple distinct time points to see
generalization across time (e.g. [Lathia et. al., 2009])
● Simulate system behaviors (e.g. training and publishing
delays) in evaluation pipeline
○ Helps capture trade-off between accuracy and responsiveness
Experiment design
Train
Time
Test
Time-aware
recommendation
algorithms
R ≈ UM
?
?
Users changing over time
Nonstationarity
Items changing over time
popularity
time
Learned item
bias
Actual item popularity
Item launch
Item becomes
available
● Aggregation
○ Decay functions (e.g. [Ding, Li, 2005])
○ Buckets (e.g. [Zimdars, Chickering, Meek, 2001])
● Extrapolation (e.g. [Koren, 2009])
● Sequences
○ Markov (e.g. [Rendle, et al., 2010])
○ Last N (e.g. [Shani, Heckerman, Brafman, 2005])
○ RNNs (e.g. [Hidasi et al., 2015])
● Features
○ Discretized (e.g. [Baltrunas, Amatriain, 2009])
○ Continuous (e.g. example age in [Covington et. al., 2016])
Some modeling approaches time
● Generalizing to future behaviors through
temporal extrapolation
● Time exhibits many periodicities
○ Daily
○ Weekly
○ Seasonally
○ … and even longer: Olympics, elections, etc.
● Additional periodic time context features
can be added or extracted
Time as context Experiment on a Netflix
internal dataset
● Recommendation systems are a means to an end
○ Reward = enjoyment - interaction cost
○ Enjoyment integrated over time (e.g. goodness * length of view)
○ Interaction cost integrated over time
○ Don’t waste your users time
○ Magnitudes of enjoyment and cost may be user-specific
● Maximize enjoyment of the selected item while minimizing time it
takes to find the item
Minimizing interaction time
Hangul alphabet, 3 syllables but
requires 7 (2 + 3 + 2) interactionsClick
With a model optimized to minimize
interaction time: one interaction
Click
Time-aware
recommender systems
Déjà Vu: The Importance of Time and Causality in Recommender Systems
Algorithms changing
Idea
Offline
experimentation
Online
experimentation
(A/B)
Rollout
Algorithm C
Algorithm B
Algorithm A
Algorithms changing
Idea
Offline
experimentation
Online
experimentation
(A/B)
Rollout
Algorithm C
Algorithm B
Algorithm A
Algorithms changing
Idea
Offline
experimentation
Online
experimentation
(A/B)
Rollout
Assumes stationarity! A change in other parts of the system
might invalidate previous (offline or online) results.
Holdback A/B tests as part of rollout can help.
UX changing over time
% Match&
Feedback loops
Impression bias
inflates plays
Leads to inflated
item popularity
More plays
More
impressions
Oscillations in
distribution of genre
recommendations
Feedback loops can cause biases to be
reinforced by the recommendation system!
Déjà Vu: The Importance of Time and Causality in Recommender Systems
Closed Loop
Training
Data
Watches Model
Recs
Closed Loop
Training
Data
Watches Model
Recs
Danger Zone
Closed Loop
Training
Data
Watches Model
Recs
Danger Zone
Search
Training
Data
Watches Model
Recs
Open Loop
Closed Loop
Training
Data
Watches Model
Recs
Danger Zone
Search
Training
Data
Watches Model
Recs
Open Loop
Open vs. Closed Loops
[Based on Steck, 2013 with system as selector]
Watch when
rec
Probability
of rec
Watch when
not rec
Probability
of not rec
Open vs. Closed Loops
[Based on Steck, 2013 with system as selector]
Watch when
rec
Probability
of rec
Watch when
not rec
Probability
of not rec
Closed loop: 0
Open loop: > 0
Open vs. Closed Loops
[Based on Steck, 2013 with system as selector]
Watch when
rec
Probability
of rec
Watch when
not rec
Probability
of not rec
Closed loop: 0
Open loop: > 0
We have control
over this
● Maintain some controlled exploration to break
feedback loop and handle non-stationarities
● Explore with -greedy, Thompson Sampling, etc.
● Control to avoid significantly degrading user
experience
● Log as much as possible
○ Include counterfactuals: What maximal action
system wanted to do (e.g. [Bottou et al., 2013])
Controlled stochasticity
Explore
Explore
Replay Metrics
Observed
reward
Existing
recommendation
algorithm (with
stochasticity)
Observed
reward
New recommendation
algorithm
[Li et al., 2011; Dudik, Langford, Li, 2014]
Simulate online metrics, offline!
● Stochasticity opens the door to using causal inference
● Inverse Propensity Weighting
○ Reduce production bias by reweighting train and test data
○ Know probability of user receiving an impression
○ Doesn’t handle simultaneity and other endogeneity
● Covariate shift
○ Use explore data to estimate bias in other data
○ Use all data to train
● Instrumental variables for more general settings
Causality
[Schnabel et al., 2016; Liang, Charlin, Blei, 2016; Smola, 2011, Sugiyama, Kawanabe, 2012]
● Most recommendations (and ML) models are correlational
○ These items are correlated with these types of users
● But we seek causal actions
○ Showing this item is rewarding for this user
● Our recommendation action should have an incremental
effect in reward: E[r(a)] - E[r(∅)]
○ Application-dependent choice of ∅
○ Sometimes it may be better not to provide a recommendation that
simply maximizes p(vi
|u)
○ May provide less obvious recommendations
Incrementality
p(vi
|∅) p(vi
|a)
Incremental
effect
● Gold standard of causality
○ Random assignment
○ Measured across time
○ Incremental benefit of treatment
● Causality safety net?
○ Hard to test with full feedback loop effects
○ An algorithm may behave differently when
training off its own data
○ Holdback tests
A/B Testing
Time
A
(Control)
B
(Treatment)
Significant?
Metrics
Conclusions.
● After users and items, time is usually the next most important
factor in recommendation systems
○ Model it as such
○ Evaluate it as such
○ Make it central to your system and infrastructure
● Recommender systems act in a causal loop
○ Influenced by themselves and others
○ Be thoughtful about feedback effects
Takeaways
Thank you.
@JustinBasilico @moustaki
Justin Basilico & Yves Raimond
Yes, we’re hiring...
Déjà Vu
The Importance of Time and
Causality in Recommender
Systems
Justin Basilico & Yves Raimond
August 29, 2017
@JustinBasilico @moustaki

More Related Content

PDF
Making Netflix Machine Learning Algorithms Reliable
PDF
Recent Trends in Personalization at Netflix
PDF
Past, Present & Future of Recommender Systems: An Industry Perspective
PDF
Recent Trends in Personalization at Netflix
PDF
Context Aware Recommendations at Netflix
PDF
Deep Learning for Recommender Systems
PDF
Time, Context and Causality in Recommender Systems
PDF
Personalizing "The Netflix Experience" with Deep Learning
Making Netflix Machine Learning Algorithms Reliable
Recent Trends in Personalization at Netflix
Past, Present & Future of Recommender Systems: An Industry Perspective
Recent Trends in Personalization at Netflix
Context Aware Recommendations at Netflix
Deep Learning for Recommender Systems
Time, Context and Causality in Recommender Systems
Personalizing "The Netflix Experience" with Deep Learning

What's hot (20)

PDF
Missing values in recommender models
PDF
Sequential Decision Making in Recommendations
PDF
Contextualization at Netflix
PDF
Calibrated Recommendations
PPTX
Learning a Personalized Homepage
PDF
Artwork Personalization at Netflix
PDF
Tutorial on Deep Learning in Recommender System, Lars summer school 2019
PDF
Recent Trends in Personalization: A Netflix Perspective
PDF
Homepage Personalization at Spotify
PDF
Shallow and Deep Latent Models for Recommender System
PPTX
Personalized Page Generation for Browsing Recommendations
PPTX
Netflix talk at ML Platform meetup Sep 2019
PDF
Data council SF 2020 Building a Personalized Messaging System at Netflix
PDF
A Multi-Armed Bandit Framework For Recommendations at Netflix
PDF
Deep Learning for Recommender Systems
PDF
Crafting Recommenders: the Shallow and the Deep of it!
PDF
Deep Learning for Personalized Search and Recommender Systems
PPTX
Recommender system introduction
PDF
Recommending for the World
PPTX
Lessons Learned from Building Machine Learning Software at Netflix
Missing values in recommender models
Sequential Decision Making in Recommendations
Contextualization at Netflix
Calibrated Recommendations
Learning a Personalized Homepage
Artwork Personalization at Netflix
Tutorial on Deep Learning in Recommender System, Lars summer school 2019
Recent Trends in Personalization: A Netflix Perspective
Homepage Personalization at Spotify
Shallow and Deep Latent Models for Recommender System
Personalized Page Generation for Browsing Recommendations
Netflix talk at ML Platform meetup Sep 2019
Data council SF 2020 Building a Personalized Messaging System at Netflix
A Multi-Armed Bandit Framework For Recommendations at Netflix
Deep Learning for Recommender Systems
Crafting Recommenders: the Shallow and the Deep of it!
Deep Learning for Personalized Search and Recommender Systems
Recommender system introduction
Recommending for the World
Lessons Learned from Building Machine Learning Software at Netflix
Ad

Viewers also liked (12)

PDF
Why [Mobile] [In-app] Programmatic? A Marketer's Guide
PDF
Dressipi - Personalised recommendation engine for fashion consumers
PDF
Machine Intelligence Showcase Feb 2017
PPTX
BenevolentTech - Harnessing the power of AI to accelerate global scientific d...
PPTX
Personalized Job Recommendation System at LinkedIn: Practical Challenges and ...
PDF
Bootstrapping a Destination Recommendation Engine
PPTX
Recommendations for Building Machine Learning Software
PDF
Personalization Challenges in E-Learning
PDF
Building Recommender Systems for Fashion
PPTX
Is that a Time Machine? Some Design Patterns for Real World Machine Learning ...
PDF
Applying deep learning to medical data
PPTX
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
Why [Mobile] [In-app] Programmatic? A Marketer's Guide
Dressipi - Personalised recommendation engine for fashion consumers
Machine Intelligence Showcase Feb 2017
BenevolentTech - Harnessing the power of AI to accelerate global scientific d...
Personalized Job Recommendation System at LinkedIn: Practical Challenges and ...
Bootstrapping a Destination Recommendation Engine
Recommendations for Building Machine Learning Software
Personalization Challenges in E-Learning
Building Recommender Systems for Fashion
Is that a Time Machine? Some Design Patterns for Real World Machine Learning ...
Applying deep learning to medical data
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
Ad

Similar to Déjà Vu: The Importance of Time and Causality in Recommender Systems (20)

PDF
Data Science Popup Austin: Predicting Customer Behavior & Enhancing Customer ...
PPTX
Tutorial on sequence aware recommender systems - UMAP 2018
PPTX
[UPDATE] Udacity webinar on Recommendation Systems
PDF
Offline evaluation of recommender systems: all pain and no gain?
PPTX
Udacity webinar on Recommendation Systems
PPTX
Immersive Recommendation Workshop, NYC Media Lab'17
PPTX
Олександр Обєдніков “Рекомендательные системы”
PPTX
Rokach-GomaxSlides (1).pptx
PPTX
Rokach-GomaxSlides.pptx
PPTX
Lessons learnt at building recommendation services at industry scale
PDF
Past, present, and future of Recommender Systems: an industry perspective
PDF
Challenges in Evaluating Exploration Effectiveness in Recommender Systems
PDF
Boston ML - Architecting Recommender Systems
PDF
Spil games konrad
PDF
Temporal Diversity in RecSys - SIGIR2010
PDF
Tutorial on Bias in Rec Sys @ UMAP2020
PDF
Tutorial on Sequence Aware Recommender Systems - ACM RecSys 2018
PDF
Temporal Learning and Sequence Modeling for a Job Recommender System
PPTX
Distribution Problems in Recommender Systems
PPT
Recommender systems
Data Science Popup Austin: Predicting Customer Behavior & Enhancing Customer ...
Tutorial on sequence aware recommender systems - UMAP 2018
[UPDATE] Udacity webinar on Recommendation Systems
Offline evaluation of recommender systems: all pain and no gain?
Udacity webinar on Recommendation Systems
Immersive Recommendation Workshop, NYC Media Lab'17
Олександр Обєдніков “Рекомендательные системы”
Rokach-GomaxSlides (1).pptx
Rokach-GomaxSlides.pptx
Lessons learnt at building recommendation services at industry scale
Past, present, and future of Recommender Systems: an industry perspective
Challenges in Evaluating Exploration Effectiveness in Recommender Systems
Boston ML - Architecting Recommender Systems
Spil games konrad
Temporal Diversity in RecSys - SIGIR2010
Tutorial on Bias in Rec Sys @ UMAP2020
Tutorial on Sequence Aware Recommender Systems - ACM RecSys 2018
Temporal Learning and Sequence Modeling for a Job Recommender System
Distribution Problems in Recommender Systems
Recommender systems

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Machine learning based COVID-19 study performance prediction
PDF
Electronic commerce courselecture one. Pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Cloud computing and distributed systems.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
A Presentation on Artificial Intelligence
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Modernizing your data center with Dell and AMD
Unlocking AI with Model Context Protocol (MCP)
“AI and Expert System Decision Support & Business Intelligence Systems”
Per capita expenditure prediction using model stacking based on satellite ima...
Dropbox Q2 2025 Financial Results & Investor Presentation
Review of recent advances in non-invasive hemoglobin estimation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
MYSQL Presentation for SQL database connectivity
Machine learning based COVID-19 study performance prediction
Electronic commerce courselecture one. Pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Cloud computing and distributed systems.
Reach Out and Touch Someone: Haptics and Empathic Computing
A Presentation on Artificial Intelligence
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
NewMind AI Monthly Chronicles - July 2025
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Modernizing your data center with Dell and AMD

Déjà Vu: The Importance of Time and Causality in Recommender Systems

  • 1. Déjà Vu The Importance of Time and Causality in Recommender Systems Justin Basilico & Yves Raimond August 29, 2017 @JustinBasilico @moustaki
  • 4. But first… Goodbye Why? +200% ratings volume Clear link to personalization & Cinematch % Match Hello &
  • 5. Image from Domiriel (cc by-nc)
  • 6. ● This moment can be controlled by the user ○ Visit time ○ Session length ● … or influenced by the system ○ Notifications, emails ● And must choose an action ○ … that has consequences Recommendations are actions at a moment in time ● Time and causality are critical aspects in any recommender system ○ Data collection ○ Experiment design (offline & online) ○ Algorithm & objective design ○ System design
  • 9. Violation of the space-time continuum! Observed labels Training input data collected Training time Serving time Serving input data collected
  • 12. ● Be careful when splitting dataset ○ Don’t overfit the past ○ Predict the future ● Rule of thumb: Split across what you need to generalize ○ Time! ○ Users or Items? ● May need to train/test at multiple distinct time points to see generalization across time (e.g. [Lathia et. al., 2009]) ● Simulate system behaviors (e.g. training and publishing delays) in evaluation pipeline ○ Helps capture trade-off between accuracy and responsiveness Experiment design Train Time Test
  • 15. ? ? Users changing over time Nonstationarity
  • 16. Items changing over time popularity time Learned item bias Actual item popularity Item launch Item becomes available
  • 17. ● Aggregation ○ Decay functions (e.g. [Ding, Li, 2005]) ○ Buckets (e.g. [Zimdars, Chickering, Meek, 2001]) ● Extrapolation (e.g. [Koren, 2009]) ● Sequences ○ Markov (e.g. [Rendle, et al., 2010]) ○ Last N (e.g. [Shani, Heckerman, Brafman, 2005]) ○ RNNs (e.g. [Hidasi et al., 2015]) ● Features ○ Discretized (e.g. [Baltrunas, Amatriain, 2009]) ○ Continuous (e.g. example age in [Covington et. al., 2016]) Some modeling approaches time
  • 18. ● Generalizing to future behaviors through temporal extrapolation ● Time exhibits many periodicities ○ Daily ○ Weekly ○ Seasonally ○ … and even longer: Olympics, elections, etc. ● Additional periodic time context features can be added or extracted Time as context Experiment on a Netflix internal dataset
  • 19. ● Recommendation systems are a means to an end ○ Reward = enjoyment - interaction cost ○ Enjoyment integrated over time (e.g. goodness * length of view) ○ Interaction cost integrated over time ○ Don’t waste your users time ○ Magnitudes of enjoyment and cost may be user-specific ● Maximize enjoyment of the selected item while minimizing time it takes to find the item Minimizing interaction time
  • 20. Hangul alphabet, 3 syllables but requires 7 (2 + 3 + 2) interactionsClick
  • 21. With a model optimized to minimize interaction time: one interaction Click
  • 25. Algorithm C Algorithm B Algorithm A Algorithms changing Idea Offline experimentation Online experimentation (A/B) Rollout
  • 26. Algorithm C Algorithm B Algorithm A Algorithms changing Idea Offline experimentation Online experimentation (A/B) Rollout Assumes stationarity! A change in other parts of the system might invalidate previous (offline or online) results. Holdback A/B tests as part of rollout can help.
  • 27. UX changing over time % Match&
  • 28. Feedback loops Impression bias inflates plays Leads to inflated item popularity More plays More impressions Oscillations in distribution of genre recommendations Feedback loops can cause biases to be reinforced by the recommendation system!
  • 32. Closed Loop Training Data Watches Model Recs Danger Zone Search Training Data Watches Model Recs Open Loop
  • 33. Closed Loop Training Data Watches Model Recs Danger Zone Search Training Data Watches Model Recs Open Loop
  • 34. Open vs. Closed Loops [Based on Steck, 2013 with system as selector] Watch when rec Probability of rec Watch when not rec Probability of not rec
  • 35. Open vs. Closed Loops [Based on Steck, 2013 with system as selector] Watch when rec Probability of rec Watch when not rec Probability of not rec Closed loop: 0 Open loop: > 0
  • 36. Open vs. Closed Loops [Based on Steck, 2013 with system as selector] Watch when rec Probability of rec Watch when not rec Probability of not rec Closed loop: 0 Open loop: > 0 We have control over this
  • 37. ● Maintain some controlled exploration to break feedback loop and handle non-stationarities ● Explore with -greedy, Thompson Sampling, etc. ● Control to avoid significantly degrading user experience ● Log as much as possible ○ Include counterfactuals: What maximal action system wanted to do (e.g. [Bottou et al., 2013]) Controlled stochasticity Explore Explore
  • 38. Replay Metrics Observed reward Existing recommendation algorithm (with stochasticity) Observed reward New recommendation algorithm [Li et al., 2011; Dudik, Langford, Li, 2014] Simulate online metrics, offline!
  • 39. ● Stochasticity opens the door to using causal inference ● Inverse Propensity Weighting ○ Reduce production bias by reweighting train and test data ○ Know probability of user receiving an impression ○ Doesn’t handle simultaneity and other endogeneity ● Covariate shift ○ Use explore data to estimate bias in other data ○ Use all data to train ● Instrumental variables for more general settings Causality [Schnabel et al., 2016; Liang, Charlin, Blei, 2016; Smola, 2011, Sugiyama, Kawanabe, 2012]
  • 40. ● Most recommendations (and ML) models are correlational ○ These items are correlated with these types of users ● But we seek causal actions ○ Showing this item is rewarding for this user ● Our recommendation action should have an incremental effect in reward: E[r(a)] - E[r(∅)] ○ Application-dependent choice of ∅ ○ Sometimes it may be better not to provide a recommendation that simply maximizes p(vi |u) ○ May provide less obvious recommendations Incrementality p(vi |∅) p(vi |a) Incremental effect
  • 41. ● Gold standard of causality ○ Random assignment ○ Measured across time ○ Incremental benefit of treatment ● Causality safety net? ○ Hard to test with full feedback loop effects ○ An algorithm may behave differently when training off its own data ○ Holdback tests A/B Testing Time A (Control) B (Treatment) Significant? Metrics
  • 43. ● After users and items, time is usually the next most important factor in recommendation systems ○ Model it as such ○ Evaluate it as such ○ Make it central to your system and infrastructure ● Recommender systems act in a causal loop ○ Influenced by themselves and others ○ Be thoughtful about feedback effects Takeaways
  • 44. Thank you. @JustinBasilico @moustaki Justin Basilico & Yves Raimond Yes, we’re hiring...
  • 45. Déjà Vu The Importance of Time and Causality in Recommender Systems Justin Basilico & Yves Raimond August 29, 2017 @JustinBasilico @moustaki