Time, Context and
Causality in
Recommender Systems
Yves Raimond
October 2018
France is AI
@moustaki
● A few seconds to find something
great to watch…
● Can only show a few titles
● Enjoyment directly impacts
customer satisfaction
● How? Personalize everything, for
130M members across 190+
countries
Profile 1 Profile 2
Correlational recommender
systems
p(Y|X)
Outcome
(e.g. play)
Features
(e.g. past plays)
0 1 0 1 0
0 0 1 1 0
1 0 0 1 1
0 1 0 0 0
0 0 0 0 1
UsersItems
1 0 0 1 0
0 1 0 0 1
0 0 0 1 0
0 0 1 0 0
K
K
V Softmax
However...
These models can serve you well, but ignore key aspects of the
recommendation problem:
Recommendations happen at a moment in time, in a given context
Time
● Don’t overfit the past, focus on predicting the future
● Explicitly model temporal drift and system dynamics
Time + Context
● X: sequence of contextual user actions, plus
current context
● Y: probability of next action
● E.g. “Given all the actions a user has taken so far,
what’s the most likely video they’re going to play
right now?”
Offline ranking improvements
Causal recommender
systems
However...
… correlational recommender systems are missing something else:
Recommendations are actions at a moment in time, in a given context
Feedback loops
User
Researcher
Offline/online mismatches
Production
Interaction
data
New model
Offline
evaluation
Online
evaluation
(A/B)
p(Y|X, do(R))
Recommendation
Causal recommender systems
● p(Y|X) can be misleading
● Ignores the user in the loop
● Model the causal nature of a
recommendation instead
● Two steps:
○ Model p(Y|X, do(R))
○ Build policy, e.g. what R
leads to max Y? (from http://www.tylervigen.com/spurious-correlations)
Approach 1: Epsilon-Greedy
Visit
Explore
policy
Greedy
policy
N%
100-N%
Epsilon
Member
Candidate Pool
Selected
Randomize
Greedy
Member
Features
Candidate Pool
Model 1
Winner
Probability Of
Engagement
Model 2
Model 3
Model 4
Replay
Replay play-rate = 2/3
Approach 1 pros & cons
● Pros
○ Simple
○ Helps feedback loops & offline/online mismatches
● Cons
○ Exploration has a cost
○ Doesn’t scale well with size of the candidate pool
Approach 2: Propensities
Policy
p(R|X)
+
(X, R, Y)
R Y
Inverse
propensity
weighting
X
p(Y|X, R)
Approach 2 pros & cons
● Pros:
○ Model-agnostic
○ Simple
○ Scale well to large candidate sets
● Cons:
○ Only unbiased if no unobserved confounders
■ Hard to validate in practice
○ Variance can blow up
■ Variance regularization or weights clipping can help
Approach 3: Instrumental Variable
Example: What’s the causal impact of a
recommendation?
R YZ
Noise OutcomeRec
An instrumental variable Z can only influence the outcome Y through R
Building causal models with instrumental variables:
2SLS (two-stage least-squares) or SGDIV (to be published)
Approach 3 pros & cons
● Pros:
○ Robust to unobserved confounders
● Cons:
○ Bias/Variance depends on strength of the IV
○ Harder to scale?
In summary...
● Epsilon-Greedy: simple, but expensive
● IPS: great and flexible, but doesn’t deal with unobserved
confounders
● IV: deals with unobserved confounders, harder to scale
● Many more approaches available...
Conclusions
Conclusions
● Recommendations are actions at a moment in time, in a given context
● Correlational algorithms are great, until they start driving most of the
data
● Recommendation algorithms make decisions, which have
consequences
● Causal models are required to reason about this impact
Questions?

Time, Context and Causality in Recommender Systems