In the Eye of the Beholder: Robust Prediction with Causal User Modeling
Abstract
Accurately predicting the relevance of items to users is crucial to the success of many social platforms.
Conventional approaches train models on logged historical data; but recommendation systems, media services, and online marketplaces all exhibit a constant influx of new content—making relevancy a moving target, to which standard predictive models are not robust.
In this paper, we propose a learning framework for relevance prediction that is robust to changes in the data distribution.
Our key observation is that robustness can be obtained by accounting for how users causally perceive the environment .
We model users as boundedly-rational decision makers whose causal beliefs are encoded by a causal graph, and show how minimal information regarding the graph can be used to contend with distributional changes.
Experiments in multiple settings demonstrate the effectiveness of our approach.
1. Introduction
Across a multitude of domains and applications, machine learning has become imperative for guiding human users in many of the decisions they make [41,53,10].
From recommendation systems and search engines to e-commerce platforms and online marketplaces, learned models are regularly used to filter content, rank items and display select information—all with the primary intent of helping users choose items that are relevant to them.
The predominant approach for learning in these tasks is to train models to accurately predict the relevance of items to users, but since training is often carried out on logged historical records, even highly-accurate models remain calibrated to the distribution of previously observed data on which they were trained [7,54,51].
Given that in virtually any online platform the distribution of content naturally varies over time and
City, Anonymous Region,
Anonymous Country.
Correspondence to: Anonymous Author <
anon.email@domain.com>.
Preliminary work.
Under review by the SCIS workshop.
location—due to trends and fashions, innovation, or forces of supply and demand—models trained on logged data may fail to correctly predict the choices and preferences of users on unseen, future distributions [12,1,18,26,33].
In this paper, we present a novel conceptual framework for learning predictive models of user-item relevance that are robust to changes in the underlying data distribution.
Our approach is built around two key observations: (i) that relevance to users is determined by the way in which users perceive value, and (ii) that this process of value attribution is causal in nature.
As an example, consider a video streaming service in which a user 𝑢 is trying to determine whether watching a certain movie will be worthwhile.
To make this decision, 𝑦 ∈ {0 , 1} , the user has at her disposal a feature description of the movie, 𝑥 , and a system-generated, personalized relevance score, 𝑟 (e.g., “a 92% match!”).
How will she integrate these two informational sources into a decision?
We argue that this crucially hinges on her belief as to why a particular relevance score is coupled to a particular movie.
For example, if a movie boasts a high relevance score, then she might suppose this score was given because the system believes the user would like this movie.
Another user, however, may reason differently, and instead believe that high relevance scores are given because movies are sponsored; if she suspects this to be a likely scenario, her reasoning should have a stark effect on her choices.
In both cases, perceived values stem from how each user causally interprets the recommendation environment, and the underlying causal structure determines how belief regarding value changes, in response to changes in important variables.
Here, we show how knowledge regarding the causal perceptions of users can be leveraged for providing distributional robustness in learning.
A primary concern for robust learning is the reliance of predictions on spurious correlations [3]; here we argue that spuriousness can result from causal perceptions underlying user choice behavior.
To see the relation between causal perceptions and spuriousness, assume that in our movies example above, the training data exhibits a strong correlation between users’ choices of movies, 𝑦 , and a ‘genre’ feature, 𝑥 𝑔 .
A predictive model optimized for accuracy will likely exploit this association, and rely on 𝑥 𝑔 for prediction.
Now, further assume that what really drives user satisfaction is ‘production quality’, 𝑥 𝑞 ; if 𝑥 𝑔 and 𝑥 𝑞 are spuriously correlated in the training data, then once the distribution of genres naturally changes over time, the predictive model can fail: the association between 𝑥 𝑔 and 𝑦 , on which predictions rely, may no longer hold.
In essence, our approach casts robust prediction of personalized relevance as a problem of out-of-distribution (OOD) learning, but carefully tailored to settings where data generation is governed by users’ causal beliefs and corresponding behavior.
There is a growing recognition of how a causal understanding of the learning environment can improve crossdomain generalization [3,50]; our key conceptual contribution is the observation that, in relevance prediction, users’ perceptions are the causal environment.
Thus, there is no ‘true’ causal graph—all is in the eye of the beholder.
To cope with this, we model users as reasoning about decisions through a causal graph [34,43]— allowing our approach to anticipate how changes in the data translate to user behavior.
[Figure]
Building on this idea, as well as on recent advances in the use of causal modeling for out-ofdistributionlearning [3, 50, 49], we show how various levels of knowledge regarding users’ causal
beliefs
can be utilized for learning distributionally robust predictive models.
To encourage predictions ̂𝑦 to be invariant to changes in the environment 𝑒 , our approach enforces independence between ̂𝑦 and 𝑒 .
This is achieved with regularization [21].
In general, different graphs require different regularization [49]; unfortunately, inferring user graphs is likely to be costly and challenging.
Our key observation is that, for user graphs, it suffices to know which of two classes the graph belongs to— causal or anti-causal — determined by the direction of edges between 𝑥, 𝑟 and 𝑦 (Fig. 1a).
The user’s class, which is easier to infer, determines the regularization scheme.
Nonetheless, more fine-grained information can still be useful.
We show the following novel result: if two users generate the same data, but differ in their underlying graph, they will have different optimal out-of-distribution models.
The reason for this is that, to achieve robustness, regularizing for independence will result in the discarding of different information for each user.
Operationally, this means that learning should include different models for each user-type.
Here again we show that minimal additional information is useful, and focus on subclasses of graphs that differ only in the direction of the edges between 𝑥 and 𝑟 (Fig. 1b); nonetheless, our result applies broadly and may be of general interest for causal learning.
In Appendix A we present a thorough empirical evaluation of our approach, where we explore the benefits of different forms of knowledge regarding users’ causal beliefs: whether they are casual or anti-causal , and the directionality of 𝑥 ⇆ 𝑟 .
Importantly, our results also imply that not accounting for causal aspects of user decisionmaking, can result in poor OOD performance.
2. Modelling Approach 2.1. Learning Setting
In our setting, data consists of users, items, and choices.
Users are described by features 𝑢 ∈ ℝ 𝑑 𝑢 , and items are described by two types of features: intrinsic item properties,
𝑥 ∈ ℝ 𝑑 𝑥 (e.g., movie genre, plot synopsis, cast and crew), and information provided by the platform, 𝑟 ∈ ℝ 𝑑 𝑟 (e.g., recommendation score, user reviews).
We will sometimes make a distinction between features that are available to users, and those that are not; in such cases, we denote unobserved features by ̄𝑥 , and with slight abuse of notation, use 𝑥 for the remaining observed features (we assume 𝑟 is always observed).
Choices 𝑦 ∈ {0 , 1} indicate whether a user 𝑢 chose to interact with a certain item ( 𝑥, 𝑟 ) .
As we are interested in robustness to distributional change, we follow the general setup of domain generalization [6,25,5,50] in which there is a collection of environments, denoted by a set  , and each environment 𝑒 ∈  defines a different joint distribution 𝐷 𝑒 over ( 𝑢, 𝑥, 𝑟, 𝑦 ) .
We assume there is training data available from a subset of 𝐾 environments,  train = { 𝑒 1 , … , 𝑒 𝐾 } ⊂  , with datasets 𝑆 𝑘
= {( 𝑢 𝑘𝑖 , 𝑥 𝑘𝑖 , 𝑟 𝑘𝑖 , 𝑦 𝑘𝑖 )} 𝑚 𝑘 𝑖 =1 drawn i.i.d from the corresponding 𝐷 𝑒 𝑘 .
We denote the pooled training distribution by 𝐷 train = ∪ 𝑒 ∈  train 𝐷 𝑒 and the pooled training data by 𝑆 = ∪ 𝑘 𝑆 𝑘 with 𝑚 =
∑ 𝑘 𝑚 𝑘 .
Our goal is to learn a robust predictive model ̂𝑦 =
𝑓 ( 𝑢, 𝑥, 𝑟 ; 𝜃 ) ∶=
𝑓 𝑢 ( 𝑥, 𝑟 ; 𝜃 ) .
Robustness via causal graphs.
The type of robustness that we would like our model to satisfy is counterfactual invariance (CI) [49].
Denoting 𝑥 ( 𝑒 ) , 𝑟 ( 𝑒 ) as the counterfactual features that would have been observed had the environment been set to 𝑒 , we define a model 𝑓 𝑢 as CI if ∀ 𝑒, 𝑒 ′ ∈
 it holds a.e. that 𝑓 𝑢 ( 𝑥 ( 𝑒 ′ ) , 𝑟 ( 𝑒 ′ ); 𝜃 ) = 𝑓 𝑢 ( 𝑥 ( 𝑒 ) , 𝑟 ( 𝑒 ); 𝜃 ) .
