{'fraction_non_alphanumeric': 0.038046675818788, 'fraction_numerical': 0.013213375171602275, 'mean_word_length': 4.738219158812773, 'pattern_counts': {'":': 1, '<': 2, '<?xml version=': 0, '>': 1, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Identifying Causal Effect Inference Failure with Uncertainty-Aware Models

Recommending the best course of action for an individual is a major application of individual-level causal effect estimation. This application is often needed in safety-critical domains such as healthcare, where estimating and communicating uncertainty to decision-makers is crucial. We introduce a practical approach for integrating uncertainty estimation into a class of state-of-the-art neural network methods used for individual-level causal estimates. We show that our methods enable us to deal gracefully with situations of"no-overlap", common in high-dimensional data, where standard applications of causal effect approaches fail. Further, our methods allow us to handle covariate shift, where test distribution differs to train distribution, common when systems are deployed in practice. We show that when such a covariate shift occurs, correctly modeling uncertainty can keep us from giving overconfident and potentially harmful recommendations. We demonstrate our methodology with a range of state-of-the-art models. Under both covariate shift and lack of overlap, our uncertainty-equipped methods can alert decisions makers when predictions are not to be trusted while outperforming their uncertainty-oblivious counterparts.


Introduction
Learning individual-level causal effects is concerned with learning how units of interest respond to interventions or treatments. These could be the medications prescribed to particular patients, training-programs to job seekers, or educational courses for students. Ideally, such causal effects would be estimated from randomized controlled trials, but in many cases, such trials are unethical or expensive: researchers cannot randomly prescribe smoking to assess health risks. Observational data offers an alternative, with typically larger sample sizes and lower costs, and more relevance to the target population. However, the price we pay for using observational data is lower certainty in our causal estimates, due to the possibility of unmeasured confounding, and the measured and unmeasured differences between the populations who were subject to different treatments. Progress in learning individual-level causal effects is being accelerated by deep learning approaches to causal inference [27,35,3,45]. Such neural networks can be used to learn causal effects from observational data, but current deep learning tools for causal inference cannot yet indicate when they are unfamiliar with a given data point. For example, a system may offer a patient a recommendation even though it may not have learned from data belonging to anyone with similar age or gender as the patient, or it may have never observed someone like this patient receive a specific treatment before. In the language of machine learning and causal inference, the first example corresponds to a covariate shift, and the second example corresponds to a violation of the overlap assumption, also known as positivity. When a system experiences either covariate shift or violations of overlap, the recommendation would be uninformed and could lead to undue stress, financial burden, false hope, or worse. In this paper, we explain and examine how covariate shift and violations of overlap are concerns for the real-world use of learning conditional average treatment effects (CATE) from observational data, why deep learning systems should indicate their lack of confidence when these phenomena are encountered, and develop a new and principled approach to incorporating uncertainty estimating into the design of systems for CATE inference.
First, we reformulate the lack of overlap at test time as an instance of covariate shift, allowing us to address both problems with one methodology. When an observation x lacks overlap, the model predicts the outcome y for a treatment t that has probability zero or near-zero under the training distribution. We extend the Causal-Effect Variational Autoencoder (CEVAE) [35] by introducing a method for out-of-distribution (OoD) training, negative sampling, to model uncertainty on OoD inputs. Negative sampling is effective and theoretically justified but usually intractable [18]. Our insight is that it becomes tractable for addressing non-overlap since the distribution of test-time inputs (x, t) is known: it equals the training distribution but with a different choice of treatment (for example, if at training we observe outcome y for patient x only under treatment t = 0, then we know that the outcome for (x, t = 1) should be uncertain). This can be seen as a special case of transductive learning [54,Ch. 9]. For addressing covariate shift in the inputs x, negative sampling remains intractable as the new covariate distribution is unknown; however, it has been shown in non-causal applications that Bayesian parameter uncertainty captures "epistemic" uncertainty which can indicate covariate shift [29]. We, therefore, propose to treat the decoder p(y|x, t) in CEVAE as a Bayesian neural network able to capture epistemic uncertainty.
In addition to casting lack of overlap as a distribution shift problem and proposing an OoD training methodology for the CEVAE model, we further extend the modeling of epistemic uncertainty to a range of state-of-the-art neural models including TARNet, CFRNet [44], and Dragonnet [46], developing a practical Bayesian counter-part to each. We demonstrate that, by excluding test points with high epistemic uncertainty at test time, we outperform baselines that use the propensity score p(t = 1|x) to exclude points that violate overlap. This result holds across different state-of-the-art architectures on the causal inference benchmarks IHDP [23] and ACIC [48]. Leveraging uncertainty for exclusion ties it into causal inference practice where a large number of overlap-violating points must often be discarded or submitted for further scrutiny [41,25,6,26,20]. Finally, we introduce a new semi-synthetic benchmark dataset, CEMNIST, to explore the problem of non-overlap in high-dimensional settings.

Background
Classic machine learning is concerned with functions that map an input (e.g. an image) to an output (e.g. "is a person"). The specific function f for a given task is typically chosen by an algorithm that minimizes a loss between the outputs f (x i ) and targets y i over a dataset {x i , y i } N i=1 of input covariates and output targets. Causal effect estimation differs in that, for each input x i , there is a corresponding treatment t i ∈ {0, 1} and two potential outcomes Y 1 , Y 0 -one for each choice of treatment [43]. In this work, we are interested in the Conditional Average Treatment Effect (CATE): where the expectations arise because the outcome is non-deterministic. Under the assumption of ignorability conditioned on X (or no-hidden confounding) which we make in this paper, we have that , thus opening the way to estimate CATE from observational data [26]. Specifically, we are motivated by cases where X is high-dimensional, for example, a patient's entire medical record, in which case we can think of the CATE as representing an individuallevel causal effect. Though the specific meaning of a CATE measurement depends on context, in general, a positive value indicates that an individual with covariates x i will have a positive response (a) Model for p(y|xi, t = 0, ω) (b) Model for p(y|xi, t = 1, ω) (c) Measure of epistemic uncertainty I Figure 1: Explanation how epistemic uncertainty detects lack of data. (a) Binary outcome y (red x) given no treatment, and different functions p(y = 1|x, t = 0, ω) (blue) predicting outcome probability (red line, ground truth). Functions disagree where data is scarce. (b) Binary outcome y given treatment, and functions p(y = 1|x, t = 1, ω) (orange) predicting outcome probability. (c) Measures of uncertainty/disagreement between outcome predictions (dashed blue and orange lines) are high when lack data. CATE uncertainty (black line) is higher where at least one model lacks data (non-overlap, pink) or where both lack data (out-of-distribution / covariate shift, cyan).
to treatment, a negative value indicates a negative response, and a value of zero indicates that the treatment will have no effect on such an individual.
The fundamental problem of learning to infer CATE from an observational dataset D = is that only the factual outcome y i = Y ti corresponding to the treatment t i can be observed. Because the counterfactual outcome Y 1−ti is never observed, it is difficult to learn a function for CATE(x i ) directly. Instead, a standard approach is often either to treat t i as an additional covariate [16] or focus on learning functions for µ 0 (x i ) and µ 1 (x i ) using the observed y i in D as targets [44,35,45].

Epistemic uncertainty and covariate shift
In probabilistic modelling, predictions may be assumed to come from a graphical model p(y|x, t, ω) -a distribution over outputs (the likelihood) given a single set of parameters ω. Considering a binary label y given t = 0, a neural network can be described as a function defining the likelihood p(y = 1|x, t = 0, ω 0 ), with parameters ω 0 defining the network weights. Different draws ω 0 from a distribution over parameters p(ω 0 |D) would then correspond to different neural networks, i.e. functions from (x, t = 0) to y (e.g. the blue curves in Fig. 1 (left)).
For parametric models such as neural networks (NNs), we treat the weights as random variables, and, with a chosen prior distribution p(ω 0 ), aim to infer the posterior distribution p(ω 0 |D). The blue curves in Figure 1a, are individual NN's µ ω0 (·) sampled from the posterior of such a Bayesian neural network (BNN). Bayesian inference can be performed by marginalizing the likelihood function p(y|µ ω0 (x)) over the posterior p(ω 0 |D) in order to obtain the posterior predictive probability p(y|x, t, D) = p(y|x, t, ω)p(ω|D)dω. This marginalization is intractable for BNNs in practice, so variational inference is commonly used as a scalable approximate inference technique, for example, by sampling the weights from a Dropout approximate posterior q(ω 0 |D) [15]. Figure 1a illustrates the effects of a BNN's parameter uncertainty in the range x ∈ [−1, 1] (shaded region). While all function samples µ ω0 (x) with ω 0 ∼ p(ω 0 |D, t = 0) (shown in blue) agree with each other for inputs x in-distribution (x ∈ [−6, −1]) these functions make disagreeing predictions for inputs x ∈ [−1, 1] because these lie out-of-distribution (OoD) with respect to the training distribution p(x|t = 0). This is an example of covariate shift.
To avoid overconfident erroneous extrapolations on such OoD examples, we would like to indicate that the prediction µ ω0 (x test ) is uncertain. This epistemic uncertainty stems from a lack of data, not from measurement noise (also called aleatoric uncertainty). Epistemic uncertainty about the random variable (r.v.) Y 0 can be quantified in various ways. For classification tasks, a popular information-theoretic measure is the information gained about the r.v. ω 0 if the label y = Y 0 were observed for a new data point x, given the training dataset D [24]. This is captured by the mutual information between ω 0 and Y 0 , given by where H[•] is the entropy of a given r.v. For regression tasks, it is common to measure how the r.v. µ ω0 (x) varies when marginalizing over ω: 3 Non-overlap as a covariate shift problem Standard causal inference tasks, under the assumption of ignorability conditioned on X, usually deal with estimating both µ 0 (x) = E(y|X = x, t = 0) and µ 1 (x) = E(y|X = x, t = 1). Overlap is usually assumed as a means to address this problem. The overlap assumption (also known as common support or positivity) states that there exists 0 < η < 0.5 such that the propensity score p(t = 1|x) satisfies: i.e., that for every x ∼ p(x), we have a non-zero probability of observing its outcome under t = 1 as well as under t = 0. This version is sometimes called strict overlap, see [8] for discussion. When overlap does not hold for some x, we might lack data to estimate either µ 0 (x) or µ 1 (x)-this is the case in the grey shaded areas in Figure 1c.
Overlap is a central assumption in causal inference [41,25]. Nonetheless, it is usually not satisfied for all units in a given observational dataset [41,25,6,26,20]. It is even harder to satisfy for highdimensional data such as images and comprehensive demographic data [8] where neural networks are used in practice [17].
Since overlap must be assumed for most causal inference methods, an enormously popular practice is "trimming": removing the data points for which overlap is not satisfied before training [20,13,45,30,7]. In practice, points are trimmed when they have a propensity close to 0 or 1, as predicted by a trained propensity model p ωp (t|x). The average treatment effect (ATE), is then calculated by over the remaining training points.
However, trimming has a different implication when estimating the CATE for each unit with covariates x i : it means that for some units a CATE estimate is not given. If we think of CATE as a tool for recommending treatment assignment, a trimmed unit receives no treatment recommendation. This reflects the uncertainty in estimating one of the potential outcomes for this unit, since treatment was rarely (if ever) given to similar units. In what follows, we will explore how trimming can be replaced with more data-efficient rejection methods which are specifically focused on assessing the level of uncertainty in estimating the expected outcomes for x i under both treatment options.
Our model of the CATE is: Figure 1, we illustrate that lack of overlap constitutes a covariate shift problem. When p(t = 1|x test ) ≈ 0, we face a covariate shift for µ ω1 (·) (because p(t=1) > 0 would imply by Bayes rule p(x test |t = 1) ≈ 0). When p(t = 1|x test ) ≈ 1, we face a covariate shift for µ ω0 (·), and when p(x test ) ≈ 0, we face a covariate shift for CATE ω 0/1 (x) ("out of distribution" in the figure). With this understanding, we can deploy tools for epistemic uncertainty to address both covariate shift and non-overlap simultaneously.

Epistemic uncertainty in CATE
To the best of our knowledge, uncertainty in high-dimensional CATE (i.e. where each value of x is only expected to be observed at most once) has not been previously addressed. CATE(x) can be seen as the first moment of the random variable Y 1 − Y 0 given X = x. Here, we extend this notion and examine the second moment, the variance, which we can decompose into its aleatoric and epistemic parts by using the law of total variance: The second term on the r.h.s. is Var( CATE ω 0/1 (x)). It measures the epistemic uncertainty in CATE since it only stems from the disagreement between predictions for different values of the parameters, not from noise in Y 1 , Y 0 . We will use this uncertainty in our methods and estimate it directly by sampling from the approximate posterior q(ω 0 , ω 1 |D). The first term on the r.h.s. is the expected aleatoric uncertainty, which is disregarded in CATE estimation (but could be relevant other where).
4 Adapting neural causal models for covariate shift

Parameter uncertainty
To obtain the epistemic uncertainty in the CATE, we must infer the parameter uncertainty distribution conditioned on the training data p(ω 0 , ω 1 |D), which defines the distribution of each network µ ω0 (·), µ ω1 (·), conditioned on D. There exists a large suite of methods we can leverage for this task, surveyed in Gal [14]. Here, we use MC Dropout [15] because of its high scalability [53], ease of implementation, and state-of-the-art performance [12]. However, our contributions are compatible with other approximate inference methods. We can adapt almost all neural causal inference methods we know. CEVAE, however, [35], is more complicated and will be addressed in the next section.
MC Dropout is a simple change to existing methods. Gal & Ghahramani [15] showed that we can simply add dropout [49] with L2 regularization in each of ω 0 , ω 1 during training and then sample from the same dropout distribution at test time to get samples from q(ω 0 , ω 1 |D). With tuning of the dropout probability, this is equivalent to sampling from a Bernoulli approximate posterior q(ω 0 , ω 1 |D) (with standard Gaussian prior). MC Dropout has been used in various applications [57, 37, 28].

Bayesian CEVAE
The Causal Effect Variational Autoencoder (CEVAE, Louizos et al. [35]) was introduced as a means to relaxes the common assumption that the data points x i contain accurate measurements of all confounders -instead, it assumes that the observed x i are a noisy transformation of some true confounders z i , whose conditional distribution can nonetheless be recovered. To do so, CEVAE encodes each observation (x i , t i , y i ) ∈ D, into a distribution over latent confounders z i and reconstructs the entire observation with a decoder network. For each possible value of t ∈ {0, 1}, there is a separate branch of the model. For each branch j, the encoder has an auxiliary distribution q(y i |x i , t = j) to approximate the posterior q(z i |x i , y i , t = j) at test time. It additionally has a single auxiliary distribution q(t i |x i ) which generates t i . See Figure 2 in [35] for an illustration. The decoder reconstructs the entire observation, so it learns the three components of We will omit the parameters of these distributions to ease our notation. The encoder parameters are summarized as ψ and the decoder parameters as ω.
If the treatment and outcome were known at test time, the training objective (ELBO) would be where KL is the Kullback-Leibler divergence. However, t i and y i need to be predicted at test time, so CEVAE learns the two additional distributions by using the objective where a star indicates that the variable is only observed at training time. At test time, we calculate the CATE so t i is set to 0 and 1 for the corresponding branch and y i is sampled both times.
Although the encoder performs Bayesian inference to infer z i , CEVAE does not model epistemic uncertainty because the decoder lacks a distribution over ω. The recently introduced Bayesian Variational Autoencoder [9] attempts to model such epistemic uncertainty in VAEs using MCMC sampling. We adapt their model for causal inference by inferring an approximate posterior q(ω|D).
In practice, this is again a simple change if we use Monte Carlo (MC) Dropout in the decoder 2 . This is implemented by adding dropout layers to the decoder and adding a term KL(q(ω|D)||p(ω)) to (9), where p(ω) is standard Gaussian. Furthermore, the expectation in (8) now goes over the joint posterior q(z i |x i , t i , y i )q(ω|D) by performing stochastic forward passes with Dropout 'turned on'.
Negative sampling for non-overlap.
Negative sampling is a powerful method for modeling uncertainty under a covariate shift by adding loss terms that penalize confident predictions on inputs sampled outside the training distribution [51,33,18,19,42]. However, it is usually intractable because the x input space is high dimensional. Our insight is that it becomes tractable for non-overlap, because the OoD inputs are created by simply flipping t on the in-distribution inputs Our negative sampling is implemented by mapping each (x i , y i , t i ) ∈ D through both branches of the encoder. On the counterfactual branch, where t i = 1 − t i , we only minimize the KL divergence from the posterior q(z|x test , t = 0) to p(z), but none of the other terms in (9). This is to encode that we have no information on the counterfactual prediction. Figure 2 illustrates the effect that negative sampling has on epistemic uncertainty measurements. Training with negative sampling (figure 2a) leads to higher epistemic uncertainty estimates for non-overlap and out-of-distribution examples, as well as sharper transitions between in-distribution and out-of-distribution examples, when compared to training without negative sampling (figure 2b). In appendix C we study negative sampling and demonstrate improved uncertainty.

Related work
Epistemic uncertainty is modeled out-of-the box by non-parametric Bayesian methods such as Gaussian Processes (GPs) [40] and Bayesian Additive Regression Trees (BART) [5]. Various non-parametric models have been applied to causal inference [2,5,56,23,55]. However, recent state-of-the-art results for high-dimensional data have been dominated by neural network approaches [27,35,3,45]. Since these do not incorporate epistemic uncertainty out-of-the-box, our extensions are meant to fill this gap in the literature. Causal effects are usually estimated after discarding/rejecting points that violate overlap, using the estimated propensity score [6,20,13,45,30,7]. This process is cumbersome, and results are often sensitive to a large number of ad hoc choices [22] which can be avoided with our methods. Hill & Su [21] proposed alternative heuristics for discarding by using the epistemic uncertainty provided by BART on low dimensional data, but focuses on learning the ATE, the average treatment effect over the training set, and neither uses uncertainty in CATE nor ATE.
For CATE estimation, unlike ATE estimation, we additionally face test data, which may also violate overlap. Test data also introduces the possibility of covariate shift away from p(x), which has so far been studied outside the causal inference literature [39,34,50,47]. In both cases, we may wish to reject x, e.g. to consult a human expert instead of making a possibly false treatment recommendation. To our knowledge, there has been no comparison of rejection methods for CATE inference.

Experiments
In this section, we show empirical evidence for the following claims: that our uncertainty aware methods are robust both to violations of the overlap assumption and a failure mode of propensity based trimming (6.1); that they indicate high uncertainty when covariate shifts occur between training and test distributions (6.2); and that they yield lower CATE errors while rejecting fewer points than propensity based trimming (6.2). In the process, we introduce a new, high-dimensional, individuallevel causal effect prediction benchmark dataset called CEMNIST to demonstrate robustness to overlap and propensity failure (6.1). Finally, we introduce a modification to the IHDP causal inference benchmark to explore covariate shift (6.2).
We evaluate our methods by considering treatment recommendations. A simplified recommendation strategy for an individual-level treatment is to assign t = 1 if the predicted CATE(x i ) is positive, and t = 0 if negative. However, if there is insufficient knowledge about an individual, and a high cost associated with making errors, it might be preferable to withhold the recommendation. It is therefore important to have an informed rejection policy for a treatment assigned based on a given CATE estimator. We use use two rejection policies based on estimators for epistemic and predictive uncertainty derived from equation (7). We compare the utility of these policies to a random rejection baseline and two policies based on a trained propensity score model (propensity trimming and quantiles). Details of the uncertainty and propensity score policies are reported in Appendix A.4. For a CATE estimator, we assign a cost of 1 to making an incorrect prediction and a cost of 0 for either making a correct recommendation or withholding an automated recommendation and deferring the decision to a human expert instead. At a fixed number of rejections, the utility of a policy is defined as the inverse of the total number of erroneous recommendations made. We also report the error over the non-rejected subset as measured by the Precision in Estimation of Heterogenous Treatment Effect (PEHE) [23] as implemented by [44]. We report the mean and standard error of all metrics over a dataset dependent number of training runs.
We evaluate and compare each rejection policy using several uncertainty aware CATE estimators. The estimators are the Bayesian versions of CEVAE [35], TARNet, CFR-MMD [44], Dragonnet [45], and a deep T-Learner. Each model is augmented by introducing Bayesian parameter uncertainty and by predicting a distribution over model outputs. For imaging experiments, a two-layer CNN encoder is added to each model. Details for each model are given in Appendix B. In the result tables, each model's name is prefixed with a "B" for "Bayesian".

Using uncertainty when overlap is violated
Causal effect MNIST (CEMNIST). We introduce the CEMNIST dataset using hand-written digits from the MNIST dataset [32] to demonstrate that our uncertainty measures capture non-overlap on high-dimensional data and that they are robust to a failure mode of propensity score rejection. Table 1: CEMNIST-Overlap Description of "Causal effect MNIST" dataset.  Table 1 depicts the data generating process for CEMNIST. In expectation, half of the samples in a generated dataset will be nines, and even though the propensity for treating a nine is relatively low, there are still on average twice as many treated nines as there are samples of other treated digits (except for twos). Therefore, it is reasonable to expect that the CATE can be estimates most accurately for nines. For twos, there is strict non-overlap. Therefore, the CATE cannot be estimated accurately. For the remaining digits, the CATE estimate should be less confident than for nines because there are fewer examples during training, but more confident than for twos because there are both treated and untreated training examples. This experimental setup is chosen to demonstrate where the propensity trimming rejection policy can be inappropriate for the prediction of individual-level causal effects. Figure 3a shows the histogram over training set predictions for a deep propensity model on a realization of the CEMNIST dataset. A data scientist following the trimming paradigm [4] would be justified in choosing a lower threshold around 0.05 and an upper threshold around 0.75. The upper threshold would properly reject twos, but the lower threshold would start rejecting nines, which represent the population that the CATE estimator can be most confident about. Therefore, rejection choices can be worse than random. Figure 3b shows that the recommendation-error-rate is significantly lower for the uncertainty based policies (red and green) than for both the random baseline policy (purple) and the propensity based policies (orange and blue). These results hold for the √ P EHE across a range of SOTA CATE estimators, as shown in the l.h.s. of Table 2, and in Appendix C. Details on the protocol generating these results are in Appendix A.1. We induce a covariate shift in the semi-synthetic dataset IHDP [23,44] by excluding instances from the training set for which the mother is unmarried. Mother's marital status is chosen because it has a balanced frequency of 0.52 ± 0.00; furthermore, it has a mild association with the treatment as indicated by a log odds ratio of 2.22 ± 0.01; and most importantly, there is evidence of a simple distribution shift, indicated by a predictive accuracy of 0.75 ± 0.00 for marital status using a logistic regression model over the remaining covariates. We comment on the ethical implications of this experimental set-up, describe IHDP, and explain the experimental protocol in Appendix A.2. We report the mean and standard error in recommendation-error-rates and √ P EHE over 1000 realizations of the IHDP Covariate-Shift dataset to evaluate each policy by computing each metric over the test set (both sub-populations included). We sweep r rej from 0.0 to 1.0 in increments of 0.05. Figure 4b shows, for the BT-Learner, that the epistemic uncertainty policy significantly outperforms the uncertainty-oblivious policies across the whole range of rejection rates, and we show in Appendix C that this trend holds across all models. The middle section of table 2 supports this claim by reporting the √ P EHE for each model at r rej = 0.5 (0.5 is approximately the frequency of the excluded population). Every model class shows improved rejection performance. However, comparisons between model classes are not necessarily appropriate since some models target different scenarios, for example, CEVAE targets non-synthetic data where confounders z aren't directly observed, and it is known to underperform on IHDP [35].
We report results for the unaltered IHDP dataset in figure 4a and the r.h.s. of table 2. This supports that uncertainty rejection is more data efficient, i.e., errors are lower while rejecting less. This is further supported by the results in Appendix C.3 on the ACIC benchmark (Appendix A.3).

Conclusions
Observational data often violates the crucial overlap assumption, especially when the data is highdimensional [8]. When these violations occur, causal inference can be difficult or impossible, and ideally, a good causal model should communicate this failure to the user. However, the only current approach for identifying these failures in deep models is via the propensity score. We develop here a principled approach to modeling outcome uncertainty in individual-level causal effect estimates, leading to more accurate identification of cases where we cannot expect accurate predictions, while the propensity score approach can be both over-and under-conservative. We further show that the same uncertainty modeling approach we developed can be usefully applied to predicting causal effects under covariate shift. More generally, since causal inference is often needed in high-stakes domains such as medicine, we believe it is crucial to effectively communicate uncertainty and refrain from providing ill-conceived predictions.

Appendix A Datasets
A.1 CEMNIST The original MNIST image dataset contains a training set of size 60000 and a test set of size 10000, where each digit class 0-9 represents 10% of points. We use a subset of the training data, shown in Table 3. Similarly, we use a subset of the test set, with the same proportion for each digit as in the training set (and the same proportion of treated points). The variables Y 1 , Y 0 are deterministic as shown in Table 3. Some numbers in Table 3 are approximate because they are generated according to the probabilities in Table 1.
The dataset serves two purposes. First, it illustrates why the standard practice of rejecting points with propensity scores close to 0 or 1 can be worse than rejecting randomly. The digit 9 has the most data making it easy to predict the CATE, but it's propensity score is only 0.1, so that 9s will be rejected early. It might be a common situation in practice that a sub-population represents the majority of the data and therefore its CATE is easy to estimate. Second, the digit 2 suffers from strict non-overlap (propensity score of 1). It should be the first digit class to be rejected by any method since its CATE cannot be estimated. When increasing the rejected proportion, digits other than 9 should subsequently be rejected as only 334 and 333 examples are observed for their treatment and control groups respectively. However, propensity-based rejection is likely to retain these sub-populations because their propensity score is 0.5.
We repeated the CEMNIST experiment 20 times, each time generating a new dataset with a different random initialization for each model. Note that this is a single dataset, unlike other causal inference benchmarks, so it is only suited for CATE estimation, not ATE estimation.

A.2 IHDP
Hill [23] introduced a causal inference dataset based on the The Infant Health Development Program (IHDP), a randomized experiment that assessed the impact of specialist home visits on children's performance in cognitive tests. Real covariates and treatments related to each participant are used in the IHDP dataset. However, outcomes are simulated based on covariates and treatment, making this dataset semi-synthetic. Covariates were made different between the treatment and control groups by removing units with non-white mothers from the treated population. There are 747 units in the dataset (139 treated, 608 control), with 25 covariates related to the children and their mothers. Following Shalit et al. [44], Hill [23], we use the simulated outcome implemented as setting "A" in the NPCI package [10] and we use the noiseless/expected outcome to compute the ground truth CATE. The IHDP dataset is available for download at https://www.fredjo.com/.
We run the experiment according to the protocol described in [44]: we run 1000 repetitions of the experiment, where each test set has 75 points and the remaining 672 available points are split 70% to 30% for training and validation. The ground truth outcomes are normalized to a mean of 0 and standard deviation of 1 over the training set. For evaluation, each model's predictions are unnormalized to calculate the PEHE.
IHDP Covariate Shift. As previously mentioned, we selected a variable (marital status of mother) and exclude datapoints where the mother was unmarried from training (while leaving the test set unaltered). We selected this feature for three reasons: it is active in roughly 50% of data points, the distributions of the remaining covariates were distinct based on a T-SNE visualization [36], and the feature is only marginally correlated with treatment (which ensures that we study the impact of covariate shift, not unobserved confounding). The feature is hidden to the models to make the detection of covariate shift non-trivial, and to induce a more realistic scenario where latent factors are often unaccounted for in observational data.
Marital status may be considered a sensitive socio-economic factor. We do not intend the experiment to be politically insensitive, rather that it emphasizes the problem of demographic exclusion in observational data due to issues such as historical bias, along with the danger of making confident but uniformed predictions when demographic exclusion is latent. Omitting these variables can lead to subpar model performance -particularly for members of a socio-economic minority.

A.3 ACIC 2016
Dorie et al. [11] introduced a dataset named after the 2016 Atlantic Causal Inference Conference (ACIC) where it was used for a competition. ACIC is a collection of semi-synthetic datasets whose covariates are taken from a large study conducted on pregnant women and their children to identifying causal factors leading to developmental disorders [38]. There are 4802 observations and 58 covariates. Outcomes and treatments are simulated, as in IHDP, according to different data-generating process for each dataset. We chose this dataset instead of the 2018 ACIC challenge [48] because the latter is aimed at only ATE estimation and the CATE is equal for each observation in most datasets.

A.4 Evaluation metrics
We evaluate our methods by considering treatment recommendations. A simplified recommendation strategy for an individual-level treatment of a unit with covariates x i is to recommend t = 1 if the predicted CATE(x i ) is positive, and t = 0 if negative. However, if there is insufficient knowledge about the CATE an individual, and a high cost associated with making errors, it may be preferable to withhold the recommendation, and e.g. refer the case for further scrutiny. It is therefore important to have an informed rejection policy for a treatment assigned based on a given CATE estimator.
To evaluate a rejection policy for a CATE estimator we assign a cost of 1 to making incorrect predictions and a cost of 0 for making a correct recommendation. At a fixed number of rejections, the utility of a policy can be defined as the inverse of the total number of erroneous recommendations made, i.e., if a policy can correctly identify the model's mistakes and refer such patients to a human expert then it should have a higher utility.
Rejection policies We introduce two rejection policies based on the epistemic and predictive uncertainty estimates of an uncertainty aware CATE estimator. Both policies opt to reject if the uncertainty estimate is greater than a threshold that rejects a given proportion of the training data r reject . The training data is used there may not be a large enough test set in practice. For all policies, we determine thresholds on the training set to simulate a real-world individual-level recommendation scenario. The epistemic uncertainty policy uses a sample-based estimator of the uncertainty in CATE (second r.h.s. term in equation (7)) given by where M Monte Carlo samples are taken from each of q(ω 0 , ω 1 |D). Note that, for the T-Learner, this posterior factorizes into two independent distributions q(ω 0 |D), q(ω 1 |D) because there are separate models for the outcome given treatment and no treatment. Furthermore, other models share parameters for µ ω0 (·), µ ω1 (·) so the individual parameters in ω 0 , ω 1 may overlap. The predictive uncertainty policy uses an estimator of equation (7), V ar pred [Y 1 − Y 0 |x i ], which has the same functional form as in (10), but instead of being over the difference in expected values µω t j (x i ) of the output distribution it is over samples yω t j (x i ) of the output distribution.
We compare the utility of these policies to a random rejection baseline and two policies based on propensity scores. The first propensity policy (propensity quantiles) finds a two sided threshold on the distribution of estimated propensity scores such that a proportion (1. − r reject ) of the training data is retained. The second policy (propensity trimming) implements a trimming algorithm following the guidelines proposed by Caliendo & Kopeinig [4]. parameter uncertainty and by predicting a distribution over model outputs. For image data, two convolutional bottom layers are added to each model.
Each model is augmented with Bayesian parameter uncertainty by adding dropout with a probability of 0.1 after each layer (0.5 for layers before the output layer), and setting weight decay penalties to be inversely proportional to the number of examples in the training dataset. At test time, uncertainty estimates are calculated over 100 MC samples.
For the Bayesian T-Learner we use two BNNs, each having 5 dense, 200 neuron, layers. Dropout is added after each dense layers, followed by ELU activation functions. A linear output layer is added to each network, with a sigmoid activation function if the target is binary. For image data, we add a 2-layer convolutional neural network module, with 32 and 64 filters per layer. Spatial dropout [52], and ELU activations follow each convolutional layer, and the output is flattened before being passed to the rest of the network. For image data, the Bayesian CEVAE decoder is modified by using a transposed convolution block for the part of the decoder that models p(x|z). For the propensity policies, we use a propensity model that has the same form as a single branch of the Bayesian T-learner. The propensity model's L2 regularization is tuned for calibration as this is important for propensity models. We also experimented with a logistic regression model which performed worse.
Adam optimization [31] is used with a learning rate of 0.001 (On CEMNIST the learning rate for the BCEVAE is reduced to 0.0002), and we train each model for a maximum of 2000 epochs, using early stopping with a patience of 50.
Aside from these changes, model architectures, optimization strategies and loss weighting follow what is reported in their respective papers. More details can be seen in the attached code.

B.1 Compute infrastructure
All neural network models were implemented in Tensorflow 2.2 [1], using Nvidia GPUs. BART was implemented using the dbarts R package, available at https://cran.r-project.org/web/ packages/dbarts/index.html. Table 4 shows that each uncertainty aware neural network model outperforms BART [5] on the datasets considered. BART is chosen as a baseline here because it can quantify epistemic uncertainty estimates.  Table 5 and figure 5 compare the BCEVAE model when trained with and without negative sampling on the CEMNIST dataset. Table 6 shows the relative performance of the Bayesian models to the results reported in their respective papers for the IHDP dataset.  C.3 ACIC Figure 6 visualizes the performance of the rejection policies on the ACIC 2016 dataset. Table 7 enumerates the results for the ACIC 2016 dataset, and we see that the epistemic uncertainty policy rejects recommendations for data points with high errors.  Figure 6: ACIC evaluation. Uncertainty based rejection policies can reject fewer samples at a given error rate than propensity policies, on ACIC.