SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Moritz Willig
Technical University of Darmstadt moritz.willig@cs.tu-darmstadt.de
Matej Zečević
Technical University of Darmstadt matej.zecevic@tu-darmstadt.de
Devendra Singh Dhami
Eindhoven University of Technology*  
Hessian Center for AI (hessian.AI)  
d.s.dhami@tue.nl
Technical University Darmstadt  
Hessian Center for AI (hessian.AI)  
German Research Center for AI (DFKI)  
kersting@cs.tu-darmstadt.de
Structural causal models (SCMs) are a powerful tool for understanding the complex causal relationships that underlie many real-world systems. As these systems grow in size, the number of variables and complexity of interactions between them does, too. Thus, becoming convoluted and difficult to analyze. This is particularly true in the context of machine learning and artificial intelligence, where an ever-increasing amount of data demands for new methods to simplify and compress large scale SCM. While methods for marginalizing and abstracting SCM already exist today, they may destroy the causality of the marginalized model. To alleviate this, we introduce the concept of consolidating causal mechanisms to transform large-scale SCM while preserving consistent interventional behaviour. We show consolidation is a powerful method for simplifying SCM, discuss reduction of computational complexity and give a perspective on generalizing abilities of consolidated SCM.
Even complex real world systems might be modeled using structural causal models (SCM) [Pearl, 2009] and several methods exist for doing so automatically from data [Spirtes et al., 2000, Pearl, 2009, Peters et al., 2017]. While technically reflecting the causal structure of the systems under consideration, SCM might not entail intuitive interpretations to the user. Large scale SCM like, appearing for example in genomics, medical data [Squires et al., 2022, Ribeiro-Dantas et al., 2023] or machine learning [Schölkopf et al., 2021, Berrevoets et al., 2023], may become increasingly complex and thereby less interpretable. Contrary to this, computing average treatment effects might be too uninformative given the specific application, as the complete causal mechanism is compressed into a single number. Ideally a user could express the factors of interest and yield a reduced causal system that isolates the relevant mechanism from the rest of the model.
In contrast to other probabilistic models, SCM model the additional aspect of interventions. Consider for example a row of dominoes and its corresponding causal graph as shown in Figure 1. If the starting stone it tipped over, it will affect the following stones, causing the whole row to fall. Humans usually have a good intuition about predicting the unfolding of such physical systems [Gerstenberg, 2022, Beck and Riggs, 2014, Zhou et al., 2023]. Second to that, it is easy to imagine what would happen, if we were to hold onto a domino stone, that is, intervening actively upon the domino sequence. Alternatively, we can programmatically simulate these systems to reason about their outcomes. A simulator tediously computes and updates positions, rotations and collision states of all objects in
* DSD contributed while being with hessian.AI and TU Darmstadt before joining TU\e.
Figure 1: Consolidation vs. Marginalization. Even simple real-world systems, like this row of dominoes, are composed of numerous intermediate steps. Classical structural causal models require the explicit evaluation of the individual structural equations to respect possible interventions along the computational chain and yield the final value of  $X_{5}$ . The intermediate steps  $(X_{2}, X_{3}, X_{4})$  might be marginalized to obtain a simplified functional representation. Marginalization, however, loses some causal interpretation of the process, as interventions on the marginalized variables can no longer be performed. Consolidation of causal models simplifies the graph structure (compare to Appendix D.1), while respecting interventions on the marginalized variables. Thus, preserving the ability to intervene on the underlying causal mechanisms. (Best viewed in color.)
the system. Depending on the abstraction level of our SCM, computations might be simplified to represent individual stones as binary variables, indicating a stone standing up or getting pushed over. Nonetheless, classical evaluation of simplified SCM is still performed step by step to be able to respect possible interventions on the individual stones. Given that we might only be interested in the outcome. That is, whether or not the last stone will tip over, computing all intermediate steps seems to be a waste of computation, as already noted by Peters and Halpern [2021]. Under these premises, we are interested in preserving the ability to intervene while also being computationally efficient. Classical marginalization [Pearl, 2009, Rubenstein et al., 2017] is of no help to us as it destroys the causal aspect of interventions attached to the variables.
Consolidation vs. Marginalization. By marginalizing we do not only remove variables, but also all associated interventions, destroying the causal mechanisms of the marginalized variables. The insight of this paper, as alluded to in Figure 1 (center), is that there exists an intermediate tier of consolidated models that fill the gap between unaltered SCM and ones with 'classical' marginalization applied. Consolidation simplifies the causal graph by compressing computations of consolidated variables into the equations of compositional variables that are functionally equivalent to the initial model, while still respecting the causal effects of possible interventions. As such consolidation generalizes marginalization in the sense that marginalization can be modeled by consolidating without interventions  $(\mathcal{I} = \emptyset$ ; see Def. 1 and Sec. 3). If questions involve causality, then consolidation necessarily needs to be considered since it can actually handle interventions (all cases where  $\mathcal{I} \neq \emptyset$ ). If causal questions are not of concern, then marginalization can be considered as remaining the 'standard' marginalization procedure. One perspective on our approach is to describe consolidation as 'intervention preserving marginalization'.
Structure and Contributions of this paper. In section two we discuss the foundation of SCM and related work. In section three we formally establish the composition of structural causal equations, partitioned SCM, and finally consolidated SCM. In section four we discuss the possible compression and computational simplifications resulting from consolidating models. We present an applied example for simplifying time series data and in a second example demonstrate how consolidation reveals the policy of a game agent. Finally, in section five, we discuss generalizing abilities of our method and provide a perspective on the broader impact and further research. The technical contributions of this paper are as follows:
- We define causal compositional variables that yield functionally equivalent distributions to SCM under intervention.
- We formalize (partially) consolidated SCM by partitioning SCM under a constraint that guarantees the consistent evaluation with respect to the initial SCM.
- We discuss conditions under which consolidation leads to compressed causal equations.
- We demonstrate consolidation on two examples. First, obtaining a causal model of reduced size and, secondly, revealing the underlying policy of a causal decision making process.
In general we write sets of variables in bold upper-case  $(\mathbf{X})$  and their values in lower-case  $(\mathbf{x})$ . Single variables and their values are written in normal style  $(X, x)$ . Specific elements of a set are indicated by a subscript index  $(X_{i})$ . Probability distributions over a variable  $X$  or a set of variables  $\mathbf{X}$  are denoted by  $\mathrm{P}_X$  and  $\mathrm{P_X}$  respectively. A detailed list of notation can be found in Appendix E.
Structural Causal Models provide a framework to formalize a notion of causality via graphical models [Pearl, 2009]. From a computational perspective, structural equation models (SEM) can be considered instead of SCM [Halpern, 2000, Spirtes et al., 2000]. While focusing on computational aspects of consolidating causal equations, we use Pearl's formalism of SCM. Modeling causal systems using SCM over SEM does not affect our freedom, as Rubenstein et al. [2017] show consistency between both frameworks. Similar to earlier works of Halpern [2000], Beckers and Halpern [2019] and Rubenstein et al. [2017], we do not assume independence of exogenous variables and model SCM with an explicit set of allowed interventions.
Definition 1 A structural causal model is a tuple  $\mathcal{M} = (\mathbf{V},\mathbf{U},\mathbf{F},\mathcal{I},\mathrm{P}_{\mathbf{U}})$  forming a directed acyclic graph  $\mathcal{G}$  over variables  $\mathbf{X} = \{X_{1},\ldots ,X_{K}\}$  taking values in  $\mathcal{X} = \prod_{k\in \{1\dots K\}}\mathcal{X}_k$  subject to a strict partial order  $<  _{\mathbf{X}}$  , where
-  $\mathbf{V} = \{X_1, \ldots, X_N\} \subseteq \mathbf{X}, N \leq K$  is the set of endogenous variables.
-  $\mathbf{U} = \mathbf{X} \setminus \mathbf{V} = \{X_{N+1}, \ldots, X_K\}$  is the set of exogenous variables.
-  $\mathbf{F}$  is the set of deterministic structural equations,  $V_{i} := f_{i}(\mathbf{X}^{\prime})$ , where the parents are  $\mathbf{X}^{\prime} \subseteq \{X_{j} \in \mathbf{X} \mid X_{j} <_{\mathbf{X}} V_{i}\}$ .
-  $\mathcal{I} \subseteq \{\{I_{i,v_i}\}_{i \subseteq \{1..N\}}\}_{\mathbf{v} \in \mathcal{X}}$  where  $v_i$  is the  $i$ -th element of  $\mathbf{v}$ ,  $I_{i,v_i}$  indicates an intervention  $do(X_i = v_i)$  and such that  $\mathbf{J} \subset \mathbf{I} \in \mathcal{I} \to \mathbf{J} \in \mathcal{I}$ .  $\mathbf{I}$  is the set of perfect interventions under consideration. A perfect intervention  $do(V_i = v_i)$  replaces the unintervened  $f_i$  by the constant assignment  $V_i := v_i$ .
-  $\mathrm{P_U}$  is the probability distribution over  $\mathbf{U}$ .
As we focus on computational aspects of SCM, we do not regard exogenous variables to be latent, but rather consider them to take values which are not under control of the causal system itself. As such, their values are not determined via any structural equation. By construction of  $\mathcal{I}$  at most one intervention on any specific variable can be included in any intervention set  $\mathbf{I}$ . The additional constraint enforces that  $\mathcal{I}$  is closed under subsets, i.e. that any subset of any  $\mathbf{I} \in \mathcal{I}$  is also part of  $\mathcal{I}$ . This condition is placed to yield valid intervention sets when partitioning the SCM. Every  $\mathcal{M}$  entails a DAG structure  $\mathcal{G} = (\mathbf{X}, \mathcal{E})$  consisting of vertices  $\mathbf{X}$  and edges  $\mathcal{E}$ , where a directed edge from  $X_{j}$  to  $X_{i}$  exists if  $\exists x_{0}, x_{1} \in \mathcal{X}_{j}$ .  $f_{i}(\mathbf{x}', x_{0}) \neq f_{i}(\mathbf{x}', x_{1})$ . For every variable  $X_{i}$  we define  $\mathrm{ch}(X_{i})$ ,  $\mathrm{pa}(X_{i})$  and  $\mathrm{an}(X_{i})$  as the set of direct children, direct parents and ancestors respectively, according to  $\mathcal{G}$ . Additionally, every  $\mathcal{M}$  entails an observational distribution  $\mathrm{P}_{\mathcal{M}}^{3}$  by propagating  $\mathrm{P_U}$  through the structural equations. Any perfect intervention  $I$  on a variable  $X_{i}$  replaces  $f_{i}$  with a new probability distribution  $\mathrm{P}_I$ . As a consequence  $\mathcal{M}$  entails infinitely many intervened distributions  $\mathrm{P}_{\mathcal{M}}^{\mathbf{I}}$ .
Related Work. Several works acknowledge the need for model simplification when working with causal models at different levels of modeling detail or finding consistent mappings between two already existing causal models [Rubenstein et al., 2017, Chalupka et al., 2016, Beckers et al., 2020, Zennaro et al., 2023, Brehmer et al., 2022]. However, whenever providing explicit methods of mapping SCM, marginalization is considered as a tool of removing variables. Several other works have been dedicated to proving consistency and identifiability results for grouping or clustering variables in general [Anand et al., 2022, Squires et al., 2022]. Works on  $\tau$  abstractions by [Beckers and Halpern, 2019, Beckers et al., 2020] focus on simplifying models by mapping between SEM of different levels of abstractions. With regard to computational aspects, Rubenstein et al. [2017]
2We define  $\operatorname {ch}(\mathbf{X})$  ,  $\mathrm{pa}(\mathbf{X})$  and  $\mathrm{an}(\mathbf{X})$  for sets of variables  $\mathbf{X}$  , as the union of sets gained by individual variable evaluations, e.g.,  $\mathrm{pa}(\mathbf{X}) = \bigcup_{X\in \mathbf{X}}\mathrm{pa}(X)$
3We always reference a distribution with respect to some SCM  $\mathcal{M}$ , therefore, if we write  $\mathrm{P}_{\mathcal{M}}$  then this the distribution over the full variable set, that is,  $\mathrm{P_X}$ .
demonstrate the causal consistency of SEM, providing simplifications results for marginalizing SEM. However, their theorems (cf. Sec.5) explicitly exclude interventions on the marginalized variables.
3 Consolidation of Causal Graphical Structures
In this section, we present an approach to consolidating structural equation systems under intervention. This is the key contribution of this work compared to previous works that only considered marginalization of unintervened subsystems [Pearl, 2009, Peters et al., 2017, Rubenstein et al., 2017]. The focus is on computational aspects of marginalizing intermediate variables while preserving effects of interventions. A formalization of marginalizing intervenable structural equation systems is introduced in this section. Section 4 examines conditions under which consolidation leads to an actual reduction in complexity, followed by two practical examples.
We start with the definition of a Causal Compositional Variable (CCV) that has similar semantics to cluster DAGs [Anand et al., 2022], in that both capture the causal semantics over a set of variables. In contrast to cluster DAGs, CCVs are defined over an SCM  $\mathcal{M}$  and moreover expose an interface for explicitly applying interventions to the individual variables inside the CCV. We define a CCV with a corresponding function  $\rho$ , that takes the exogenous variables  $\mathbf{U}$  as its input and outputs the values of a subset  $\mathbf{E} \subseteq \mathbf{V}$ . Thus we write  $\rho_{\mathbf{E}}$  to denote the set of computed variables. To be able to condition on interventions,  $\rho$  takes the set of interventions  $\mathbf{I}$  as it would be applied to the SCM as its second argument.
Definition 2 (Causal Compositional Variable) A variable  $X_{\mathbf{E}}^{\mathbf{I}} \coloneqq \rho_{\mathbf{E}}(\mathbf{U}, \mathbf{I}) \in \mathcal{X}^{|\mathbf{E}|4}$  is a causal compositional variable over some subset  $\mathbf{E} \subseteq \mathbf{V}$  of an SCM  $\mathcal{M}$ , if a consolidation function  $\rho_{\mathbf{E}}: (\mathcal{X}^{|\mathbf{U}|}, \mathcal{I}) \to \mathcal{X}^{|\mathbf{E}|}$  exists for which  $\mathrm{P}_{X_{\mathbf{E}}^{\mathbf{I}}} = \mathrm{P}_{\mathbf{E}}^{\mathbf{I}}$  for all  $\mathbf{I} \in \mathcal{I}$ , where  $\mathrm{P}_{\mathbf{E}}^{\mathbf{I}}$  is the distribution of target variables  $\mathbf{E}$  in under some intervention set  $\mathbf{I}$ .
Put in simple terms,  $\rho_{\mathbf{E}}$  yields the same values for  $\mathbf{E}$  as would be determined by evaluation of the initial SCM  $\mathcal{M}$  given any  $\mathbf{u} \sim \mathrm{P}_{\mathbf{U}}$ . Naturally, there always exists such a function  $\rho_{\mathbf{E}}$  for every  $\mathbf{E} \subseteq \mathbf{V}$ , which is computing  $\mathbf{e} \in \mathbf{E}$  via evaluation of  $\mathcal{M}$  itself. However,  $\rho_{\mathbf{E}}$  is not required to adhere to the computation sequence imposed by the structural causal model  $\mathcal{M}$ . In particular,  $\rho_{\mathbf{E}}$  is not required to explicitly compute the intermediate values of any  $V_i \in \mathbf{V} \setminus \mathbf{E}$ , which gives way to simplifying internal computations. As such a CCV serves as a possible stand-in for replacing whole SCM by a function of possibly simpler computational complexity:
Definition 3 (Consolidated SCM) Given a causal compositional variable  $X_{\mathbf{E}}^{\mathbf{I}} \coloneqq \rho_{\mathbf{E}}(\mathbf{U}, \mathbf{I})$  and some base SCM  $\mathcal{M}$ , we call  $\mathcal{M}_{\mathbf{E}} = (\mathbf{E}, \mathbf{U}_{\mathcal{M}}, \rho_{\mathbf{E}}, \mathcal{I}_{\mathcal{M}}, \mathrm{P}_{\mathbf{U}_{\mathcal{M}}})$  a consolidated SCM.
The distributions of the consolidated SCM  $\mathrm{P}_{\mathcal{M}_{\mathbf{E}}}$  are not equal to that of the initial SCM  $\mathrm{P}_{\mathcal{M}}$ , since  $\mathcal{M}_{\mathbf{E}}$  only computes a subset  $\mathbf{E} \subseteq \mathbf{V}$  of all endogenous variables. However, for that subset  $\mathbf{E}$ , the initial SCM and consolidated model yield the same  $\mathrm{P}_{\mathbf{E}}^{\mathbf{I}}$  for all  $\mathbf{I} \in \mathcal{I}$ .
3.1 Partition of Structural Causal Models
So far, we considered constructing compositional variables from SCM such that they exhibit functional equivalent behaviour and, by doing so, are able to replace base SCM by consolidated SCMs using CCVs. However, compositional variables trade off the 'semantic' graph structure of a classical SCM against a computationally simpler (refer to Sec. 4), but 'black box' function. In practice we might, therefore, only want to replace certain parts of an SCM with consolidated functions. To achieve this goal, we formalize a partition of base SCM into multiple sub SCM. Multiple other works have considered the existence of joint variable clusters within SCM [Anand et al., 2022, Squires et al., 2022]. However, allowing for arbitrary clusters may induce cycles to the model, which would be undesirable. In our work we constrain the clustering by requiring partitions that enforce acyclicity and, therefore, ensure a well defined evaluation order that is consistent with that of the initial SCM.
Endogenous nodes of a base SCM  $\mathcal{M}$  can be partitioned into  $L$  mutually exclusive exhaustive components  $\mathcal{A} = \{\mathbf{A}_i\in \mathcal{P}(\mathbf{V})\setminus \emptyset :i\in \{1,\ldots ,L\} \}$  with  $\forall \mathbf{A}_i,\mathbf{A}_j\in \mathcal{A}:i\neq j\Rightarrow \mathbf{A}_i\cap \mathbf{A}_j = \emptyset$  and  $\bigcup_{i\in \{1\dots L\}}\mathbf{A}_i = \mathbf{V}$ . We also call  $\mathcal{A}$  the (exhaustive) partition. We can use any cluster  $\mathbf{A}\in \mathcal{A}$  to
4To be precise  $\mathcal{X}^{|\mathbf{E}|} = \prod_{V_i\in \mathbf{E}}\mathcal{X}_i$  , where  $\prod$  is the n-ary Cartesian product.
Figure 2: Consolidating SCMs. (Left) The base graph of an exemplary SCM  $\mathcal{M}$  gets deconstructed into three sub SCM using the partition set  $\mathcal{A} = \{\{A\}, \{B, D\}, \{C, E\}\}$ . Exogenous variables are displayed with dashed circles. (Center) A subgraph  $\mathcal{G}'$  within a larger base SCM. There exists a directed path that exits and re-enters  $\mathcal{G}'$ , thus preventing self-enclosed evaluation of  $\mathcal{G}'$ . (Right) Consolidation of a sub SCM into a multivariate compositional variable.  $X_2$  is an aspect variable chosen by the user,  $(X_2 \in \mathbf{E})$ .  $X_4$  and  $X_5$  are needed for further computation, thus  $\mathbf{E}' = \{X_2, X_4, X_5\}$ . The value of  $X_2$  is computed via  $\rho_{\mathbf{E}'}$  and interventions can be performed via its parameter  $\mathbf{I}$ . The dotted line indicates that  $X_2$  is not an 'independent' variable. Specifically it is not allowed to intervene on  $X_2$  via 'edge cutting', making it independent of  $\rho_{\mathbf{E}'}$  (and in consequence causing  $\rho_{\mathbf{E}'}$  to compute inconsistent values for  $X_6$  and  $X_7$ ).
form a new sub SCM  $\mathcal{M}_{\mathbf{A}}$ :  $\mathcal{M}_{\mathbf{A}} = (\mathbf{A}, \mathbf{U}_{\mathbf{A}}, \mathbf{F}_{\mathbf{A}}, \mathcal{I}_{\mathbf{A}}, \mathbf{P}_{\mathbf{U}_{\mathbf{A}}})$  where  $\mathbf{U}_{\mathbf{A}} = \mathrm{pa}(\mathbf{A}) \setminus \mathbf{A}$ ,  $\mathbf{F}_{\mathbf{A}}$  are the structural equations of  $\mathbf{A}$ , and  $\mathbf{P}_{\mathbf{U}_{\mathbf{A}}}$  is the distribution over  $\mathbf{U}_{\mathbf{A}}$  induced by the base SCM. As some intervention  $\mathbf{I} \in \mathcal{I}$  might intervene on variables which are no longer part of  $\mathcal{M}_{\mathbf{A}}$ , we define a mapping  $\psi_{\mathbf{A}}: \mathbf{I} \to \mathbf{I}_{\mathbf{A}}$  which removes those invalid interventions:  $\psi_{\mathbf{A}}(\mathbf{I}) := \{do(V_i = v_i) : \mathbf{I} : V_i \in \mathbf{V}_{\mathbf{A}}\}$ . Consequently, we define  $\mathcal{I}_{\mathbf{A}} := \{\psi_{\mathbf{A}}(\mathbf{I}) : \mathbf{I} \in \mathcal{I}\}$ . As expected, whenever a set of interventions  $\mathbf{I}$  does not intervene on any  $V \in \mathbf{A}$ ,  $\psi_{\mathbf{A}}$  maps it to the empty set. For notational brevity, we assume the implicit application of  $\psi$  on any  $\mathbf{I}$  whenever we apply interventions to a sub SCM. Figure 2 (left) presents an exemplary construction of sub SCM from a given partition of a base SCM.
Unconstrained partitions may divide SCM in an arbitrary way. To guarantee an evaluation order of the individual sub SCM that is consistent with that of the base SCM we need to ensure that any particular sub SCM can be evaluated in a continuous, self-enclosed manner. That is, no intermediate evaluation of external nodes,  $V \notin \mathbf{A}$ , is required. Figure 2 (center) illustrates a counter-example of a non-complying partition where an intermediate external evaluation to  $G'$  is required. To prevent such cases we require the partitions to yield a strict partial ordering under the following definition: the binary relation  $\mathbf{A}_1 \mathbf{R}_{\mathbf{X}} \mathbf{A}_2 \Longleftrightarrow \exists A_i \in \mathbf{A}_1, A_j \in \mathbf{A}_2 : A_i <_{\mathbf{X}} A_j$  holds if at least one variable in  $\mathbf{A}_1$  needs to be evaluated before some other variable in  $\mathbf{A}_2$  according to  $<_{\mathbf{X}}$  of the base SCM. We call a partition  $\mathcal{A}$  "according to  $\mathcal{M}$ " iff  $\mathbf{R}_{\mathbf{X}}$  is a strict partial order over all  $\mathbf{A} \in \mathcal{A}$ .
Definition 4 (Partitioned SCM) Given an exhaustive partition  $\mathcal{A}$ , a partitioned SCM  $\mathcal{M}_{\mathcal{A}}$  for some base SCM  $\mathcal{M}$  is defined as  $\mathcal{M}_{\mathcal{A}} = (\bigcup \mathbf{A}_i, \bigcup \mathbf{U}_{\mathbf{A}_i}, \bigcup \mathbf{F}_{\mathbf{A}_i}, \bigcup \mathcal{I}_{\mathbf{A}_i}, \bigcup \mathrm{P}_{\mathbf{U}_{\mathbf{A}_i}}), i \in \{1, \ldots, L\}$ . s.t. there exists a strict partial order  $R_{\mathbf{X}}$  over all  $\mathbf{A}_i \in \mathcal{A}$  according to  $\mathcal{M}$  and every  $\mathcal{M}_{\mathbf{A}_i} = (\mathbf{A}_i, \mathbf{U}_{\mathbf{A}_i}, \mathbf{F}_{\mathbf{A}_i}, \mathcal{I}_{\mathbf{A}_i}, \mathrm{P}_{\mathbf{U}_{\mathbf{A}_i}})$  forms a valid sub SCM.