The challenge in obtaining CI predictors is that at train time we only observe a subset of the environments,  train ⊂  , while CI requires independence to hold for all environments
𝑒 ∈  .
To reason formally about the role of 𝑒 in the data generating process, and hence about the type of distribution shifts under which our model should remain invariant, it is common to assume that a causal structure underlies data generation [22,3].
This is often modeled as a (directed) causal graph [34]; robustness is then defined as insensitivity of the predictive model to changes (or ‘interventions’) in the variable 𝑒 , which can trigger changes in other variables that lie ‘downstream’ in the graph.
To encourage robustness, a common approach is to construct a learning objective that avoids spurious correlations by enforcing certain conditional independence relations to hold, e.g., via regularization (see §3).
The question of which relations are required can be answered by examining the graph and the conditional independencies it encodes (between 𝑒, 𝑥, 𝑟, 𝑦 , and ̂𝑦 ).
Unfortunately, inferring the causal graph is in general hard; however, determining the ‘correct’ learning objective may require only partial information regarding the graph.
2.2. Users as decision makers
Rational users.
To see how modeling users as causal decision-makers can be helpful, consider first a conventional ‘correlative’ approach for training 𝑓 𝑢 , e.g. by minimizing the loss of a corresponding score function
𝑣 𝑢 ( 𝑥, 𝑟 ) =
𝑣 ( 𝑢, 𝑥, 𝑟 ) , and predicting via ̂𝑦 = argmax 𝑦 ∈{0 , 1} 𝑦𝑣 𝑢 ( 𝑥, 𝑟 ) =
{ 𝑣 𝑢 ( 𝑥, 𝑟 ) > 0} .
From the perspective of user modeling, 𝑣 𝑢 can be interpreted as a personalized ‘value function’; this complies with classic Expected Utility Theory (EUT) [48], in which users are modeled as rational agents acting to maximize (expected) value, and under full information .
From a causal perspective, this approach is equivalent to assuming a graph in which all paths from 𝑒 to 𝑦 are blocked by 𝑥, 𝑟 —which is akin to assuming no spurious pathways, and so handicaps the ability to avoid them.
Boundedly-rational users.
We propose to model users as boundedly-rational decision-makers, under the key assertion that users’ decisions take place under inherent uncertainty .
Uncertainty plays a key role in how we, as humans, decide: our actions follow not only from what we know, but also from how we account for what we don’t know.
Nonetheless, despite being central to most modern theories of decision making [24], explicit modeling of user-side uncertainty is currently rare within ML [36,2,37].
Our modeling approach acknowledges that users know some features are unobserved, and that this influences their actions.
Consider a user shopping online for a vintage coat, and considering whether to buy a certain coat.
The coat’s description includes several intrinsic properties 𝑥 as well as certain platform-selected information 𝑟
The user wants to make an informed decision, but knows some important information, ̄𝑥 , is missing
If she is concerned about buying a modern knockoff, how should she act?
A common approach is to extend EUT to support uncertainty by modelling users as integrating subjective beliefs about unobserved variables, 𝑝 𝑢 ( ̄𝑥 | 𝑥, 𝑟, 𝑒 ) , into a conditional estimate of value, ̃𝑣 𝑢 ( 𝑥, 𝑟 | 𝑒 ) , over which choices 𝑦 are made: ̃𝑣 𝑢 ( 𝑥, 𝑟 | 𝑒 ) =
∑ ̄𝑥 𝑣 𝑢 ( 𝑥, ̄𝑥, 𝑟 ) 𝑝 𝑢 ( ̄𝑥 | 𝑥, 𝑟, 𝑒 )
[Figure]
where 𝑦 = 1 { ̃𝑣 𝑢 ( 𝑥, 𝑟 | 𝑒 ) > 0} .
Here, 𝑝 𝑢 ( ̄𝑥 | 𝑥, 𝑟, 𝑒 ) describes a user’s (probabilistic) belief regarding the conditional likelihood of each ̄𝑥 and 𝑣 𝑢 ( 𝑥, ̄𝑥, 𝑟 ) describes the item’s value to the user given ̄𝑥 Importantly, note that uncertainty beliefs 𝑝 𝑢 ( ̄𝑥 | 𝑥, 𝑟, 𝑒 ) can be environment-specific
In turn, value estimates ̃𝑣 and choices 𝑦 can also rely on 𝑒 .
For clarity, since 𝑦 is a deterministic function of ̃𝑣 , we will simply refer to 𝑦 as a function of 𝑥, 𝑟 , and 𝑒 .
Causal user graphs.
One interpretation of users’ utility function is that they cope with uncertainty by employing causal reasoning [43], this aligning with a predominant approach in the cognitive sciences that views humans as acting based on ‘mental causal models’ [42].
Here we follow [43] and think of users as reasoning through personalized user causal graphs , denoted 𝐺 𝑢 .
The structure of 𝐺 𝑢 expresses 𝑢 ’s causal beliefs—namely which variables causally affect others—and its factors correspond to the conditional terms ( 𝑝 𝑢 and 𝑣 𝑢 ) in the utility function.
A key modeling point is that users can vary in their causal perceptions; hence, different users may have different graphs that encode different conditional independencies, these inducing different simplifications of the conditional terms.
For example, a user that believes movies with a five-star rating ( 𝑟 ) are worthwhile regardless of their content ( 𝑥 ) would have 𝑣 𝑢 ( 𝑥, ̄𝑥, 𝑟 ) reduced to 𝑣 𝑢 ( ̄𝑥, 𝑟 ) , since 𝑣 ⫫ 𝑥 | 𝑟 ; meanwhile, a user who, after reading a movie’s description ( 𝑥 ), is unaffected by its rating ( 𝑟 ), would have 𝑣 𝑢 ( 𝑥, ̄𝑥 ) instead, since 𝑣 ⫫ 𝑟 | 𝑥 .
2.3. Towards robust learning
Recall that our goal is to learn a predictor 𝑓
that is unaffected by spurious correlations, and that these can materialize through direct edges 𝑒 → 𝑦 .
Continuing our illustrative example, assume that the causal beliefs of our boundedlyrational user are encoded by the graph in Figure 2.
The graph does not have a direct edge 𝑒 → 𝑦 ; however, by accounting for uncertainty (i.e., choosing via ̃𝑣 ), the user behaves ‘as if’ there actually was a direct edge—since integrating over ̄𝑥 ‘removes’ it from the indirect path 𝑒 → ̄𝑥 → 𝑦 .
This support our main argument: by making decisions, users can generate spurious correlations in the data (Fig. 2 (‘User model’)).
The above has two implications.
First, it shows how conventional approaches can fail.
For example, since users observe only 𝑥 and 𝑟 , one reasonable approach is to discard ̄𝑥 and train a predictor 𝑓 𝑢 ( 𝑥, 𝑟 ; 𝜃 ) in hopes of mimicking user choice behavior (Fig.
(‘Model A’)).
In graphical terms, this means learning ‘as if’ there is no edge 𝑒 → 𝑦 .
But the reliance of users on ̄𝑥 for producing 𝑦 means that, effectively, such an edge exists.
The result of this is that 𝑓 𝑢 can learn to use 𝑥 and 𝑟 to compensate for the constant effect of 𝑒 on 𝑦 .
Conversely, the system may choose to learn using all available information, namely train 𝑓 𝑢 ( 𝑥, ̄𝑥, 𝑟 ; 𝜃 ) (Fig.(‘Model B’)).
This make sense if the goal is in-distribution generalization; for OOD, this not only creates an illusion of separation between 𝑒 and 𝑦 , but also erroneously allows to use the variation in ̄𝑥 to explain 𝑦 .
As a result, 𝑓 𝑢 will likely overfit to distributions in  train .
Second, the awareness to how users account for uncertainty suggests a means to combat spuriousness.
The utility function shows that 𝑦 depends on 𝑥, 𝑟 , and 𝑒 ; hence, since our goal is to discourage the dependence of ̂𝑦 on 𝑒 , it follows that (i) functionally, 𝑓 𝑢 should depend only on 𝑥 and 𝑟 but (ii) 𝑓 𝑢 should be learned in a way that controls for variation in 𝑒 .
3. Learning With Causal User Models
Our approach to robust learning is based on regularized risk minimization, where regularization acts to discourage variation in predictions across environments [49,50].
Our learning objective is: argmin 𝑓 ∈ 𝐹 𝐿 ( 𝑓 ; 𝑆 ) + 𝜆𝑅 ( 𝑓 ; 𝑆 1 , … , 𝑆 𝐾 ) where 𝑅 is a regularization term with coefficient 𝜆 .
The role of 𝑅 is to penalize 𝑓 for violating certain statistical independencies; the question of which independencies should be targeted—and hence the precise form that 𝑅 should have— can be answered by the underlying causal graph [49].
Knowing the full user graph can certainly help, but relying on this is impractical.
Luckily, coarse information regarding the graph can be translated into necessary conditions for distributional robustness, and in App.
A we show that these can go a long way towards learning robust models.
We focus on two methods for promoting statistical independence of ̂𝑦 and 𝑒 [49]: MMD [21] and CORAL [47] (see App. E).
3.1. User graph classes: causal vs. anti-causal
Following our example in Fig.1a, consider users of two types: a ‘causal’ user 𝑢
→ 𝑦 that believes value is an effect of an item’s description (i.e., 𝐷 𝑒 ( 𝑥, 𝑟, 𝑦 ∣ 𝑢 = 𝑢 → 𝑦 ) is entailed by the graph 𝑥, 𝑟 → 𝑦 for each 𝑒 ∈  ), and an ‘anti-causal’ user 𝑢 ← 𝑦 that believes the item’s value causes its description (i.e., 𝐷 𝑒 ( 𝑥, 𝑟, 𝑦 ∣ 𝑢 = 𝑢 ← 𝑦 ) is entailed by 𝑥, 𝑟 ← 𝑦 respectively).
Our next result shows that: (i) 𝑢 → 𝑦 and 𝑢 ← 𝑦 require different regularization schemes; but (ii) that the appropriate scheme is fully determined by their type— irrespective of any other properties of their graphs.
Thus, from a learning perspective, it suffices to know which of two classes a user belongs to: causal, or anti-causal.
Proposition 1.
Let 𝑓 be a CI model and assume 𝑦 and 𝑒 are confounded (e.g., 𝑒 → 𝑦 exists), then:
[Equation]
1) 𝑓 𝑢 → 𝑦 must satisfy 𝑃 𝐷 𝑒
[Equation]
𝑓 𝑢 →
[Equation]
2) 𝑓 𝑢
[Equation]
𝑦 must satisfy
[Equation]
On the other hand, 𝑓 𝑢 → 𝑦 need not necessarily satisfy (2), and 𝑓 𝑢 ← 𝑦 need not necessarily satisfy (1).
If we fail to enforce these constraints during learning, then we will not learn a CI classifier.
On the other hand, enforcing unnecessary constraints restricts our hypothesis class and hence limits performance.
The proof follows directly from [49] (see App.
B).
The distinction between causal and anti-causal prescribes the appropriate regularization.
For any user 𝑢 , to encourage 𝑓 𝑢 ( 𝑥, 𝑟 ) to be invariant to changes in 𝑒 , set:
[Equation]
where Φ 𝑘,𝑢 , Φ ( 𝑦 ) 𝑘 includes the subset of examples with user 𝑢 and label 𝑦 , respectively.
3.2. User graph subclasses: inter-feature relations
Consider now two users that are of the same class (i.e., causal or anti-causal), but perceive differently the causal relations between 𝑥 and 𝑟 : a believer , 𝑢 𝑥 → 𝑟 , who believes recommendations follow from the item’s attributes; and a skeptic , 𝑢 𝑥 ← 𝑟 , who presumes that the system reveals item attributes to match a desired recommendation (see Fig.1b).
Our main result shows that even if both users share the same objective preferences—to be optimally invariant, each user may require her own, independently-trained model.
Proposition 2.
Let 𝑢 𝑥 → 𝑟 , 𝑢 𝑥 ← 𝑟 be two users of the same class (i.e., causal or anti-causal) but of a different subclass (i.e., believer and skeptic, respectively).
Even if there is a single predictor 𝑓 which is optimal for the pooled distribution 𝐷 train , each user can have a different optimal CI predictor.
Proof is in Appendix B. Prop. 2 can be interpreted as follows:
Take some 𝑢 , and ‘counterfactually’ invert the edges between 𝑥 and 𝑟 .
In some cases, this will have no effect on 𝑢 ’s behavior under  train , and so any 𝑓 that is optimal in one case will be optimal in the other.
Nonetheless, for optimality to carry over to other environments—different predictors may be needed.
This is since each causal structure implies a different interventional distribution, and hence a different set of CI predictors: e.g., in 𝐺 𝑥 ← 𝑟 , the v-structure 𝑒 → 𝑥 ← 𝑟 suggests that an invariant predictor may depend on 𝑟 , yet in 𝐺 𝑥
→ 𝑟 it cannot.
In §A.3, we evaluate this empirically.
A. Experiments and Results
We present three experiments: two targeting user classes ( causal or anti-causal ) and using real data, and one targeting user subclasses ( believers and skeptics ) and using synthetic data.
Appendix D includes further details on model architectures, training procedures, and data generation.
A.1. Learning with causal users: text-based beer recommendation
Data.
We use RateBeer , a dataset of beer reviews with over 3M entries and spanning ∼ 10 years [31].
We use the data to generate beer features 𝑥 (e.g., popularity, average rating) and 𝑟 (e.g., textual review embeddings) and user features 𝑢 (e.g., average rating, word counts).
Given a sample ( 𝑢, 𝑥, 𝑟 ) , our goal is to predict a (binarized) rating 𝑦 .
Here we focus on causal users, and so would like labels 𝑦 to expresses causal user beliefs.
The challenge is that our observational data is not necessarily such.
To simulate causal user behavior, we rely on the observation that 𝑥, 𝑟 → 𝑦 means “changes in 𝑥, 𝑟 affect 𝑦 ”, and for each 𝑢 create an individualized empirical distribution of ‘counterfactual’ samples ( 𝑥 ′ , 𝑟 ′ , 𝑦 ′ )
that approximate the entire intervention space (i.e., all counterfactual outcomes 𝑦 ′ under possible interventions ( 𝑥, 𝑟 ) ↦ ( 𝑥 ′ , 𝑟 ′ ) ).
Training data is then generated by sampling from this space.
We consider each year as an environment 𝑒 , with each 𝑒 inducing a distribution over ( 𝑢, 𝑥, 𝑟 ) .
We implement spuriousness via selection: Each 𝑒 entails different fashionable ‘tastes’ in beer, expressed as a different weighting over the possible beer types (e.g., lager, ale, porter).
Labels are then made to correlate with tastes in a certain temporal pattern.
This serves as a mechanism for spurious correlation.
Results.
Fig.
3 compares the performance over time of three training procedures that differ only in the type of regularization applied: causal , anti-causal , and non-causal .
Our data includes behavior generated by causal-class users; results demonstrate the clear benefit of using a behaviorallyconsistent regularization scheme (here, causal).
Note the causal approach is not optimal in 2006 and 2008; this is since correlations in 𝑒 ↔ 𝑦 are set to make these years similar to the training data.
However, in the face of significant shifts in taste, other approaches collapse, while the causal approach remains stable.
A.2. Learning with anti-causal users: clothing-style recommendation
Data.
We use the fashion product images dataset 1 , which includes includes 44 .
4 𝑘 fashion items described by images, attributes, and text.
Here we focus on anti-causal users, and
The anti-causal regularization scheme, consistent with the user class, outperforms methods when test-time deviates from train-time correlation (=0.8).
When correlations flip ( < 0 . 5 ), other methods crash.
generate data in a way similar to §A.1, but using an anticausal intervention space.
In this experiment we let user choices 𝑦 ∈ {0 , 1} depend on an item’s image and color, which can be either red or green; in this way, 𝑥 is the item’s grayscale image, and 𝑟 its hue (which we control).
Here we consider environments 𝑒 that induce varying degrees of spurious correlations between color and user choices, 𝑃 ( 𝑦 = 1 | 𝚛𝚎𝚍 ) =
𝑃 ( 𝑦 = 0 | 𝚐𝚛𝚎𝚎𝚗 )
= 𝑝 𝑒 .
For the test set we use 𝑝 𝑒 = 0 . 8 , and experiment with training data that gradually deviate from this relation, i.e., having 𝑝 𝑒 ′ ∈ [0 . 1 , 0 . 8] .
Results.
Fig.
4 shows that consistent regularization (here, anti-causal) outperforms other alternatives whenever corre- 𝑒 𝑟 𝑥 𝑠𝑝 𝑥 𝑎𝑐 𝑦
how separate lations deviate from those observed in training.
Once correlations flip ( < 0 . 5 ), both causal and non-causal approaches fail catastrophically; the anti-causal approach remains robust.
A.3. Learning with multiple user subclasses
[Table]
Our final experiment studies learning with users of of the same-class (here, anti-causal ) but different sub-classes: skeptics or believers .
Our analysis in §3.2 suggests that each user sub-class may have a different optimal predictor; here we investigate this empirically on synthetic data.
Data.
The data-generating process is as follows (see Fig.
We use three environments: 𝑒 1 , 𝑒 2 at train, and 𝑒 3 at test, and implement a selection mechanism (dashed line) that causes differences in 𝑝 ( 𝑦 | 𝑒 𝑖 ) across 𝑒 𝑖 .
Since we focus on anti-causal users, features 𝑥, 𝑟 are determined by 𝑒, 𝑦 .
We use three binary features: 𝑥 𝑠𝑝 (‘spurious’), 𝑥 𝑎𝑐 (’anticausal’), and 𝑟 .
These are designed so that an 𝑓 which uses 𝑥 𝑎𝑐 alone obtains 0 .
75 accuracy, but using also 𝑥 𝑠𝑝 improves in-distribution (ID) accuracy slightly to 0 .
78 , and so the optimal ID predictor for both user subclasses is of the form 𝑓 ∗ ( 𝑥 𝑎𝑐 , 𝑥 𝑠𝑝 ) .
However, relying on 𝑥 𝑠𝑝 causes out-ofdistribution (OOD) performance to deteriorate considerably; thus, robust models should not learn to discard 𝑥 𝑠𝑝 .
The role of 𝑟 is to distinguish between user subclasses: The skeptic does not need 𝑟 since, for her, it is fully determined by 𝑥 𝑠𝑝 ; the optimal invariant predictor is hence 𝑓 𝑥 → 𝑟 ( 𝑥 𝑎𝑐 ) .
Meanwhile, the believer, due to the v-structure 𝑟 → 𝑥 𝑠𝑝 ← 𝑒 , can benefit in-distribution by using both 𝑟 and 𝑥 𝑠𝑝 ; here, the optimal invariant predictor is 𝑓 𝑥 ← 𝑟 ( 𝑥 𝑎𝑐 , 𝑟 ) .
Results.
Table 1 shows ID and OOD performance for each user subclass (columns), for learning with and without regularization (rows).
Since all users are anti-causal, we use anti-causal (i.e., conditional) regularization.
We compare learning a separate predictor for each user type (rows ‘ skeptic ’ and ‘ believer ’) and learning a single predictor over all users jointly (‘both’).
Results show that without regularization ( 𝜆 = 0 ), ID performance is good, but the learned predictor fails OOD—drastically for skeptic users (note all rows are the same since both user types share the same IDoptimal 𝑓 ∗ ).
In contrast, when regularization is applied ( 𝜆 > 0 ), learning an independent predictor for each user subclass performs well OOD (for both subclasses), indicating robustness to changing environments; note that ID performance is also mostly maintained.
Meanwhile, learning on the entire dataset (i.e., including both user types) does provide some robustness—but is suboptimal both ID and
OOD.
B. Details on Formal Claims
Our claim in Proposition 1 is also based on the setting of
Veitch et al.
Under the assumption that 𝑒 is discrete,
Lemma 3.1 of [49] ensures that there exists a random variable ( 𝑥, 𝑟 ) ⟂ 𝑒 such that 𝑓 𝑢 ( 𝑥, 𝑟 ) is CI if and only if it is ( 𝑥, 𝑟 ) ⟂ 𝑒measurable.
Then we will assume that 𝑥, 𝑟 can be decomposed into parts 𝑥, 𝑟 𝑦 ∧ 𝑒 , 𝑥, 𝑟 ⟂ 𝑦 , 𝑥, 𝑟 ⟂ 𝑒 .
Note that we do not assume that we know how to decompose our features in this manner, nor we assume anything about the semantic meaning of these components.
We only assume that this decomposition exists, and then the main assumption made in [49] is that the graph in Fig.
1a conforms to the structures in Figure 6 for each user type.
We are now ready to state Proposition 1 in a more precise manner
Proposition 3.
Let 𝑓 be a CI model and assume 𝑦 and 𝑒 are confounded (i.e. they are connected by an unobserved common cause 𝑐 or by a directed path).
Further assume that 𝐷 𝑒 ( 𝑥, 𝑟, 𝑦 ∣ 𝑢 ) is entailed by the causal models in Fig.
6 for 𝑢 = 𝑢
→ 𝑦 and 𝑢 = 𝑢 ← 𝑦 .
Then the following holds:
𝑓 𝑢 → 𝑦 must satisfy 𝐷 𝑒 ( 𝑓 𝑢 → 𝑦 ( 𝑥, 𝑟 )) =
𝐷 𝑒 ′ ( 𝑓 𝑢 → 𝑦 ( 𝑥, 𝑟 )) ∀ 𝑒, 𝑒 ′ ∈  .
𝑓 𝑢 ← 𝑦 must satisfy 𝐷 𝑒 ( 𝑓 𝑢 ← 𝑦 ( 𝑥, 𝑟 ) ∣ 𝑦 ) =
𝐷 𝑒 ′ ( 𝑓 𝑢 ← 𝑦 ( 𝑥, 𝑟 ) ∣
[Figure]
𝑦 ) ∀ 𝑒, 𝑒 ′ ∈  , 𝑦 ∈ {0 , 1} .
On the other hand, 𝑓 𝑢 ← 𝑦 and 𝑓 𝑢 → 𝑦 do not necessarily satisfy conditions 1 and 2, respectively.
Proof.
Under the assumptions laid out about the causal model, the conditional independence relations can be read off the graph directly, as in Theorem 3.2 of [49].
This proves that the independence properties stated in the proposition must hold.
To see that 𝑓 𝑢 ← 𝑦 , 𝑓 𝑢 → 𝑦 do not necessarily satisfy properties 1 and 2 respectively, we will prove the existence of such cases.
Consider a causal model where 𝑒 and 𝑦 are confounded, and assume that the model is faithful [34] (i.e. all conditional independence statements that are not entailed by the graph do not hold).
Hence for the causal user we generally have 𝐷 𝑒 (( 𝑥, 𝑟 ) ⟂
𝑒 ∣ 𝑦, 𝑢 = 𝑢 → 𝑦 ) ≠ 𝐷 𝑒 ′ (( 𝑥, 𝑟 ) ⟂
𝑒 ∣ 𝑦, 𝑢 = 𝑢 → 𝑦 ) (at the very least there are values of ( 𝑥, 𝑟 ) ⟂ 𝑒 , 𝑦 for which this holds), and hence there exists some ( 𝑥, 𝑟 ) ⟂ 𝑒measurable function ̂𝑓 𝑢 → 𝑦 ( 𝑥, 𝑟 ) that satisfies 𝐷 𝑒 ( ̂ 𝑓 ( 𝑥, 𝑟 ) ∣ 𝑦,
[Equation]
̂ 𝑓 ( 𝑥, 𝑟 ) ∣ 𝑦, 𝑢 = 𝑢 → 𝑦 ) .
The same argument can be applied for the anti-causal user 𝑢 ← 𝑦 to prove the existence of an ( 𝑥, 𝑟 ) ⟂ 𝑒 -measurable function ̂𝑓 𝑢 ← 𝑦 ( 𝑥, 𝑟 ) that satisfies
[Equation]
The model ̂𝑓 ( 𝑥, 𝑟 ) is CI since the constructed functions are ( 𝑥, 𝑟 ) ⟂ 𝑒 -measurable, but models 𝑓 𝑢 ← 𝑦 , 𝑓 𝑢 → 𝑦 do not satisfy conditions 1 and 2 respectively, which concludes our claim.
Next we prove Proposition 2 by constructing a confounded model for an anti-causal user, similar to the one in the synthetic experiment of Section A.3.
Towards this proposition, we point out that an optimal CI predictor is defined as a
CI predictor with the best possible worst case performance.
Where the worst case is taken over all distributions that are causally-compatible [49] with the source distribution 𝐷 train .
Definition 1.
𝐷 train and 𝐷 OOD are causally compatible if they are entailed by the same causal graph, 𝐷 train ( 𝑦 ) =
𝐷 OOD ( 𝑦 ) , and there is a confounder 𝑐 and/or selection conditions 𝑠, ̃𝑠 such that 𝐷 train = ∫ 𝐷 train ( 𝑥 𝑠𝑝 , 𝑥 𝑎𝑐 , 𝑟, 𝑦 ∣ 𝑐, 𝑠 = 1) 𝑑 ̃𝑃 ( 𝑐 ) and 𝐷 OOD = ∫ 𝐷 train ( 𝑥 𝑠𝑝 , 𝑥 𝑎𝑐 , 𝑟, 𝑦 ∣ 𝑐, ̃𝑠 = 1)
𝑑 ̃𝑄 ( 𝑐 ) for some ̃𝑃 ( 𝑐 ) , ̃𝑄 ( 𝑐 ) .
Let us focus now on distributions where 𝑓 ( 𝑥 𝑠𝑝 , 𝑟, 𝑥 𝑎𝑐 ) is counterfactually invariant if and only if it is ( 𝑟, 𝑥 𝑎𝑐 ) - measurable (the expression ( 𝑟, 𝑥 𝑎𝑐 ) should be read as a bivariate random variable).
Note again that from Lemma 3.
of [49] such a variable exists.
The following claim will help us reason about the optimal CI model for users of the skeptic sub-class.
Lemma 1.
If 𝐷 train is entailed by the graph in Fig.
7a and 𝐷 OOD is causally compatible with it, then 𝐷 train ( 𝑦 ∣ 𝑟, 𝑥 𝑎𝑐 ) =
𝐷 OOD ( 𝑦 ∣ 𝑟, 𝑥 𝑎𝑐 ) .
Proof.
For binary classification, it is enough to show that 𝐷
[Equation]
𝑦
[Equation]
0∣ 𝑟,𝑥 𝑎𝑐 ) .
Let us write this for the training distribution:
[Equation]
The second equality stems from the causal-compatibility of 𝐷 OOD .
It is left to show that 𝐷 train ( 𝑦 ∣ 𝑟, 𝑥 𝑎𝑐 ) =
𝐷 OOD ( 𝑦 ∣ 𝑟, 𝑥 𝑎𝑐 ) .
From causal-compatibility the distributions are entailed by the same graph in Fig.
7a, which imposes the conditional independence 𝑐⊥𝑟, 𝑥 𝑎𝑐 ∣ 𝑦 .
Hence we conclude the
[Figure]
causal believer
Proposition proof by:
[Equation]
From this result we gather that if we only consider the features 𝑥 𝑎𝑐 , 𝑟 , there is a unique Bayes-optimal classifier over all target distributions that are causally compatible with 𝐷 train .
Since a classifier is CI if and only if it is ( 𝑥 𝑎𝑐 , 𝑟 ) -measurable, we see that for the skeptic sub-class of users the optimal CI model is 𝑓 ( 𝑥 𝑠𝑝 , 𝑟, 𝑥 𝑎𝑐 ) =
𝐷 train ( 𝑦 ∣ 𝑟, 𝑥 𝑎𝑐 ) .
The rest of the proof will simply show that this model may not be CI for a user of sub-type believer that has the same choice patterns over observed data pooled from two training environments.
Proof of Proposition 2. Consider a data generating process as depicted in Figure 7a.
All variables 𝑥 𝑠𝑝 , 𝑟, 𝑥 𝑎𝑐 , 𝑦, 𝑐 are binary, we consider 2 training environments
 train = {0 , 1} .
