SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Drawbacks of ignoring the causal mechanisms when performing imitation learning have recently been acknowledged. Several approaches both to assess the feasibility of imitation and to circumvent causal confounding and causal misspecifications have been proposed in the literature. However, the potential benefits of the incorporation of additional information about the underlying causal structure are left unexplored. An example of such overlooked information is context-specific independence (CSI), i.e., independence that holds only in certain contexts. We consider the problem of causal imitation learning when CSI relations are known. We prove that the decision problem pertaining to the feasibility of imitation in this setting is NP-hard. Further, we provide a necessary graphical criterion for imitation learning under CSI and show that under a structural assumption, this criterion is also sufficient. Finally, we propose a sound algorithmic approach for causal imitation learning which takes both CSI relations and data into account.
Imitation learning has been shown to significantly improve performance in learning complex tasks in a variety of applications, such as autonomous driving [27], electronic games [17, 41], and navigation [34]. Moreover, imitation learning allows for learning merely from observing expert demonstrations, therefore circumventing the need for designing reward functions or interactions with the environment. Instead, imitation learning works through identifying a policy that mimics the demonstrator's behavior which is assumed to be generated by an expert with near-optimal performance in terms of the reward. Imitation learning techniques are of two main flavors: behavioral cloning (BC) [42, 30, 24, 25], and inverse reinforcement learning<sup>1</sup> (IRL) [26, 1, 37, 44]. BC approaches often require extensive data to succeed. IRL methods have proved more successful in practice, albeit at the cost of an extremely high computational load. The celebrated generative adversarial imitation learning (GAIL) framework and its variants bypass the IRL step by occupancy measure matching to learn an optimal policy [15].
Despite recent achievements, still in practice applying imitation learning techniques can result in learning policies that are markedly different from that of the expert [9, 7, 22]. This phenomenon is for the most part the result of a distributional shift between the demonstrator and imitator environments [11, 31, 12]. All aforementioned imitation learning approaches rely on the assumption that the imitator has access to observations that match those of the expert. An assumption clearly violated when unobserved confounding effects are present, e.g., because the imitator has access only to partial observations of the system. For instance, consider the task of training an imitator to drive a car, the causal diagram of which is depicted in Figure 1a.  $X$  and  $Y$  in this graph represent the action taken by the driver and the latent reward, respectively. The expert driver controls her speed  $(X)$  based on the speed limit on the highway (denoted by  $S$ ), along with other covariates such as weather conditions,
Also referred to as inverse optimal control in the literature.
(a) not immutable
(b) immutable
Figure 1: Example of learning to drive a car. (a) Imitation is impossible, as the imitator has no access to the speed limit. (b) The car has automatic cruise control, which makes the expert actions independent of the speed limit. (c) Driver actions are independent of speed limit only in the context of heavy traffic. (d) A simple example of a CSI relation in economics.
(c) contextually imitable
(d) wage rate example
brake indicator of the car in front, traffic load, etc. We use two such covariates in our example:  $Z$  and  $T$ . An optimal imitator should mimic the expert by taking actions according to the expert policy  $P(X|S,Z,T)$ . However, if the collected demonstration data does not include the speed limit ( $S$ ), the imitator would tend to learn a policy that averages the expert speed, taking only the other covariates ( $Z$  and  $T$ ) into account. Such an imitator could end up crashing on serpentine roads or causing traffic jams on highways. As shown in Figure 1a, the speed limit acts as a latent confounder<sup>2</sup>.
One could argue that providing more complete context data to the imitator, e.g. including the speed limit in the driving example, would resolve such issues. While this solution is not applicable in most scenarios, the fundamental problem in imitation learning is not limited to causal confounding. As demonstrated by [12] and [43], having access to more data not only does not always result in improvement but also can contribute to further deterioration in performance. In other words, important issues can stem not merely from a lack of observations but from ignoring the underlying causal mechanisms. The drawback of utilizing imitation learning without considering the causal structure has been recently acknowledged, highlighting terms including causal confusion [12], sensor-shift [13], imitation learning with unobserved confounders [43], and temporally correlated noise [36].
Incorporating causal structure when designing imitation learning approaches has been studied in recent work. For instance, [12] proposed performing targeted interventions to avoid causal misspecification. [43] characterized a necessary and sufficient graphical criterion to decide the feasibility of an imitation task (aka imitability). It also proposed a practical causal imitation framework that allowed for imitation in specific instances even when the general graphical criterion (the existence of a  $\pi$ -backdoor admissible set) did not necessarily hold. [36] proposed a method based on instrumental variable regression to circumvent the causal confounding when a valid instrument was available.
Despite recent progress, the potential benefits of further information pertaining to the causal mechanisms remain unexplored. An important type of such information is context-specific independence (CSI) relations, which are generalizations of conditional independence. Take, for instance, the labor market example shown in Figure 1d, where  $W$ ,  $E$ , and  $U$  represent the wage rate, education level, and unemployment rate, respectively. The wage rate  $W$  is a function of  $E$  and  $U$ . However, when unemployment is greater than  $10\%$ , the education level does not have a significant effect on the wage rate, as there is more demand for the job than the openings. This is to say,  $W$  is independent of  $E$  given  $U$ , only when  $U > 10\%$ . This independence is shown by a label  $U > 0.1$  on the edge  $E \rightarrow W$ . Analogously, in our driving example, the imitator would still match the expert's policy if there was heavy traffic on the route. This is because, in the context that there is heavy traffic, the policy of the expert would be independent of the speed limit. This context-specific independence between the speed limit  $S$  and the action  $X$  given  $T = 1$  (heavy traffic) is indicated by a label  $(T = 1)$  on the edge  $S \rightarrow X$  in Figure 1c. This label indicates that the edge  $S \rightarrow X$  is absent when  $T = 1$ . The variables  $T$  in Figure 1c and  $U$  in Figure 1d are called context variables, i.e., variables which induce conditional independence relations in the system based on their realizations.
CSIs can be incorporated through a refined presentation of Bayesian networks to increase the power of inference algorithms [8]. The incorporation of CSI also has ramifications on causal inference. For instance, [39] showed that when accounting for CSIs, Pearl's do-calculus is no longer complete for causal identification. They proposed a sound algorithm for identification under CSIs. It is noteworthy
On the other hand, if the car had automatic cruise control, the expert policy would be independent of the speed limit, resolving imitation issues (refer to Figure 1b.)
that unlike conditional Independence (CI) relations that can be learned from data and are widely used to infer the graphical representation of causal mechanisms [35, 6, 10, 4, 19, 18], not all CSI relations can be learned from mere observational data. However, several approaches exist for learning certain CSIs from data [21, 16, 32, 23]. In this paper, we investigate how CSIs allow for imitability in previously non-imitable instances.
After presenting the notation (Section 2), we first prove a hardness result, namely, that deciding the feasibility of imitation learning while accounting for CSIs is NP-hard. This is in contrast to the classic imitability problem [43], where deciding imitability is equivalent to a single d-separation test. We characterize a necessary and sufficient graphical criterion for imitability under CSIs under a structural assumption (Section 3) by leveraging a connection we establish between our problem and classic imitability. Next, we show that in certain instances, the dataset might allow for imitation, despite the fact that the graphical criterion is not satisfied (Section 4). Given the constructive nature of our achievability results, we propose algorithmic approaches for designing optimal imitation policies (Sections 3 and 4) and evaluate their performance in Section 5. The proofs of all our results appear in Appendix A.
Throughout this work, we denote random variables and their realizations by capital and small letters, respectively. Likewise, we use boldface capital and small letters to represent sets of random variables and their realizations, respectively. For a variable  $X$ ,  $\mathcal{D}_X$  denotes the domain of  $X$  and  $\mathcal{P}_X$  the space of probability distributions over  $\mathcal{D}_X$ . Given two subsets of variables  $\mathbf{T}$  and  $\mathbf{S}$  such that  $\mathbf{T} \subseteq \mathbf{S}$ , and a realization  $\mathbf{s} \in \mathcal{D}_{\mathbf{S}}$ , we use  $(\mathbf{s})_{\mathbf{T}}$  to denote the restriction of  $\mathbf{s}$  to the variables in  $\mathbf{T}$ .
We use structural causal models (SCMs) as the semantic framework of our work [28]. An SCM  $M$  is a tuple  $\langle \mathbf{U},\mathbf{V},P^{M}(\mathbf{U}),\mathcal{F}\rangle$  where  $\mathbf{U}$  and  $\mathbf{V}$  are the sets of exogenous and endogenous variables, respectively. Values of variables in  $\mathbf{U}$  are determined by an exogenous distribution  $P^M (\mathbf{U})$ , whereas the variables in  $\mathbf{V}$  take values defined by the set of functions  $\mathbf{F} = \{f_V^M\}_{V\in \mathbf{V}}$ . That is,  $V\gets f_{V}^{M}(\mathbf{Pa}(V)\cup \mathbf{U}_{V})$  where  $\mathbf{Pa}(V)\subseteq \mathbf{V}$  and  $\mathbf{U}_V\subseteq \mathbf{U}$ . We also partition  $\mathbf{V}$  into the observable and latent variables, denoted by  $\mathbf{O}$  and  $\mathbf{L}$ , respectively, such that  $\dot{\mathbf{V}} = \mathbf{O}\cup \mathbf{L}$ . The SCM induces a probability distribution over  $\mathbf{V}$  whose marginal distribution over observable variables, denoted by  $P^{M}(\mathbf{O})$ , is called the observational distribution. Moreover, we use  $do(\mathbf{X} = \mathbf{x})$  to denote an intervention on  $\mathbf{X}\subseteq \mathbf{V}$  where the values of  $\mathbf{X}$  are set to a constant  $\mathbf{x}$  in lieu of the functions  $\{f_X^M:\forall X\in \mathbf{X}\}$ . We use  $P_{\mathbf{x}}^{M}(\mathbf{y}):= P^{M}(\mathbf{Y}=\mathbf{y}|do(\mathbf{X}=\mathbf{x}))$  as a shorthand for the post-interventional distribution of  $\mathbf{Y}$  after the intervention  $do(\mathbf{X} = \mathbf{x})$ .
Let  $\mathbf{X}$ ,  $\mathbf{Y}$ ,  $\mathbf{W}$ , and  $\mathbf{Z}$  be pairwise disjoint subsets of variables.  $\mathbf{X}$  and  $\mathbf{Y}$  are called contextually independent given  $\mathbf{W}$  in the context  $\mathbf{z} \in \mathcal{D}_{\mathbf{Z}}$  if  $P(\mathbf{X}|\mathbf{Y},\mathbf{W},\mathbf{z}) = P(\mathbf{X}|\mathbf{W},\mathbf{z})$ , whenever  $P(\mathbf{Y},\mathbf{W},\mathbf{z}) > 0$ . We denote this context-specific independence (CSI) relation by  $\mathbf{X} \perp \mathbf{Y}|\mathbf{W},\mathbf{z}$ . Moreover, a CSI is called local if it is of the form  $X \perp Y|\mathbf{z}$  where  $\{Y\} \cup \mathbf{Z} \subseteq \mathrm{Pa}(X)$ .
A directed acyclic graph (DAG) is defined as a pair  $\mathcal{G} = (\mathbf{V},\mathbf{E})$ , where  $\mathbf{V}$  is the set of vertices, and  $\mathbf{E} \subseteq \mathbf{V} \times \mathbf{V}$  denotes the set of directed edges among the vertices. SCMs are associated with DAGs, where each variable is represented by a vertex of the DAG, and there is a directed edge from  $V_{i}$  to  $V_{j}$  if  $V_{i} \in \mathrm{Pa}(V_{j})$  [28]. Whenever a local CSI of the form  $V_{i} \perp V_{j} | \ell$  holds, we say  $\ell$  is a label for the edge  $(V_{i},V_{j})$  and denote it by  $\ell \in \mathcal{L}_{(V_i,V_j)}$ . Recalling the example of Figure 1c, the realization  $T = 1$  is a label for the edge  $(S,X)$ , which indicates that this edge is absent when  $T$  is equal to 1. Analogous to [29], we define a labeled DAG (LDAG), denoted by  $\mathcal{G}^{\mathcal{L}}$ , as a tuple  $\mathcal{G}^{\mathcal{L}} = (\mathbf{V},\mathbf{E},\mathcal{L})$ , where  $\mathcal{L}$  denotes the labels representing local independence relations. More precisely,  $\mathcal{L} = \{\mathcal{L}_{(V_i,V_j)} : \mathcal{L}_{(V_i,V_j)} \neq \emptyset \mid (V_i,V_j) \in \mathbf{E}\}$ , where
$$
\mathcal {L} _ {\left(V _ {i}, V _ {j}\right)} = \left\{\ell \in \mathcal {D} _ {\mathbf {V} ^ {\prime}} | \mathbf {V} ^ {\prime} \subseteq \operatorname {P a} \left(V _ {j}\right) \backslash \left\{V _ {i} \right\}, V _ {i} \perp V _ {j} | \ell \right\}.
$$
Note that, when  $\mathcal{L} = \emptyset$ ,  $\mathcal{G}^{\mathcal{L}}$  reduces to a DAG. That is, every DAG is a special LDAG with no labels. For ease of notation, we drop the superscript  $\mathcal{L}$  when  $\mathcal{L} = \emptyset$ . Given a label set  $\mathcal{L}$ , we define the context variables of  $\mathcal{L}$ , denoted by  $\mathbf{C}(\mathcal{L})$ , as the subset of variables that at least one realization of them appears in the edge labels. More precisely,
$$
\mathbf {C} (\mathcal {L}) = \left\{V _ {i} | \exists V _ {j}, V _ {k} \neq V _ {i}, \mathbf {V} ^ {\prime}, \ell : \left(V _ {k}, V _ {j}\right) \in \mathbf {E}, V _ {i} \in \mathbf {V} ^ {\prime}, \ell \in \mathcal {D} _ {\mathbf {V} ^ {\prime}} \cap \mathcal {L} _ {\left(V _ {k}, V _ {j}\right)} \right\}, \tag {1}
$$
where  $\mathbf{V}'$  is an arbitrary subset of nodes containing  $V_{i}$ . The argument is that if there exists some arbitrary subset  $\mathbf{V}'$  of nodes containing  $V_{i}$  such that a realization  $l$  of this subset results in independence (e.g., of some  $V_{j}$  and  $V_{k}$ ), then  $V_{i}$  is considered as a context variable. We mainly focus on the settings where context variables are discrete or categorical. This assumption can be relaxed under certain considerations (See Remark 3.11). We let  $\mathcal{M}_{\langle \mathcal{G}^{\mathcal{L}}\rangle}$  denote the class of SCMs compatible with the causal graph  $\mathcal{G}^{\mathcal{L}}$ . For a DAG  $\mathcal{G}$ , we use  $\mathcal{G}_{\overline{\mathbf{X}}}$  and  $\mathcal{G}_{\overline{\mathbf{X}}}$  to represent the subgraphs of  $\mathcal{G}$  obtained by removing edges incoming to and outgoing from vertices of  $\mathbf{X}$ , respectively. We also use standard kin abbreviations to represent graphical relationships: the sets of parents, children, ancestors, and descendants of  $\mathbf{X}$  in  $\mathcal{G}$  are denoted by  $\mathrm{Pa}(\mathbf{X})$ ,  $\mathrm{Ch}(\mathbf{X})$ ,  $\mathrm{An}(\mathbf{X})$ , and  $\mathrm{De}(\mathbf{X})$ , respectively. For disjoint subsets of variable  $\mathbf{X}$ ,  $\mathbf{Y}$  and  $\mathbf{Z}$  in  $\mathcal{G}$ ,  $\mathbf{X}$  and  $\mathbf{Y}$  are said to be d-separated by  $\mathbf{Z}$  in  $\mathcal{G}$ , denoted by  $\mathbf{X} \perp \mathbf{Y} | \mathbf{Z}$ , if every path between vertices in  $\mathbf{X}$  and  $\mathbf{Y}$  is blocked by  $\mathbf{Z}$  (See Definition 1.2.3. in 28). Finally, solid and dashed vertices in the figures represent the observable and latent variables, respectively.
3 Imitability
In this section, we address the decision problem, i.e., whether imitation learning is feasible, given a causal mechanism. We first review the imitation learning problem from a causal perspective, analogous to the framework developed by [43]. We will use this framework to formalize the causal imitability problem in the presence of CSIs. Recall that  $\mathbf{O}$  and  $\mathbf{L}$  represented the observed and unobserved variables, respectively. We denote the action and reward variables by  $X\in \mathbf{O}$  and  $Y\in \mathbf{L}$ , respectively. The reward variable is commonly assumed to be unobserved in imitation learning. Given a set of observable variables  $\mathbf{P}\mathbf{a}^{\Pi}\subseteq \mathbf{O}\setminus \mathbf{D}\mathbf{e}(X)$ , a policy  $\pi$  is then defined as a stochastic mapping, denoted by  $\pi (X|\mathbf{P}\mathbf{a}^{\Pi})$ , mapping the values of  $\mathbf{P}\mathbf{a}^{\Pi}$  to a probability distribution over the action  $X$ . Given a policy  $\pi$ , we use  $do(\pi)$  to denote the intervention following the policy  $\pi$ , i.e., replacing the original function  $f_{X}$  in the SCM by the stochastic mapping  $\pi$ . The distribution of variables under policy  $do(\pi)$  can be expressed in terms of post-interventional distributions  $(P(\cdot |do(x)))$  as follows:
$$
P (\mathbf {v} \mid d o (\pi)) = \sum_ {x \in \mathcal {D} _ {X}, \mathbf {p a} ^ {\Pi} \in \mathcal {D} _ {\mathbf {P a} ^ {\Pi}}} P (\mathbf {v} \mid d o (x), \mathbf {p a} ^ {\Pi}) \pi (x \mid \mathbf {p a} ^ {\Pi}) P (\mathbf {p a} ^ {\Pi}), \tag {2}
$$
where  $\mathbf{v}$  is a realization of an arbitrary subset  $\mathbf{V}' \subseteq \mathbf{V}$ . We refer to the collection of all possible policies as the policy space, denoted by  $\Pi = \{\pi : \mathcal{D}_{\mathbf{P}\mathbf{a}^{\Pi}} \to \mathcal{P}_X\}$ . Imitation learning is concerned with learning an optimal policy  $\pi^{*} \in \Pi$  such that the reward distribution under policy  $\pi^{*}$  matches that of the expert policy, that is,  $P(y|do(\pi^{*})) = P(y)$  [43]. Given a DAG  $\mathcal{G}$  and the policy space  $\Pi$ , if such a policy exists, the instance is said to be imitable w.r.t.  $\langle \mathcal{G}^{\mathcal{L}}, \Pi \rangle$ . The causal imitability problem is formally defined below.
Definition 3.1 (Classic imitability w.r.t.  $\langle \mathcal{G},\Pi \rangle$  43). Given a latent DAG  $\mathcal{G}$  and a policy space  $\Pi$ , let  $Y$  be an arbitrary variable in  $\mathcal{G}$ .  $P(y)$  is said to be imitable w.r.t.  $\langle \mathcal{G},\Pi \rangle$  if for any  $M\in \mathcal{M}_{\langle \mathcal{G}\rangle}$ , there exists a policy  $\pi \in \Pi$  uniquely computable from  $P(\mathbf{O})$  such that  $P^{M}(y|do(\pi)) = P^{M}(y)$ .
Note that if  $Y \notin \mathbf{De}(X)$ , the third rule of Pearl's do calculus implies  $P(y|do(x),\mathbf{pa}^{\Pi}) = P(y|\mathbf{pa}^{\Pi})$  and from Equation (2),  $P(y|do(\pi)) = P(y)$  for any arbitrary policy  $\pi$ . Intuitively, in such a case, action  $X$  has no effect on the reward  $Y$ , and regardless of the chosen policy, imitation is guaranteed. Therefore, throughout this work, we assume that  $X$  affects  $Y$ , i.e.,  $Y \in \mathbf{De}(X) \cap \mathbf{L}$ . Under this assumption, [43] proved that  $P(y)$  is imitable w.r.t.  $\langle \mathcal{G},\Pi \rangle$  if and only if there exists a  $\pi$ -backdoor admissible set  $\mathbf{Z}$  w.r.t.  $\langle \mathcal{G},\Pi \rangle$ .
Definition 3.2 ( $\pi$ -backdoor, 43). Given a DAG  $\mathcal{G}$  and a policy space  $\Pi$ , a set  $\mathbf{Z}$  is called  $\pi$ -backdoor admissible set w.r.t.  $\langle \mathcal{G}, \Pi \rangle$  if and only if  $\mathbf{Z} \subseteq \mathbf{Pa}^{\Pi}$  and  $Y \perp X|\mathbf{Z}$  in  $\mathcal{G}_{\underline{X}}$ .
The following lemma further reduces the search space of  $\pi$ -backdoor admissible sets to a single set.
Lemma 3.3. Given a latent DAG  $\mathcal{G}$  and a policy space  $\Pi$ , if there exists a  $\pi$ -backdoor admissible set w.r.t.  $\langle \mathcal{G}, \Pi \rangle$ , then  $\mathbf{Z} = \mathbf{A}\mathbf{n}(\{X, Y\}) \cap (\mathbf{P}\mathbf{a}^{\Pi})$  is a  $\pi$ -backdoor admissible set w.r.t.  $\langle \mathcal{G}, \Pi \rangle$ .
As a result, deciding the imitability reduces to testing a d-separation, i.e., whether  $\mathbf{Z}$  defined in Lemma 3.3 d-separates  $X$  and  $Y$  in  $\mathcal{G}_X$ , for which efficient algorithms exist [14, 38]. If this d-separation holds, then  $\pi(X|\mathbf{Z}) = P(X|\mathbf{Z})$  is an optimal imitating policy. Otherwise, the instance is not imitable.
(a)  $\mathcal{G}^{\mathcal{L}}$
(b)  $\mathcal{G}_{\mathbf{w}}^{\mathcal{L}_{\mathbf{w}}},\mathbf{W} = \{Z\} ,\mathbf{w} = \{1\}$
Figure 2: Two examples of context-induced subgraphs (Definition 3.5).
(c)  $\mathcal{G}_{\mathbf{w}}^{\mathcal{L}_{\mathbf{w}}},\mathbf{W} = \{T,Z\} ,\mathbf{w} = \{0,1\}$
It is noteworthy that in practice, it is desirable to choose  $\pi$ -admissible sets with small cardinality for statistical efficiency. Polynomial-time algorithms for finding minimum(-cost) d-separators exist [2, 38].
3.1 Imitability with CSIs
Deciding the imitability when accounting for CSIs is not as straightforward as the classic case discussed earlier. In particular, as we shall see, the existence of  $\pi$ -backdoor admissible sets is not necessary to determine the imitability of  $P(y)$  anymore in the presence of CSIs. In this section, we establish a connection between the classic imitability problem and imitability under CSIs. We begin with a formal definition of imitability in our setting.
Definition 3.4 (Imitability w.r.t.  $\langle \mathcal{G}^{\mathcal{L}},\Pi \rangle$ ). Given an  $LDAG\mathcal{G}^{\mathcal{L}}$  and a policy space  $\Pi$ , let  $Y$  be an arbitrary variable in  $\mathcal{G}^{\mathcal{L}}$ .  $P(y)$  is called imitable w.r.t.  $\langle \mathcal{G}^{\mathcal{L}},\Pi \rangle$  if for any  $M\in \mathcal{M}_{\langle \mathcal{G}^{\mathcal{L}}\rangle}$ , there exists a policy  $\pi \in \Pi$  uniquely computable from  $P(\mathbf{O})$  such that  $P^{M}(y|do(\pi)) = P^{M}(y)$ .
For an LDAG  $\mathcal{G}^{\mathcal{L}}$ , recall that we defined the set of context variables  $\mathbf{C}(\mathcal{L})$  by Equation (1). The following definition is central in linking the imitability under CSIs to the classic case.
Definition 3.5 (Context-induced subgraph). Given an  $LDAG\mathcal{G}^{\mathcal{L}} = (\mathbf{V},\mathbf{E},\mathcal{L})$ , for a subset  $\mathbf{W}\subseteq$ $\mathbf{C}(\mathcal{L})$  and its realization  $\mathbf{w}\in \mathcal{D}_{\mathbf{W}}$ , we define the context-induced subgraph of  $\mathcal{G}^{\mathcal{L}}$  w.r.t.  $\mathbf{w}$ , denoted by  $\mathcal{G}_{\mathbf{w}}^{\mathcal{L}_{\mathbf{w}}}$ , as the  $LDAG$  obtained from  $\mathcal{G}^{\mathcal{L}}$  by keeping only the labels that are compatible with  $\mathbf{w}^{3}$ , and deleting the edges that are absent given  $\mathbf{W} = \mathbf{w}$ , along with the edges incident to  $\mathbf{W}$ .
Consider the example of Figure 2 for visualization. In the context  $Z = 1$ , the label  $Z = 0$  on the edge  $U \to X$  is discarded, as  $Z = 0$  is not compatible with the context (see Figure 2b.) Note that edges incident to the context variable  $Z$  are also omitted. On the other hand, in the context  $Z = 1$ ,  $T = 0$ , the edge  $X \to Y$  is absent and can be deleted from the corresponding graph (refer to Figure 2c.) Edges incident to both  $T$  and  $Z$  are removed in this case. Equipped with this definition, the following result, the proof of which appears in Appendix A, characterizes a necessary condition for imitability under CSIs.