SlowGuess/NeurIPS_2023_OCR huggingface dataset:
where  $\pi (\mathbf{x}) = \mathbb{P}(A = 1\mid \mathbf{x})$  denotes the observed propensity score and  $\pi (\mathbf{x},\mathbf{u}) = \mathbb{P}(A = 1\mid \mathbf{x},\mathbf{u})$  denotes the full propensity score. By rearranging the terms, we obtain
$$
\frac {1}{(1 - \Gamma) \mathbb {P} (a \mid \mathbf {x}) + \Gamma} \leq \frac {\mathbb {P} (a \mid \mathbf {x} , \mathbf {u})}{\mathbb {P} (a \mid \mathbf {x})} \leq \frac {1}{(1 - \Gamma^ {- 1}) \mathbb {P} (a \mid \mathbf {x}) + \Gamma^ {- 1}} \tag {39}
$$
for  $a\in \{0,1\}$  . Furthermore, by Bayes' theorem, it follows that
$$
\frac {\mathbb {P} (a \mid \mathbf {x} , \mathbf {u})}{\mathbb {P} (a \mid \mathbf {x})} = \frac {\mathbb {P} (\mathbf {u} \mid \mathbf {x} , a) \mathbb {P} (a \mid \mathbf {x})}{\mathbb {P} (\mathbf {u} \mid \mathbf {x}) \mathbb {P} (a \mid \mathbf {x})} = \frac {\mathbb {P} (\mathbf {u} \mid \mathbf {x} , a)}{\mathbb {P} (\mathbf {u} \mid \mathbf {x})} = \frac {\mathbb {P} (\mathbf {u} \mid \mathbf {x} , a)}{\mathbb {P} (\mathbf {u} \mid \mathbf {x} , d o (A = a))}, \tag {40}
$$
which implies that the MSM is a weighted GMSM with weight function  $q(\mathbf{a}, \mathbf{x}) = \mathbb{P}(\mathbf{a} \mid \mathbf{x})$ .
Comparison to the MSM definition using potential outcomes: Some papers define the MSM in terms of potential outcomes  $(Y_{1}, Y_{0})$  instead of unobserved confounders  $U$  [31, 67]. Here,  $Y_{a}$  denotes the potential outcome under the treatment intervention  $do(A = a)$ . In the following, we show that this is equivalent to the definition we use in our paper.
Lemma 2. The following two statements are equivalent:
1. There exists an unobserved confounder  $U$  that satisfies  $Y_{1}, Y_{0} \perp A \mid \mathbf{X}, \mathbf{U}$  so that it holds that  $s^{-} \leq \frac{\mathbb{P}(\mathbf{u}|\mathbf{x}, a)}{\mathbb{P}(\mathbf{u}|\mathbf{x})} \leq s^{+}$ .
2. It holds that  $s^{-} \leq \frac{\mathbb{P}(Y_1, Y_0 | \mathbf{x}, a)}{\mathbb{P}(Y_1, Y_0 | \mathbf{x})} \leq s^+$ .
Proof. The second statement follows directly from the first one by defining  $\mathbf{U} = (Y_1, Y_0)$ . For the other direction, we proceed via proof by contradiction. Assume there exists a pair  $(Y_1, Y_0)$  that violates the second statement, say w.l.o.g.  $\frac{\mathbb{P}(Y_1, Y_0 | \mathbf{x}, a)}{\mathbb{P}(Y_1, Y_0 | \mathbf{x})} > s^+$ . We can use the independence condition from the first statement to write
$$
\mathbb {P} \left(Y _ {1}, Y _ {0} \mid \mathbf {x}, a\right) = \int \mathbb {P} \left(Y _ {1}, Y _ {0} \mid \mathbf {x}, \mathbf {u}, a\right) \mathbb {P} (\mathbf {u} \mid \mathbf {x}, a) d \mathbf {u} = \int \mathbb {P} \left(Y _ {1}, Y _ {0} \mid \mathbf {x}, \mathbf {u}\right) \mathbb {P} (\mathbf {u} \mid \mathbf {x}, a) d \mathbf {u} \tag {41}
$$
Furthermore, we have that
$$
\mathbb {P} \left(Y _ {1}, Y _ {0} \mid \mathbf {x}\right) = \int \mathbb {P} \left(y _ {1}, y _ {0} \mid \mathbf {x}, \mathbf {u}\right) \mathbb {P} (\mathbf {u} \mid \mathbf {x}) \mathrm {d} \mathbf {u}. \tag {42}
$$
$$
s ^ {+} <   \frac {\int \mathbb {P} \left(Y _ {1} , Y _ {0} \mid \mathbf {x} , \mathbf {u}\right) \mathbb {P} (\mathbf {u} \mid \mathbf {x} , a) \mathrm {d} \mathbf {u}}{\int \mathbb {P} \left(Y _ {1} , Y _ {0} \mid \mathbf {x} , \mathbf {u}\right) \mathbb {P} (\mathbf {u} \mid \mathbf {x}) \mathrm {d} \mathbf {u}}. \tag {43}
$$
Hence, there exists a  $\mathbf{u}$  such that  $s^+ < \frac{\mathbb{P}(Y_1,Y_0|\mathbf{x},\mathbf{u})\mathbb{P}(\mathbf{u}|\mathbf{x},a)}{\mathbb{P}(Y_1,Y_0|\mathbf{x},\mathbf{u})\mathbb{P}(\mathbf{u}|\mathbf{x})} = \frac{\mathbb{P}(\mathbf{u}|\mathbf{x},a)}{\mathbb{P}(\mathbf{u}|\mathbf{x})}$ , which is a contradiction to the sensitivity constraint of the first statement.
C.2 Continuous marginal sensitivity model (CMSM):
For continuous treatments  $\mathbf{A} \in \mathbb{R}^d$ , the continuous marginal sensitivity model (CMSM) [32] is defined via
$$
\frac {1}{\Gamma} \leq \frac {\mathbb {P} (\mathbf {a} \mid \mathbf {x} , \mathbf {u})}{\mathbb {P} (\mathbf {a} \mid \mathbf {x})} \leq \Gamma . \tag {44}
$$
With the same arguments as in Eq. (40), it follows that the CMSM is a weighted GMSM with weight function  $q(\mathbf{a},\mathbf{x}) = 0$ .
C.3 Longitudinal marginal sensitivity model (LMSM):
For longitudinal settings with time-varying observed confounders  $\mathbf{X} = \bar{\mathbf{X}}_T = (\mathbf{X}_1,\dots ,\mathbf{X}_T)$ , unobserved confounders  $\mathbf{U} = \bar{\mathbf{U}}_T = (\mathbf{U}_1,\dots ,\mathbf{U}_T)$ , treatments  $\mathbf{A} = \bar{\mathbf{A}}_T = (\mathbf{A}_1,\dots ,\mathbf{A}_T)$ , we define the longitudinal marginal sensitivity model (LMSM) via
$$
\frac {1}{\Gamma} \leq \prod_ {t = 1} ^ {T} \frac {\mathbb {P} \left(\mathbf {a} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {u}} _ {t} , \bar {\mathbf {a}} _ {t - 1}\right)}{\mathbb {P} \left(\mathbf {a} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {a}} _ {t - 1}\right)} \leq \Gamma . \tag {45}
$$
$$
\begin{array}{l} \mathbb {P} \left(\bar {\mathbf {u}} _ {T} \mid \bar {\mathbf {x}} _ {T}, \bar {\mathbf {a}} _ {T}\right) = \frac {\prod_ {t = 1} ^ {T} \mathbb {P} \left(\bar {\mathbf {u}} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {a}} _ {t}\right)}{\prod_ {t = 1} ^ {T - 1} \mathbb {P} \left(\bar {\mathbf {u}} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {a}} _ {t}\right)} = \prod_ {t = 1} ^ {T} \frac {\mathbb {P} \left(\bar {\mathbf {u}} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {a}} _ {t}\right)}{\mathbb {P} \left(\bar {\mathbf {u}} _ {t - 1} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {a}} _ {t - 1}\right)} (46) \\ \stackrel {(*)} {=} \left(\prod_ {t = 1} ^ {T} \frac {\mathbb {P} \left(\mathbf {a} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {u}} _ {t} , \bar {\mathbf {a}} _ {t - 1}\right)}{\mathbb {P} \left(\mathbf {a} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {a}} _ {t - 1}\right)}\right) \left(\prod_ {t = 1} ^ {T} \frac {\mathbb {P} \left(\bar {\mathbf {u}} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {a}} _ {t - 1}\right)}{\mathbb {P} \left(\bar {\mathbf {u}} _ {t - 1} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {a}} _ {t - 1}\right)}\right) (47) \\ = \left(\prod_ {t = 1} ^ {T} \frac {\mathbb {P} \left(\mathbf {a} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {u}} _ {t} , \bar {\mathbf {a}} _ {t - 1}\right)}{\mathbb {P} \left(\mathbf {a} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {a}} _ {t - 1}\right)}\right) \left(\prod_ {t = 1} ^ {T} \mathbb {P} \left(\mathbf {u} _ {t} \mid \bar {\mathbf {x}} _ {T}, \bar {\mathbf {a}} _ {t - 1}, \bar {\mathbf {u}} _ {t - 1}\right)\right) (48) \\ = \left(\prod_ {t = 1} ^ {T} \frac {\mathbb {P} \left(\mathbf {a} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {u}} _ {t} , \bar {\mathbf {a}} _ {t - 1}\right)}{\mathbb {P} \left(\mathbf {a} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {a}} _ {t - 1}\right)}\right) \mathbb {P} \left(\bar {\mathbf {u}} _ {T} \mid \bar {\mathbf {x}} _ {T}, d o \left(\bar {\mathbf {A}} _ {T} = \bar {\mathbf {a}} _ {T}\right)\right), (49) \\ \end{array}
$$
where  $(\ast)$  follows by applying Bayes' theorem on  $\mathbb{P}(\bar{\mathbf{u}}_t\mid \bar{\mathbf{x}}_T,\bar{\mathbf{a}}_t)$ . Hence, the LMSM is a weighted GMSM with weight function  $q(\bar{\mathbf{a}}_T,\bar{\mathbf{x}}_T) = 0$ . Note that we can also define LMSMs with different weight functions via
$$
\frac {1}{(1 - \Gamma) q \left(\bar {\mathbf {a}} _ {T} , \bar {\mathbf {x}} _ {T}\right) + \Gamma} \leq \prod_ {t = 1} ^ {T} \frac {\mathbb {P} \left(\mathbf {a} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {u}} _ {t} , \bar {\mathbf {a}} _ {t - 1}\right)}{\mathbb {P} \left(\mathbf {a} _ {t} \mid \bar {\mathbf {x}} _ {T} , \bar {\mathbf {a}} _ {t - 1}\right)} \leq \frac {1}{(1 - \Gamma^ {- 1}) q \left(\bar {\mathbf {a}} _ {T} , \bar {\mathbf {x}} _ {T}\right) + \Gamma^ {- 1}}. \tag {50}
$$
D Bounds for average causal effects and differences
Here, we show that we can use our sharp bounds to obtain sharp bounds for causal effect averages and differences. We state the results for the upper bound
$$
Q ^ {+} (\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1}, \mathcal {S}) = \sup  _ {\mathcal {M} \in \mathcal {C} (\mathcal {S})} Q (\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1}, \mathcal {M}). \tag {51}
$$
All definitions and bounds for the lower bound  $Q^{-}(\mathbf{x},\bar{\mathbf{a}}_{\ell +1},\mathcal{S})$  can be obtained by swapping the signs.
We are interested in the sharp upper bound for the average causal effect
$$
Q _ {\text {a v g}} ^ {+} (\bar {\mathbf {a}} _ {\ell + 1}, \mathcal {S}) = \sup  _ {\mathcal {M} \in \mathcal {C} (\mathcal {S})} \int_ {\mathcal {X}} Q (\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1}, \mathcal {M}) \mathrm {d} \mathbf {x} \tag {52}
$$
and the sharp upper bound for the causal effect difference
$$
Q _ {\text {d i f f}} ^ {+} \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(1)}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(2)}, \mathcal {S}\right) = \sup  _ {\mathcal {M} \in \mathcal {C} (\mathcal {S})} \left(Q \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(1)}, \mathcal {M}\right) - Q \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(2)}, \mathcal {M}\right)\right). \tag {53}
$$
Lemma 3. We can compute  $Q_{\mathrm{avg}}^{+}(\bar{\mathbf{a}}_{\ell +1},\mathcal{S})$  and  $Q_{\mathrm{diff}}^{+}\left(\mathbf{x},\bar{\mathbf{a}}_{\ell +1}^{(1)},\bar{\mathbf{a}}_{\ell +1}^{(2)},\mathcal{S}\right)$  from our sharp bounds  $Q^{+}(\mathbf{x},\bar{\mathbf{a}}_{\ell +1},\mathcal{S})$  and  $Q^{-}(\mathbf{x},\bar{\mathbf{a}}_{\ell +1},\mathcal{S})$  via
$$
Q _ {\text {a v g}} ^ {+} \left(\bar {\mathbf {a}} _ {\ell + 1}, \mathcal {S}\right) = \int_ {\mathcal {X}} Q ^ {+} \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1}, \mathcal {S}\right) \mathrm {d} \mathbf {x} \tag {54}
$$
$$
Q _ {\text {d i f f}} ^ {+} \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(1)}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(2)}, \mathcal {S}\right) = Q ^ {+} \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(1)}, \mathcal {S}\right) - Q ^ {-} \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(2)}, \mathcal {S}\right). \tag {55}
$$
Proof. The result for  $Q_{\mathrm{avg}}^{+}(\bar{\mathbf{a}}_{\ell +1},\mathcal{S})$  follows directly from interchanging the supremum and integral. For  $Q_{\mathrm{diff}}^{+}\left(\mathbf{x},\bar{\mathbf{a}}_{\ell +1}^{(1)},\bar{\mathbf{a}}_{\ell +1}^{(2)},\mathcal{S}\right)$ , we note that
$$
\begin{array}{l} Q _ {\text {d i f f}} ^ {+} \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(1)}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(2)}, \mathcal {S}\right) \leq \sup  _ {\mathcal {M} _ {1} \in \mathcal {C} (\mathcal {S})} Q \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(1)}, \mathcal {M} _ {1}\right) - \inf  _ {\mathcal {M} _ {2} \in \mathcal {C} (\mathcal {S})} Q \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(2)}, \mathcal {M} _ {2}\right) (56) \\ = Q ^ {+} \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(1)}, \mathcal {S}\right) - Q ^ {-} \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(2)}, \mathcal {S}\right). (57) \\ \end{array}
$$
To show the equality in Eq. (56), we show that, for each pair of SCMs  $\mathcal{M}_1, \mathcal{M}_2 \in \mathcal{C}(\mathcal{S})$ , we can find an SCM  $\mathcal{M} \in \mathcal{C}(\mathcal{S})$  such that
$$
Q \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(1)}, \mathcal {M} _ {1}\right) - Q \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(2)}, \mathcal {M} _ {2}\right) = Q \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(1)}, \mathcal {M}\right) - Q \left(\mathbf {x}, \bar {\mathbf {a}} _ {\ell + 1} ^ {(2)}, \mathcal {M}\right). \tag {58}
$$
We can assume w.l.o.g. that all  $\mathcal{M} \in \mathcal{C}(\mathcal{S})$  induce the same distributions  $\mathbb{P}^{\mathbf{U}_W|\mathbf{x}}$  on the confounding space. We denote the functional assignments of  $\mathcal{M}_1$  and  $\mathcal{M}_2$  as  $f_{\mathcal{M}_1}^W(\mathbf{x}, \mathbf{m}_W, \mathbf{a}, \mathbf{u}_W)$  and  $f_{\mathcal{M}_2}^W(\mathbf{x}, \mathbf{m}_W, \mathbf{a}, \mathbf{u}_W)$ . We can now define a functional assignment  $f_{\mathcal{M}}^W(\mathbf{x}, \mathbf{m}_W, \mathbf{a}, \mathbf{u}_W)$  for  $\mathcal{M}$  so that
$$
f _ {\mathcal {M}} ^ {W} (\cdot , \cdot , \mathbf {a} ^ {(1)}, \cdot) = f _ {\mathcal {M} _ {1}} ^ {W} (\cdot , \cdot , \mathbf {a} ^ {(1)}, \cdot) \quad \text {a n d} \quad f _ {\mathcal {M}} ^ {W} (\cdot , \cdot , \mathbf {a} ^ {(2)}, \cdot) = f _ {\mathcal {M} _ {2}} ^ {W} (\cdot , \cdot , \mathbf {a} ^ {(2)}, \cdot), \tag {59}
$$
which implies Eq. (58).
E Compatibility of SCMs with sensitivity models
Here, we provide details regarding our class  $\mathcal{C}(\mathcal{S})$  of SCMs that are compatible with a sensitivity model  $\mathcal{S}$  from Def. 2.
Definition 6 (Compatibility). Let  $\mathbb{P}^{\mathbf{V}}$  denote the distribution of the observed variables  $\mathbf{V} = (\mathbf{X},\mathbf{A},\bar{\mathbf{M}}_{\ell},Y)$  and let  $S$  be a sensitivity model with unobserved confounders  $\mathbf{U}$  and a family of joint distributions  $\mathcal{P}$ . Let  $\mathcal{M}$  be an SCM with observed variables  $\mathbf{V}_{\mathcal{M}} = \mathbf{V}$  and unobserved variables  $\mathbf{U}_{\mathcal{M}} \supseteq \mathbf{U}$  that contain the unobserved confounders  $\mathbf{U}$  from the sensitivity model but also potential exogenous noise. Then,  $\mathcal{M}$  is compatible with  $S$ , if the following three conditions are satisfied:
1. Graph compatibility: the induced causal graph  $\mathcal{G}_{\mathcal{M}}$  by  $\mathcal{M}$  on  $\mathbf{V} \cup \mathbf{U}$  must coincide with our assumed causal structure (see Sec. 3.1).
2. Latent unconfoundedness:  $\mathbb{P}(w\mid \mathbf{x},\mathbf{m}_W,do(\mathbf{A} = \mathbf{a})) = \int \mathbb{P}(w\mid \mathbf{x},\mathbf{u}_W,\mathbf{m}_W,\mathbf{a})\mathbb{P}(\mathbf{u}_W\mid$ $\mathbf{x},\mathbf{m}_W)\mathrm{d}\mathbf{u}_W$  for all  $\mathbf{x}\in \mathcal{X}$ $\mathbf{m}_W\in supp(\mathbf{M}_W)$ $\mathbf{a}\in \mathcal{A}$  , and  $W\in \{M_1,\dots ,M_\ell ,Y\}$
3. Sensitivity constraints:  $\mathbb{P}_{\mathcal{M}}^{\mathbf{V} \cup \mathbf{U}} \in \mathcal{P}$ , where  $\mathbb{P}_{\mathcal{M}}^{\mathbf{V} \cup \mathbf{U}}$  denotes the distribution on  $\mathbf{V} \cup \mathbf{U}$  induced by  $\mathcal{M}$ .
In Definition 6, the latent unconfoundedness condition ensures that all interventional densities  $\mathbb{P}(w\mid \mathbf{x},\mathbf{m}_W,do(\mathbf{A} = \mathbf{a}))$  are point-identified under access to the unobserved confounders. In particular, this ensures that the SCM  $\mathcal{M}$  can not contain additional unobserved confounders (e.g., between mediators and outcome). Similar assumptions are standard in the causal sensitivity literature [18].
F Importance sampling estimators for finite sample bounds
In this section, we derive estimators for the outcome bound  $\mathcal{D}\left(\mathbb{P}_{+}^{Y}(\cdot \mid \mathbf{x},\bar{\mathbf{m}}_{\ell},\mathbf{a})\right)$  for continuous  $Y\in \mathbb{R}$ . We assume that we have already obtained an estimator  $\hat{\mathbb{P}}^Y (\cdot \mid \mathbf{x},\bar{\mathbf{m}}_\ell ,\mathbf{a})$  of the observational distribution  $\mathbb{P}^Y (\cdot \mid \mathbf{x},\bar{\mathbf{m}}_\ell ,\mathbf{a})$ , and that we are able to sample  $(y_{i})_{i = 1}^{k}\sim \hat{\mathbb{P}}^{Y}(\cdot \mid \mathbf{x},\bar{\mathbf{m}}_{\ell},\mathbf{a})$  (see Appendix G for implementation details). Note that the outcome bound  $\mathcal{D}\left(\mathbb{P}_+^Y (\cdot \mid \mathbf{x},\bar{\mathbf{m}}_\ell ,\mathbf{a})\right)$  depends on the shifted distribution  $\mathbb{P}_+^Y (\cdot \mid \mathbf{x},\bar{\mathbf{m}}_\ell ,\mathbf{a})$  and not on the observational distribution  $\mathbb{P}^Y (\cdot \mid \mathbf{x},\bar{\mathbf{m}}_\ell ,\mathbf{a})$ . Hence, we use an importance sampling approach to derive our estimators, which we outline in the following for the expectation functional and distributional effects. We denote the CDFs corresponding to  $\mathbb{P}_+^Y (\cdot \mid \mathbf{x},\bar{\mathbf{m}}_\ell ,\mathbf{a})$  and  $\mathbb{P}^Y (\cdot \mid \mathbf{x},\bar{\mathbf{m}}_\ell ,\mathbf{a})$  by  $F_{\mathbb{P}_+^Y |x,\bar{\mathbf{m}}_\ell ,\mathbf{a}}$  and  $F_{\mathbb{P}^Y |x,\bar{\mathbf{m}}_\ell ,\mathbf{a}}$ , respectively.
Expectation functional: For the expectation functional, we can rewrite the outcome bound as
$$
\begin{array}{l} \mathcal {D} \left(\mathbb {P} _ {+} ^ {Y} (\cdot | \mathbf {x}, \bar {\mathbf {m}} _ {\ell}, \mathbf {a})\right) = \mathbb {E} _ {Y \sim \mathbb {P} _ {+} ^ {Y | \mathbf {x}, \bar {\mathbf {m}} _ {\ell}, \mathbf {a}}} [ Y ] (60) \\ = \mathbb {E} _ {Y \sim \mathbb {P} ^ {Y} | \mathbf {x}, \bar {\mathbf {m}} _ {\ell}, \mathbf {a}} \left[ Y \frac {\mathbb {P} _ {+} ^ {Y} (Y \mid \mathbf {x} , \bar {\mathbf {m}} _ {\ell} , \mathbf {a})}{\mathbb {P} ^ {Y} (Y \mid \mathbf {x} , \bar {\mathbf {m}} _ {\ell} , \mathbf {a})} \right] (61) \\ = \mathbb {E} _ {Y \sim \mathbb {P} ^ {Y | \mathbf {x}, \bar {\mathbf {m}} _ {\ell}, \mathbf {a}}} \left[ \frac {Y}{s _ {Y} ^ {+}} \mathbb {1} \left(Y \leq F _ {\mathbb {P} ^ {Y | \mathbf {x}, \bar {\mathbf {m}} _ {\ell}, \mathbf {a}}} ^ {- 1} \left(c _ {Y} ^ {+}\right)\right) + \frac {Y}{s _ {Y} ^ {-}} \mathbb {1} \left(Y > F _ {\mathbb {P} ^ {Y | \mathbf {x}, \bar {\mathbf {m}} _ {\ell}, \mathbf {a}}} ^ {- 1} \left(c _ {Y} ^ {+}\right)\right) \right] (62) \\ \end{array}
$$
to obtain the consistent estimator
$$
\mathcal {D} \left(\overbrace {\mathbb {P} _ {+} ^ {Y} (\cdot | \mathbf {x} , \tilde {\mathbf {m}} _ {\ell} , \mathbf {a})}\right) = \frac {1}{k} \sum_ {i = 1} ^ {\lfloor k c _ {Y} ^ {+} \rfloor} \frac {y _ {i}}{\hat {s} _ {Y} ^ {+}} + \frac {1}{k} \sum_ {i = \lfloor k c _ {Y} ^ {+} \rfloor + 1} ^ {k} \frac {y _ {i}}{\hat {s} _ {Y} ^ {-}}, \tag {63}
$$
where  $(y_{i})_{i = 1}^{k}\sim \hat{\mathbb{P}}^{Y}(\cdot \mid \mathbf{x},\bar{\mathbf{m}}_{\ell},\mathbf{a})$  are sampled from the estimated observational distribution. This corresponds to Eq. (8) in the main paper.
Computational complexity: Given trained models and a sample  $(y_{i})_{i = 1}^{k}\sim \hat{\mathbb{P}}^{Y}(\cdot \mid \mathbf{x},\bar{\mathbf{m}}_{\ell},\mathbf{a})$  our estimator from Eq. (63) has a complexity of  $\mathcal{O}(k)$  as it only involves summing and quantile computation. To set this in relation to existing work, Algorithm 1 of Jesson et al. [32] has a complexity of  $\mathcal{O}(kn)$ , where  $n$  is a number of grid search points. This is demonstrated in Table 1, where we choose  $k = n = 5000$ .
Distributional effects: We now derive estimators for distributional effects, i.e., for quantile functionals  $\mathcal{D}$  of the form
$$
\mathcal {D} \left(\mathbb {P} _ {+} ^ {Y} (\cdot | \mathbf {x}, \bar {\mathbf {m}} _ {\ell}, \mathbf {a})\right) = F _ {\mathbb {P} _ {+} ^ {Y | \mathbf {x}, \bar {\mathbf {m}} _ {\ell}, \mathbf {a}}} ^ {- 1} (\alpha) \tag {64}
$$
with  $\alpha \in (0,1)$ . We again use an importance sampling approach and rewrite
$$
\begin{array}{l} F _ {\mathbb {P} _ {+} ^ {Y | \mathbf {x}, \tilde {\mathbf {m}} _ {\ell}, \mathbf {a}}} (y) = \mathbb {E} _ {Y \sim \mathbb {P} _ {+} ^ {Y | \mathbf {x}, \tilde {\mathbf {m}} _ {\ell}, \mathbf {a}}} [ \mathbb {1} (Y \leq y) ] (65) \\ = \mathbb {E} _ {Y \sim \mathbb {P} ^ {Y | \mathbf {x}, \bar {\mathbf {m}} _ {\ell}, \mathbf {a}}} \left[ \mathbb {1} (Y \leq y) \frac {\mathbb {P} _ {+} ^ {Y} (Y \mid \mathbf {x} , \bar {\mathbf {m}} _ {\ell} , \mathbf {a})}{\mathbb {P} ^ {Y} (Y \mid \mathbf {x} , \bar {\mathbf {m}} _ {\ell} , \mathbf {a})} \right] (66) \\ = \mathbb {E} _ {Y \sim \mathbb {P} ^ {Y | \mathbf {x}, \bar {\mathbf {m}} _ {\ell}, \mathbf {a}}} \left[ \frac {\mathbb {1} \left(Y \leq \min  \{y , F _ {\mathbb {P} ^ {Y | \mathbf {x} , \bar {\mathbf {m}} _ {\ell} , \mathbf {a}}} ^ {- 1} \left(c _ {Y} ^ {+}\right) \}\right)}{s _ {Y} ^ {+}} + \frac {\mathbb {1} \left(F _ {\mathbb {P} ^ {Y | \mathbf {x} , \bar {\mathbf {m}} _ {\ell} , \mathbf {a}}} ^ {- 1} \left(c _ {Y} ^ {+}\right) <   Y \leq y\right)}{s _ {Y} ^ {-}} \right]. (67) \\ \end{array}
$$
Hence, we can sample  $(y_{i})_{i = 1}^{k}\sim \hat{\mathbb{P}}^{Y}(\cdot \mid \mathbf{x},\bar{\mathbf{m}}_{\ell},\mathbf{a})$  and obtain the consistent estimator
$$
\mathcal {D} \left(\mathbb {P} _ {+} ^ {Y} (\widehat {\cdot | x , \bar {m} _ {\ell} , a})\right) = \min  _ {\hat {F} _ {\mathbb {P} _ {+} ^ {Y | x , \bar {m} _ {\ell} , a}} (y _ {i}) \geq \alpha} y _ {i}, \tag {68}
$$
$$
\hat {F} _ {\mathbb {P} _ {+} ^ {Y \mid \mathbf {x}, \bar {\mathbf {m}} _ {\ell}, \mathbf {a}}} (y) = \frac {1}{k} \sum_ {i = 1} ^ {\lfloor k c _ {Y} ^ {+} \rfloor} \frac {\mathbb {1} \left(y _ {i} \leq y\right)}{\hat {s} _ {Y} ^ {+}} + \frac {1}{k} \sum_ {i = \lfloor k c _ {Y} ^ {+} \rfloor + 1} ^ {k} \frac {\mathbb {1} \left(y _ {i} \leq y\right)}{\hat {s} _ {Y} ^ {-}}. \tag {69}
$$
G Implementation and hyperparameter tuning details
All our experimental settings feature a continuous outcome  $Y \in \mathbb{R}$  and (optionally) discrete mediators  $M_{i} \in \mathbb{N}$ . Hence, we need to estimate the conditional outcome density  $\mathbb{P}^{Y}(\cdot \mid \mathbf{x},\mathbf{m},\mathbf{a})$  and conditional probability mass functions  $\mathbb{P}^{M_i}(\cdot \mid \mathbf{x},\bar{\mathbf{m}}_{i - 1},\mathbf{a})$  in order to estimate our bounds with Eq. (63), Eq. (68), and Algorithm 1 from the main paper.
Conditional outcome density: We use conditional normalizing flows (CNFs) [73] for estimating the conditional density  $\mathbb{P}^Y (\cdot \mid \mathbf{x},\bar{\mathbf{m}}_\ell ,\mathbf{a})$ . Normalizing flows (NFs) model a distribution  $\mathbb{P}^Y$  of a target variable  $Y$  by transforming a simple base distribution  $\mathbb{P}^U$  (e.g., standard normal) of a latent variable  $U$  through an invertible transformation  $Y = f_{\theta}(U)$ , where  $\theta$  denotes learnable parameters [58]. In order to estimate the conditional density  $\mathbb{P}^Y (\cdot \mid \mathbf{x},\bar{\mathbf{m}}_\ell ,\mathbf{a})$ , we leverage CNFs, that is, we define the parameters  $\theta$  as an output of a hyper network  $\theta = g_{\eta}(\mathbf{x},\bar{\mathbf{m}}_{\ell},\mathbf{a})$  with learnable parameters  $\eta$ . Given a sample  $\{\mathbf{x}_i,\bar{\mathbf{m}}_{\ell ,i},\mathbf{a}_i,y_i\}_{i = 1}^n$ , we learn  $\eta$  by maximizing the log-likelihood
$$
\begin{array}{l} \ell (\eta) = \sum_ {i = 1} ^ {n} \log \left(f _ {g _ {\eta} \left(\mathbf {x} _ {i}, \bar {\mathbf {m}} _ {\ell , i}, \mathbf {a} _ {i}\right) _ {\#}} \mathbb {P} ^ {U} \left(y _ {i}\right)\right) (70) \\ \stackrel {(*)} {=} \sum_ {i = 1} ^ {n} \log \left(\mathbb {P} ^ {U} \left(f _ {g _ {\eta} (\mathbf {x} _ {i}, \tilde {\mathbf {m}} _ {\ell , i}, \mathbf {a} _ {i})} ^ {- 1} (y _ {i})\right)\right) + \log \left(\left| \frac {\mathrm {d}}{\mathrm {d} y} f _ {g _ {\eta} (\mathbf {x} _ {i}, \tilde {\mathbf {m}} _ {\ell , i}, \mathbf {a} _ {i})} ^ {- 1} (y _ {i}) \right|\right), (71) \\ \end{array}
$$
where  $f_{g_{\eta}(\mathbf{x}_i,\bar{\mathbf{m}}_{\ell ,i},\mathbf{a}_i)}\# \mathbb{P}^U (y_i)$  denotes the (push-forward) density induced by  $f_{g_{\eta}(\mathbf{x}_i,\bar{\mathbf{m}}_{\ell ,i},\mathbf{a}_i)}$  on  $\mathbb{R}$  and  $(*)$  follows from the change-of-variables theorem for invertible transformations.
In our implementation, we use neural spline flows. That is, we model the invertible transformation  $f_{\theta}$  via a spline flow as described in [21]. We use a feed-forward neural network for the hypernetwork  $g_{\eta}(\mathbf{x},\bar{\mathbf{m}}_{\ell},\mathbf{a})$  with 2 hidden layers, ReLU activation functions, and linear output. We set the latent distribution  $\mathbb{P}^U$  to a standard normal distribution  $\mathcal{N}(0,1)$ . For training, we use the Adam optimizer [41].