We write down the distribution in a factorized form:
[Equation]
Here we defined ̃𝑝 ( 𝑒, 𝑦 ) =
∑ 𝑐 ∈0 , 1 𝑝 ( 𝑦, 𝑐 ) 𝑝 ( 𝑒 ∣ 𝑐 ) .
The subscripts 𝑢 𝑥 ← 𝑟 emphasize that in the distribution we will construct for the believer user, 𝐷 𝑢 𝑥 → 𝑟 , all factors that are not subscripted will be equal to those in 𝐷 𝑢 𝑥 ← 𝑟 .
That is, consider a distribution that factorizes over the graph in Figure 7b as follows:
[Equation]
We will show that there exists some setting of 𝑝 𝑢 𝑥 → 𝑟 ( 𝑟 ∣ 𝑦, 𝑥 𝑎𝑐 ) , 𝑝 𝑒𝑢 𝑥 → 𝑟 ( 𝑥 𝑠𝑝 ∣ 𝑦 ) such that:
[Equation]
𝑦 ) .
But it will also satisfy 𝐷 0 𝑢 𝑥 → 𝑟 ( 𝑦 ∣ 𝑟, 𝑥 𝑎𝑐 )
≠ 𝐷 1 𝑢 𝑥 → 𝑟 ( 𝑦 ∣ 𝑟, 𝑥 𝑎𝑐 ) .
Then the proof will be concluded, as 𝑓 ( 𝑥 𝑠𝑝 , 𝑥 𝑎𝑐 , 𝑟 ) =
𝐷 𝑢 𝑥 ← 𝑟 ( 𝑦 ∣ 𝑟, 𝑥 𝑎𝑐 ) =
𝐷 𝑢 𝑥 → 𝑟 ( 𝑦 ∣ 𝑟, 𝑥 𝑎𝑐 ) cannot be CI w.r.t
𝐷 𝑢 𝑥 → 𝑟 .
This holds since 𝐷 𝑒𝑢 𝑥
→ 𝑟 ( 𝑦 ∣ 𝑟, 𝑥 𝑎𝑐 )
≠ 𝐷 𝑢 𝑥 → 𝑟 ( 𝑦 ∣ 𝑟, 𝑥 𝑎𝑐 ) for 𝑒 ∈ {0 , 1} , hence there must be some instance for which 𝑓 ( 𝑥 𝑎𝑐 (0) , 𝑥 𝑠𝑝 (0) , 𝑟 (0))
≠ 𝑓 ( 𝑥 𝑎𝑐 (1) , 𝑥 𝑠𝑝 (1) , 𝑟 (1)) .
Towards this, consider 𝐷 𝑢 𝑥 ← 𝑟 ( 𝑟 ∣ 𝑦, 𝑥 𝑠𝑝 ) which is obtained by the respective marginalization and conditioning of 𝐷 𝑢 𝑥 ← 𝑟 ( 𝑥 𝑠𝑝 , 𝑥 𝑎𝑐 , 𝑟, 𝑦 ) , and also consider ∑ 𝑒 ∈0 , 1 ̃𝑝 ( 𝑒, 𝑦 ) 𝐷 𝑒𝑢
𝑥 ← 𝑟 ( 𝑥 𝑠𝑝 ∣ 𝑦 ) .
Let us set:
[Equation]
It is clear that if we set 𝑝 𝑒𝑢 𝑥 → 𝑟 ( 𝑥 𝑠𝑝 ∣ 𝑦 ) such that the following holds: ∑
[Equation]
then the equality 𝐷 𝑢 𝑥 ← 𝑟 ( 𝑥 𝑠𝑝
[Equation]
also holds.
That is because the factorization in (1) is a factorization of the joint distribution over 𝑥 𝑠𝑝 , 𝑥 𝑎𝑐 , 𝑟, 𝑦 where all factors are equal to the ones obtained from 𝐷 𝑢 𝑥 ← 𝑟 ( 𝑥 𝑠𝑝 , 𝑥 𝑎𝑐 , 𝑟, 𝑦 ) .
Finally, we claim that many solutions satisfy (2).
For each value of 𝑦, 𝑥 𝑠𝑝 Eq.
(2) is a linear equation with two variables ( 𝑝 0 𝑢 𝑥 → 𝑟 ( 𝑥 𝑠𝑝 ∣ 𝑦 ) and 𝑝 1 𝑢 𝑥 → 𝑟 ( 𝑥 𝑠𝑝 ∣ 𝑦 ) ), and they should be constrained to take values in the range [0 , 1] .
One solution to the equation is to set 𝑝 𝑒𝑢 𝑥 → 𝑟 ( 𝑥 𝑠𝑝 ∣ 𝑦 ) ∶=
𝐷 𝑒𝑢 𝑥 ← 𝑟 ( 𝑥 𝑠𝑝 ∣ 𝑦 ) , and unless 𝐷 𝑒𝑢 𝑥 ← 𝑟 ( 𝑥 𝑠𝑝 ∣ 𝑦 ) ∈ {0 , 1} for each value of 𝑥 𝑠𝑝 , 𝑦 , and 𝐷 0 𝑢 𝑥 ← 𝑟 ( 𝑥 𝑠𝑝 ∣ 𝑦 ) =
𝐷 1 𝑢 𝑥 ← 𝑟 ( 𝑥 𝑠𝑝 ∣ 𝑦 ) (i.e. the spurious feature completely determines 𝑦 ) the set of solutions to the equations forms an interval in ℝ 2 , and has Lebesgue measure that is non-zero.
Thus let us consider the set of parameterized (by the factors in (1))
distributions ̃𝐷
𝑢 𝑥 → 𝑟 ( 𝑒, 𝑥 𝑠𝑝 , 𝑟, 𝑥 𝑎𝑐 , 𝑦 ) that satisfy ∑
[Equation]
the fixed distribution 𝐷 𝑢 𝑥 ← 𝑟 ( 𝑥 𝑠𝑝 , 𝑟, 𝑥 𝑎𝑐 , 𝑦 ) .
This set has a non-zero Lebesgue measure over the linearly independent parameters needed to parameterize 𝐷 𝑢 𝑥 → 𝑟 .
Since the set of parameters that yield unfaithful distributions w.r.t a graph has Lebesgue measure zero [44], there must be at least one distribution ̃𝐷 𝑢 𝑥 → 𝑟 ( 𝑒, 𝑥 𝑠𝑝 , 𝑟, 𝑥 𝑎𝑐 , 𝑦 ) in the set where the independence 𝑟, 𝑥 𝑎𝑐 ⊥𝑒 ∣ 𝑦 does not hold.
For such a distribution we will have 𝐷 𝑒𝑢 𝑥 → 𝑟 ( 𝑦 ∣ 𝑟, 𝑥 𝑎𝑐 )
≠ 𝐷 𝑢 𝑥 → 𝑟 ( 𝑦 ∣ 𝑟, 𝑥 𝑎𝑐 ) , which is what was required to conclude the proof.
C. Related Work
Causality and Recommendations.
Formal causal inference techniques have been used extensively in many domains, but have only recently been applied to recommendations [28,52,7,54,51].
Liang et al.
[29] use causal analysis to describe a model of user exposure to items.
Some work has also been done to understand the causal impact of these systems on behavior by finding natural experiments in observational data [40,45,39], and through simulations [11,38].
Bottou et al.
[8] use causally-motivated techniques in the design of deployed learning systems for ad placement to avoid confounding.
As most of this literature addresses selection bias and the effect of recommendations on user behavior [7,54,51], there is no work, as far as we know, that models boundedly rational agents interacting with a recommender system.
Moreover, we are the first to propose modeling users’ (mis)perceptions about the recommendation generation process using causal graphs.
Bounded Rationality and Subjective Beliefs.
The bounded rationality literature focuses on modelling agents that make decisions under uncertainty, without the ability to fully process the state of the world, and therefore hold subjective beliefs about the data-generating process.
Eyster and Rabin [17] defined cursed beliefs , which capture an agent’s failure to realize that his opponents’ behavior depends on factors beyond those he is informed of.
Building on Esponda
[Table]
[Table]
and Pouzo [16], who modelled equilibrium beliefs under misspecified subjective models, Spiegler [43] used causal graphs to analyze agents that impose subjective causal interpretations on observed correlations.
This work lays the foundation upon which we model users here, and has sprouted many interesting extensions [14,15].
Causality and Invariant Learning.
Correlational predictive models can be untrustworthy [23], and latch onto spurious correlations, leading to errors in OOD settings [32,20,19].
This shortcoming can potentially be addressed by a causal perspective, as knowledge of the causal relationship between observations and labels can be used to mitigate predictor reliance on them [9,49].
In our experiments, we learn a representation that is invariant to interventions on the ‘environment’ 𝑒 , a special case of an invariant representation [3,27,4].
Learning models which generalize OOD is a fruitful area of research with many recent developments [30,22,35,46,5,50].
Recently, Veitch et al.
[49] showed that the means and implications of invariant learning depend on the data’s true causal structure.
Specifically, distinct causal structures require distinct regularization schemes to induce invariance.
D. Experimental Details
Code and data for all experiments can be found in the following anonymous link: https://drive.google.com/drive/folders/
1bO57v4PUuUh76F_q0a_xAVx6CKdeDJ5l D.1. RecBeer (causal users)
Original Dataset description.
The original RateBeer dataset includes textual reviews and numerical ratings of roughly 3000 unique beers, collected over the span of over 11 years.
Each review data-point also includes additional features describing the beer (e.g., brand, style), the author of the review (e.g., location), and the review itself (e.g., date).
Figure 8 shows an example of a data point.
Table 2 provides summary statistics.
Data Generation Process.
The original RateBeer dataset includes reviews and rating that were authored and submitted by users of the platform.
For our purposes, focusing learning and prediction on users as contributors of content has two limitations: (i) we cannot know what platform-selected infor-
The plot shows the temporal correlation structure used for the experiment in §A.1, and underlie the results presented in Fig.
Periods with substantial changes are highlighted in
[Table] [Table]
𝑦 try beer/not mation ( 𝑟 ) was presented to them and how it influenced their decisions, and (ii) we cannot reason counterfactually about their potential choices had they been exposed to different information.
To overcome both issues, we adapt the original dataset to simulate choice behavior of users as consumers of content, as they use the platform to make informed decisions about beer consumption.
We emulate the following process: a user 𝑢 logs on to the platforms, and is recommended a certain beer.
The beer is described by intrinsic features 𝑥 , and one platform-selected textual review 𝑟 , chosen from a pool of already-existing reviews for that beer (these being the reviews for that beer that have already by submitted by other contributing users).
The user then decides weather to try (i.e., consume) the beer ( 𝑦 = 1 ) or not ( 𝑦 = 0 ).
Our goal is to predict for new users 𝑢 their choices 𝑦 for recommended beers given descriptions 𝑥, 𝑟 .
To create features for beers 𝑥 and (consuming) users 𝑢 , we aggregate information from all corresponding reviews: for beers—all reviews of that beer, and for users—all reviews authored by that user.
This includes features such as average past taste score for beers and average past overall satisfaction for users.
Table 3 summarizes our feature space.
Since we model users as causal , the graph edge 𝑟 → 𝑦 implies that changes to 𝑟 causally affect 𝑦 .
To simulate this behavior, we create for each user an ‘intervention space’ which includes a collection of possible interventions 𝑟 and their corresponding counterfactual outcomes 𝑦 .
For our experiment, we simply take all pairs of reviews and ratings ( 𝑟, 𝑠 ) for a given beer to be the set of possible interventions and outcomes.
Textual reviews are featurized using a pre-trained BERT model [13], and numerical ratings 𝑠 ∈ [0 , 5] are transformed into binary choices 𝑦
= {0 , 1} by setting 𝑦 = 1 if the user’s rating for that beer was above the median rating (for that beer), and 𝑦 = 0 otherwise.
Since learning requires observational data, for each user-beer pair ( 𝑢, 𝑥 ) we sample (in a way we describe shortly) one review-choice pair ( 𝑟, 𝑦 ) out ofunique reviews for that beer; an example is presented in Figure 9.
This provides a sampled tuple ( 𝑢, 𝑥, 𝑟, 𝑦 ) expressing the behavior of a causal user whose choices are affected by the review presented to her.
Together, 𝑢, 𝑥 , and 𝑟 (as an embedding) include 866 features.
Finally, to model the effects of changing environments, we consider an environment variable 𝑒 that encodes the year, expressing the idea that different years may express different ‘trends’ in which beer types 4 are more (and less) fashionable.
To implement this, we sample review-choice pairs for users within each year in a way that introduces a pre-determined amount of correlation between choices and beer types.
The chosen per-year correlation levels is plotted in Figure 10.
Notice the drastic change in fashions in 2007 and 2011.
Training and testing.
We train and evaluate one model per year.
For each year 𝑒 ∈ {2006 , … , 2012} , training is performed on data from years {2002 , … , 𝑒 − 1} and tested on 𝑒 .
In this way, fashions regarding beer type accumulate over time.
Models.
We learn a linear model that takes as input the concatenation of 𝑢, 𝑥, 𝑟 .
The learning objective includes a binary cross entropy loss, and marginal MMD as regularization [21] (since we model users as causal; see §3).
We trained all models for 700 epochs with 𝑙𝑟 = 0 .
01 and batches of size 1024, and set 𝜆 = 100 .
Results are averaged over five runs with different random seeds.
D.2. RecFashion (anti-causal users)
Original Dataset Statistics.
The Fashion Product Images dataset includes a large collection of fashion items, described by an image and additional attributes such as: season, gender, base color, usage, year, and product display name.
Items are organized by category, sub-category, and type; we focus on the apparel category.
Table 4 provides summary statistics.
[Table]
Data Generation Process.
The original dataset does not include user choices (or any other form of user behavior).
To simulate user choices, we imagine a setting were the platform recommends to each user an item by presenting an image of the item ( 𝑥 ) in a certain color ( 𝑟 ).
We set 𝑥 to be the item’s grayscale image, and set 𝑟 to be a colorization of that image into one of two colors: red or green.
Users then choose whether to buy the item or not, 𝑦 ∈ {0 , 1} .
We then model users as choosing primarily on the basis of the ‘gender’ attribute of items, 𝑥 𝑔 ∈ {0 , 1} , and set 𝑦 =
𝑥 𝑔 w.p.
0.75 and 𝑦 = 1 − 𝑥 𝑔 otherwise.
Since users in this experiments are anti-causal, they act under the belief that changes in 𝑦 affect 𝑟 (here we do not make use of the edge 𝑦 → 𝑥 ).
Note that 𝑒 also affects 𝑟 .
We implement this joint influence of 𝑒, 𝑦 on 𝑟 by assigning colors to images in a way that obtains a certain level of correlation between the color 𝑟 ∈ {red , green} and choices 𝑦 .
Technically, we associate with each environment 𝑒 a parameter 𝑝 𝑒 ∈ [0 , 1] .
Then, using a color variable 𝑐 = 0 for red and 𝑐 = 1 for green we assign for each item its color as 𝑐 = 𝑦 w.p. 𝑝 𝑒 , and 𝑐 = 1 − 𝑦 otherwise.
Thus, different environments entail different conditional distributions 𝑃 ( 𝑟 = red | 𝑦 = 1) =
𝑃 ( 𝑟 = green | 𝑦 = 0)
= 𝑝 , which reflect an anti-causal structure.
Finally, given the sampled 𝑐 , we colorize the image 𝑥 as follows: if 𝑐 = 1 , we set 𝑥 𝑅 ← 0 .
5+0 .
2 𝑥 𝑅 , 𝑥 𝐺 ← 0 .
7 𝑥 𝐺 , 𝑥 𝐵 ← 0 .
7 𝑥 𝐵 ; if 𝑐 = 0 , we set 𝑥 𝐺 ← 0 .
5 + 0 .
2 𝑥 𝐺 , 𝑥 𝑅 ← 0 .
7 𝑥 𝑅 , 𝑥 𝐵 ← 0 .
7 𝑥 𝐵 ( 𝑅, 𝐺, 𝐵 are the color channels).
Note that this means users do not observe 𝑥, 𝑟 independently, but rather a colored image that is a product of both 𝑥 and 𝑟 .
Training and testing.
We run eight experiments that differ in the average degree of correlation in the training sets, for average correlation values of 𝑝 ∈ {0 . 1 , 0 . 2 , … , 0 . 8} .
Each experimental condition ( 𝑝 ) includes training data from six environments 𝑒 , with correlations 𝑝 𝑒 𝑛𝑣 ∈ { 𝑝 − 0 .
025 , 𝑝 + 0 .
025 , 𝑝 − 0 .
05 , 𝑝 + 0 .
05 , 𝑝 − 0 .
1 , 𝑝 + 0 .
1} (their average is 𝑝 ).
Models.
For the model We used a feed forward neural network with three hidden layers and a hidden dimension of size 256, ReLU activation function and 𝑁𝐿𝐿 as our base loss function.
For computational efficiency, input images were resized to 14 × 14 .
The learning objective includes a binary cross entropy loss, and a conditional DeepCORAL regularizer [47] (since we model users as anti-causal; see §3).
We set 𝜆 = 5000 in the first 125 epochs and 𝜆 = 1 in the rest, and trained the model for 1,900 epochs with 𝑙𝑟 = 0 .and
batches of size 1024.
E. Loss Functions.
We train all of our models with either the CORAL or MMD loss.
Empirically, we found that CORAL we more stable in the RecFashion experiments and.
In the RecBeer experiments, models trained with the MMD loss consistently outperformed those who were not.
When conditioning on the label 𝑦 , we compute 𝑙 𝑑𝑖𝑠𝑡 (either 𝑙 𝐶𝑂𝑅𝐴𝐿 or 𝑙 𝑀𝑀𝐷 ) separately for cases where 𝑦 = 1 and 𝑦 = 0 .
We describe here both loss functions.
CORAL Loss.
The CORAL loss is the distance between the second-order statistics of two feature representations, corresponding to different 𝑧 :
[Equation]
where || ⋅ || 2 𝐹 denotes the squared matrix Frobenius norm.
The covariance matrices of the source and target data are given by:
[Equation]
where 1 is a column vector with all elements equal to 1, and 𝜙 ( ⋅ ) is the feature representation.
MMD .
Maximum mean discrepancy ( MMD ) measures distances between mean embeddings of features.
That is, when we have distributions 𝑃 and 𝑄 over a set  .
The MMD is defined by a feature map 𝜙 ∶  →  , where  is what’s called a reproducing kernel Hilbert space.
In general, the
MMD is
[Equation]
For use of the MMD loss for causal representation learning, see Veitch et al.