# Weakly supervised causal representation learning

Johann Brehmer
Qualcomm AI Research
<EMAIL_ADDRESS>
QUVA Lab, University of Amsterdam&Pim de Haan∗
Qualcomm AI Research†
QUVA Lab, University of Amsterdam
<EMAIL_ADDRESS>Lippe
QUVA Lab, University of Amsterdam
<EMAIL_ADDRESS>Cohen
Qualcomm AI Research†
<EMAIL_ADDRESS>
QUVA Lab, University of Amsterdam Equal contributionQualcomm AI Research is an
initiative of Qualcomm Technologies, Inc.

###### Abstract

Learning high-level causal representations together with a causal model from
unstructured low-level data such as pixels is impossible from observational
data alone. We prove under mild assumptions that this representation is
however identifiable in a weakly supervised setting. This involves a dataset
with paired samples before and after random, unknown interventions, but no
further labels. We then introduce implicit latent causal models, variational
autoencoders that represent causal variables and causal structure without
having to optimize an explicit discrete graph structure. On simple image data,
including a novel dataset of simulated robotic manipulation, we demonstrate
that such models can reliably identify the causal structure and disentangle
causal variables.

##  1 Introduction

Figure 1: We learn to represent pixels $x$ as causal variables $z$. The bottom
shows the effect of intervening on one variable. We prove that variables and
causal model can be identified from samples $(x,\tilde{x})$.

The dynamics of many systems can be described in terms of some high-level
variables and causal relations between them. Often, these causal variables are
not known but only observed in some unstructured, low-level representation,
such as the pixels of a camera feed. Learning the causal representations
together with the causal structure between them is a challenging problem and
may be important for instance for applications in robotics and autonomous
driving [1]. Without prior assumptions on the data-generating process or
supervision, it is impossible to uniquely identify the causal variables and
their causal structure [2, 3].

In this work, we show that a weak form of supervision is sufficient to
identify both the causal representations and the structural causal model
between them. We consider a setting in which we have access to data pairs,
representing the system before and after a randomly chosen, unknown
intervention while preserving the noise. This may approximate the generative
process of data collected from a video feed of an external agent or
demonstrator interacting with a system. Neither labels on the intervention
targets nor active control of the interventions are necessary for our
identifiability theorem, making this setting useful for offline learning. We
prove that with this form of weak supervision, and under certain assumptions
(including that the interventions are stochastic and perfect and that all
interventions occur in the dataset), latent causal models (LCMs)—structural
causal models (SCMs) together with a decoder from the causal factors to the
data space—are identifiable up to a relabelling and elementwise
reparameterizations of the causal variables.

We then discuss two practical methods for LCM inference. First, we define
explicit latent causal models (ELCMs) as a variational autoencoder (VAE) [4]
in which the causal variables are the latent variables and the prior is based
on an SCM. While this approach works in simple problems, it can be finicky and
is difficult to scale. We trace this to a major challenge in causal
representation learning, namely that it is a chicken-and-egg problem: it can
be difficult to learn the causal variables when the causal graph is not yet
learned, and it is difficult to learn the graph without knowing the variables.

To overcome this optimization difficulty, we introduce a second model class:
implicit latent causal models (ILCMs). These models can represent causal
structure and variables _without_ requiring an explicit, discrete graph
representation, which makes gradient-based optimization easier. Nevertheless,
these models still contain the causal structure implicitly, and we discuss two
algorithms that can extract it after the model is trained. Finally, we
demonstrate ILCMs on synthetic datasets, including the new CausalCircuit
dataset of a robot arm interacting with a causally connected system of light
switches. We show that these models can robustly learn the true causal
variables and the causal structure from pixels.

##  2 Related work

Our work builds on the work of Locatello et al. [5] on _disentangled
representation learning_. The authors introduce a similar weakly supervised
setting where observations are collected before and after unknown
interventions. In contrast to our work, however, they focus on disentangled
representations, i. e. (conditionally) independent factors of variation with a
trivial causal graph, which our work subsumes as a special case. Other
relevant works on disentangled representation learning and (nonlinear)
independent component analysis include Refs. [6, 7, 8, 9, 10, 11, 12].

The problem of _causal representation learning_ has been gaining attention
lately, see the recent review by Schölkopf et al. [1]. Lu et al. [13] learn
causal representations by observing similar causal models in different
environments. von Kügelgen et al. [14] use the weakly supervised setting to
study self-supervised learning, using a known but non-trivial causal graph
between content and style factors. Lippe et al. [15] learn causal
representations from time-series data from labelled interventions, assuming
that causal effects are not instantaneous but can be temporally resolved. Yang
et al. [16] propose to train a VAE with an SCM prior, but require the true
causal variables as labels. Other relevant works include Refs. [17, 18, 19,
20, 21]. To the best of our knowledge, our work is the first to provide
identifiability guarantees for arbitrary, unknown causal graphs in this weakly
supervised setting.

##  3 Identifiability of latent causal models from weak supervision

In this section, we show theoretically that causal variables and causal
mechanisms are identifiable from weak supervision. In Sec. 4 we will then
demonstrate how we can learn causal models in practice by training a causally
structured VAE.

###  3.1 Setup

We begin by defining latent causal models and the weakly supervised setting.
Here, we only provide informal definitions and assume familiarity with common
concepts from causality as introduced for instance in Ref. [22]. We provide a
complete and precise treatment in Appendix A.1 and discuss limitations of our
setup and possible generalizations in Appendix B.

We describe the causal structure between latent variables as a Structural
Causal Model (SCM). An SCM $\mathcal{C}$ describes the relation between causal
variables $z_{1},\dots,z_{n}$ with domains $\mathcal{Z}_{i}$ and noise
variables $\epsilon_{1},\dots,\epsilon_{n}$ with domains $\mathcal{E}_{i}$
along a directed acyclic graph (DAG) $\mathcal{G}(\mathcal{C})$. Causal
mechanisms
${f_{i}:\mathcal{E}_{i}\times\prod_{j\in\mathrm{\mathbf{pa}}_{i}}\mathcal{Z}_{j}\to\mathcal{Z}_{i}}$
describe how the value of a causal variable is determined from the associated
noise variables, as well as the values of its parents in the graph. Finally,
an SCM includes a probability measure for the noise variables.

Figure 2: In LCM $\mathcal{M}$, $z_{i}$ denotes whether the $i$-th stone from
the front is standing. Intervening on the second variable, $z_{2}$, leads to
$\tilde{z}$. The decoder $g$ renders $z,\tilde{z}$ as images $x,\tilde{x}$.
LCM $\mathcal{M}^{\prime}$ has an equivalent representation in which
$z^{\prime}_{i}$ denotes whether the $i$-th stone from the _back_ has
_fallen_. In Thm. 1, we prove that if and only if two causal models have the
same pixel distribution $p(x,\tilde{x})$, there exists an LCM isomorphism
$\varphi$: an element-wise reparameterization of the causal variables plus a
permutation of the ordering that commutes with interventions and causal
mechanisms.

An SCM entails a unique solution $s:\mathcal{E}\to\mathcal{Z}$ defined by
successively applying the causal mechanisms. We require the causal mechanisms
to be pointwise diffeomorphic, that is, for any value of the parents
$z_{\mathrm{\mathbf{pa}}_{i}}$ we have that
$f_{i}(\cdot;z_{\mathrm{\mathbf{pa}}_{i}})$ is invertible, differentiable, and
its inverse is differentiable.111Under some mild smoothness assumptions, any
SCM can be brought into this form by elementwise redefinitions of the
variables, preserving the observational and interventional distributions, but
not the weakly supervised / counterfactual distribution. Then $s$ is also
diffeomorphic and thus noise variables can be uniquely inferred from causal
variables. This simplifies the weakly supervised distribution, as the only
stochasticity comes from the noise variables and the intervention. The SCM
also entails an observational distribution $p_{\mathcal{C}}(z)$ (Markov with
respect to the graph of the SCM), which is the pushforward of
$p_{\mathcal{E}}$ through the solution.

A perfect, stochastic intervention $(I,(\tilde{f}_{i})_{i\in I})$ modifies an
SCM by replacing for a subset of the causal variables, called the intervention
target set $I\subset\\{1,...,n\\}$, the causal mechanism $f_{i}$ with a new
mechanism $\tilde{f}_{i}:\mathcal{E}_{i}\to\mathcal{Z}_{i}$, which does not
depend on the parents. The intervened SCM has a new solution
$\tilde{s}_{I}:\mathcal{E}\to\mathcal{Z}$. We call interventions atomic if the
number of targeted variables is one or zero.

We will reason about generative models in a data space $\mathcal{X}$, in which
the causal structure is latent. Also including a distribution of interventions
(as in Ref. [23]), we define LCMs:

######  Definition 1 (Latent causal model (LCM)).

A latent causal model
$\mathcal{M}=\langle\mathcal{C},\mathcal{X},g,\mathcal{I},p_{\mathcal{I}}\rangle$
consists of

  * •

an acyclic SCM $\mathcal{C}$, which is faithful (all independencies are
encoded in its graph [24]),

  * •

an observation space $\mathcal{X}$,

  * •

a decoder $g:\mathcal{Z}\to\mathcal{X}$ that is diffeomorphic onto its image,

  * •

a set $\mathcal{I}$ of interventions on $\mathcal{C}$, and

  * •

a probability measure $p_{\mathcal{I}}$ over $\mathcal{I}$.

We define two LCMs as equivalent if all of their components are equal up to a
permutation of the causal variables and elementwise diffeomorphic
reparameterizations of each variable, see Fig. 2.

######  Definition 2 (LCM isomorphism (informal)).

Let
$\mathcal{M}=\langle\mathcal{C},\mathcal{X},g,\mathcal{I},p_{\mathcal{I}}\rangle$
and
$\mathcal{M}^{\prime}=\langle\mathcal{C}^{\prime},\mathcal{X},g^{\prime},\mathcal{I}^{\prime},p^{\prime}_{\mathcal{I}^{\prime}}\rangle$
be two LCMs with identical observation space. An LCM isomorphism between them
is a graph isomorphism
$\psi:\mathcal{G}(\mathcal{C})\to\mathcal{G}(\mathcal{C}^{\prime})$ together
with elementwise diffeomorphisms for noise and causal variables that tell us
how to reparameterize them, such that the structure functions, noise
distributions, decoder, intervention set, and intervention distribution of
${\mathcal{M}^{\prime}}$ are compatible with the corresponding elements of
$\mathcal{M}$ reparameterized through the graph isomorphism and elementwise
diffeomorphisms. $\mathcal{M}$ and $\mathcal{M}^{\prime}$ are equivalent,
$\mathcal{M}\sim\mathcal{M}^{\prime}$, if and only if there is an LCM
isomorphism between them.

Following Locatello et al. [5], we define a generative process of pre- and
post-interventional data:222This construction is closely related to twinned
SCMs [25, Def. 2.17], typically used to compute counterfactual queries
$p(\tilde{z}_{\setminus I}|z,\tilde{z}_{I})$. We instead focus on the joint
distribution of pre-intervention and post-intervention data.

######  Definition 3 (Weakly supervised generative process).

Consider an LCM $\mathcal{M}$ where the underlying SCM has continuous noise
spaces $\mathcal{E}_{i}$, independent probabilities $p_{\mathcal{E}_{i}}$, and
admits a solution $s$. We define the weakly supervised generative process of
data pairs $(x,\tilde{x})\sim p_{\mathcal{M}}^{\mathcal{X}}(x,\tilde{x})$ as
follows:

$\displaystyle\epsilon$ $\displaystyle\sim p_{\mathcal{E}}\,,$ $\displaystyle
z$ $\displaystyle=s(\epsilon)\,,$ $\displaystyle x$ $\displaystyle=g(z)\,,$
$\displaystyle I$ $\displaystyle\sim p_{\mathcal{I}}\,,$ $\displaystyle\forall
i\in I\,,\,\tilde{\epsilon}_{i}$ $\displaystyle\sim
p_{\tilde{\mathcal{E}}_{i}}\,,$ $\displaystyle\forall i\not\in
I\,,\,\tilde{\epsilon}_{i}$ $\displaystyle=\epsilon_{i}\,,$
$\displaystyle\tilde{z}$ $\displaystyle=\tilde{s}_{I}(\tilde{\epsilon})\,,$
$\displaystyle\tilde{x}$ $\displaystyle=g(\tilde{z})\,.$ (1)

###  3.2 Identifiability result

The main theoretical result of this paper is that an LCM $\mathcal{M}$ can be
identified from $p(x,\tilde{x})$ up to a relabeling and elementwise
transformations of the causal variables:

######  Theorem 1 (Identifiability of $\mathbb{R}$-valued LCMs from weak
supervision).

Let
$\mathcal{M}=\langle\mathcal{C},\mathcal{X},g,\mathcal{I},p_{\mathcal{I}}\rangle$
and
$\mathcal{M}^{\prime}=\langle\mathcal{C}^{\prime},\mathcal{X},g^{\prime},\mathcal{I}^{\prime},p^{\prime}_{\mathcal{I}^{\prime}}\rangle$
be LCMs with the following properties:

  * •

The LCMs have an identical observation space $\mathcal{X}$.

  * •

The SCMs $\mathcal{C}$ and $\mathcal{C}^{\prime}$ both consist of $n$ real-
valued endogeneous causal variables and corresponding exogenous noise
variables, i. e.
$\mathcal{E}_{i}=\mathcal{Z}_{i}=\mathcal{Z}^{\prime}_{i}=\mathcal{E}^{\prime}_{i}=\mathbb{R}$.

  * •

The intervention sets $\mathcal{I}$ and $\mathcal{I}^{\prime}$ consist of all
atomic, perfect interventions,
$\mathcal{I}=\\{\emptyset,\\{z_{0}\\},\dots,\\{z_{n}\\}\\}$ and similar for
$\mathcal{I}^{\prime}$.

  * •

The intervention distribution $p_{\mathcal{I}}$ and
$p^{\prime}_{\mathcal{I}^{\prime}}$ have full support.

Then the following two statements are equivalent:

  1. 1.

The LCMs entail equal weakly supervised distributions,
$p_{\mathcal{M}}^{\mathcal{X}}(x,\tilde{x})~{}=~{}p_{\mathcal{M}^{\prime}}^{\mathcal{X}}(x,\tilde{x})$.

  2. 2.

The LCMs are equivalent in the sense of Def. 2,
$\mathcal{M}\sim\mathcal{M}^{\prime}$.

Let us summarize the key steps of our proof, which we provide in its entirety
in Appendix A.2. The direction $2\Rightarrow 1$ follows from the definition of
equivalence. The direction $1\Rightarrow 2$ is proven constructively along the
following steps:

  1. 1.

We begin by defining a diffeomorphism $\varphi=g^{\prime-1}\circ
g:\mathcal{Z}\to\mathcal{Z}^{\prime}$ and note that if $z,\tilde{z}\sim
p_{\mathcal{C}}^{\mathcal{Z}}(z,\tilde{z})$, the weakly supervised
distribution of causal variables of model $\mathcal{C}$, then
$\varphi(z),\varphi(\tilde{z})\sim
p_{\mathcal{C}^{\prime}}^{\mathcal{Z}^{\prime}}(z^{\prime},\tilde{z}^{\prime})$.
The distribution over $z,\tilde{z}$ is a mixture, where each intervention
target $I$ gives a mixture component; each component is supported on a
different $(n+1)$-dimensional submanifold. Therefore, there exists a bijection
between the components $\psi:[n]\to[n]$ that maps intervention targets $I$ in
$\mathcal{M}$ to intervention targets $I^{\prime}=\psi(I)$ in
$\mathcal{M}^{\prime}$. Furthermore, because the joint distribution
$z,\tilde{z}$ is preserved by $\varphi$, first mapping with $\varphi$, then
intervening,
$\mathcal{Z}\xrightarrow[]{\varphi}\mathcal{Z}^{\prime}\xrightarrow[]{I^{\prime}}\widetilde{\mathcal{Z}}^{\prime}$,
equals
$\mathcal{Z}\xrightarrow{I}\widetilde{\mathcal{Z}}\xrightarrow{\varphi}\widetilde{\mathcal{Z}}^{\prime}$.

  2. 2.

Because $I=\\{i\\}$ is a perfect intervention, for the map
$\mathcal{Z}\xrightarrow[]{\varphi}\mathcal{Z}^{\prime}\xrightarrow[]{I^{\prime}}\widetilde{\mathcal{Z}}^{\prime}$,
$\tilde{z}^{\prime}_{i^{\prime}}$ is independent of $z^{\prime}$. Thus, in
both maps, $\tilde{z}^{\prime}_{i^{\prime}}$ is independent of $z$. This means
that for the path through $\widetilde{\mathcal{Z}}$, the intervention sample
$\tilde{z}_{i}$ is transformed into $\tilde{z}^{\prime}_{i^{\prime}}$
independently of $z$. For $\mathbb{R}$-valued variables, this statistical
independence implies that the transformation is constant in $z$, and thus
$\varphi(z)_{i^{\prime}}$ is constant in $z_{j}$ for $j\neq i$. $\varphi$ is
therefore an elementwise reparametrization.

  3. 3.

Using this, we can show that $\psi$ is a causal graph isomorphism and that it
is compatible with the causal mechanisms. This proves LCM equivalence
$\mathcal{M}\sim\mathcal{M}^{\prime}$.

##  4 Practical latent causal models

Theorem 1 means that it is possible to learn causal structure from pixel-level
data in the weakly supervised setting. Consider a system that is described by
an unknown true LCM and assume that we have access to data pairs
$(x,\tilde{x})$ sampled from its probability density. Then we can train
another LCM with learnable components by maximum likelihood. Assuming
sufficient data and perfect optimization, this model’s density will match that
of the ground-truth LCM. Our identifiability result guarantees that the
trained LCM then has the same causal variables and causal structure as the
ground truth, up to relabelling.

In the following, we describe two neural LCM implementations that can be
trained on data.

###  4.1 Explicit latent causal models (ELCMs)

To implement LCMs with neural networks, we use the variational autoencoder
(VAE) framework [4]. We first consider an approach where the causal variables
$(z,\tilde{z})$ are the latent variables. Data $(x,\tilde{x})$ and latents
$(z,\tilde{z})$ are linked by a stochastic encoder $q(z|x)$ and decoder
$p(x|z)$; unlike the deterministic decoder from Sec. 3 this allows us to map
high-dimensional data spaces (like images) to low-dimensional causal
variables. The causal structure is encoded in the prior $p(z,\tilde{z})$ and
consists of a learnable causal graph and learnable causal mechanisms $f_{i}$.
The first contribution to the prior density is the observational probability
density $p(z)$, which factorizes according to the causal graph into components
$p(z_{i}|z_{\mathrm{\mathbf{pa}}_{i}})$, which are given by fixed base
densities and the causal mechanisms. The second contribution is the
interventional conditional density $p(\tilde{z}|z)$, which is also computable
from the graph and causal mechanisms. The model can be trained on the ELBO
loss, a variational bound on $-\log p(x,\tilde{x})$. For more details, see
Appendix E.

We call this an _explicit latent causal model_ (ELCM), as the model directly
parameterizes all components of an LCM. In particular, ELCMs contain an
explicit representation of the causal graph and causal mechanisms. The graph
can be learned by an exhaustive search over all DAGs or through a
differentiable DAG parameterization [26, 27, 28, 29] and gradient descent.

In our experiments with ELCMs, which we describe in Appendix E, we find that
optimally trained ELCMs indeed correctly identify the causal structure and
disentangle causal variables on simple datasets. However, jointly learning
explicit graph and variable representations presents a challenging
optimization problem. In particular, we observe that the loss landscape has
local minima corresponding to wrong graph configurations.

###  4.2 Implicit latent causal models (ILCMs)

Figure 3: ILCM architecture. Pre- and post-intervention data (left) are
encoded to noise encodings and intervention targets, which are then decoded
back to the data space. To compute the prior probability density, the noise
encodings are transformed into causal variables with the neural solution
function.

To enable causal representation learning in a more robust, scalable way, we
propose a second LCM implementation: _Implicit Latent Causal Models_ (ILCMs).
Like ELCMs, ILCMs are also variational autoencoders with a causally structured
prior. The key difference is that ILCMs represent the causal structure through
neural solution functions $s(e)$. Under our assumption of diffeomorphic causal
mechanisms, the solution function—which maps the vector of noise variables to
the causal variables—contains the same information as the causal graph and
causal mechanisms that we parameterize with neural networks in ELCMs (see
Appendix C). However, unlike ELCMs, this parameterization does not require an
explicit graph parameterization. In practice, ILCMs are thus easier to train
than ELCMs.

#### Latents

The latent variables in an ILCMs are _noise encodings_ , defined through the
inverse solution function as $e=s^{-1}(z)$ and $\tilde{e}=s^{-1}(\tilde{z})$.
The pre-intervention noise encoding $e$ is identical to the SCM noise
variables. The post-intervention noise encoding $\tilde{e}$ corresponds to the
value of the SCM noise variables that would have generated the post-
intervention causal variables $\tilde{z}$ under the unintervened SCM
mechanisms. ILCMs contain a stochastic encoder $q(e|x)$ and decoder $p(x|e)$
that map data $(x,\tilde{x})$ to noise encodings $(e,\tilde{e})$.

Noise encodings have the convenient property that under an intervention with
intervention targets $I$, precisely the components $e_{I}$ change value:
$e_{i}\neq\tilde{e}_{i}\Leftrightarrow i\in I$ with probability 1. We prove
this property in Appendix A. This means that from noise encodings
$e,\tilde{e}$, we can infer interventions easily. We use a simple heuristic
intervention encoder that assigns higher intervention probability $q(i\in
I|x,\tilde{x})$ to a component $i$ the more this component of the noise
encoding changes under interventions:

$\log q(i\in I|x,\tilde{x})\sim
h\\!\bigl{(}\mu_{e}(x)_{i}-\mu_{e}(\tilde{x})_{i}\bigr{)}\,,$ (2)

where $\mu_{e}(x)$ is the mean function of the noise encoder $q(e|x)$ and $h$
is a quadratic function with learnable parameters. Both the equality pattern
of $e$ under interventions and this heuristic intervention encoder are similar
to the ones used for disentangled representation learning in Ref. [5].

#### Prior

Given encoders for noise encodings and intervention targets, let us now write
down the prior $p(e,\tilde{e},I)$, which encodes the structure of the weakly
supervised setting. The intervention-target prior $p(I)$ and the pre-
intervention noise distribution $p(e)$ are given by simple base densities,
which we choose as uniform categorical and standard Gaussian, respectively.
The post-intervention noise encodings $\tilde{e}$ follow the conditional
probability distribution

$p(\tilde{e}|e,I)=\prod_{i\notin I}\delta(\tilde{e}_{i}-e_{i})\;\prod_{i\in
I}p(\tilde{e}_{i}|e)=\prod_{i\notin I}\delta(\tilde{e}_{i}-e_{i})\;\prod_{i\in
I}\tilde{p}(\bar{z}_{i})\left|\frac{\partial\bar{z}_{i}}{\partial\tilde{e}_{i}}\right|,\quad\bar{z}_{i}=\bar{s}_{i}(\tilde{e}_{i};e_{\setminus
i}).$ (3)

In the second equality we have parameterized the conditional density
$p(\tilde{e}_{i}|e)$ with a conditional normalizing flow consisting of a
learnable diffeomorphic transformation
$\tilde{e}_{i}\mapsto\bar{z}_{i}=\bar{s}_{i}(\tilde{e}_{i};e_{\setminus i})$
and a base density $\tilde{p}$ on $\bar{z}_{i}$, which we choose as standard
Gaussian.

How does this prior encode causal structure? We rely on three key properties
of SCMs, shown in Appendix A: 1) the noise variables $e_{i}$ are independent
of each other; 2) upon intervening on variable $i$, the post-intervention
causal variable $\tilde{z}_{i}$ are independent of all $e_{j}$; 3) while for
the other variables $j\neq i$, the noise encodings are unchanged
$\tilde{e}_{j}=e_{j}$. These three properties are ensured in the ILCM prior in
Eq. (3). We show in Appendix C that therefore each ILCM is equivalent to a
unique ELCM. For each variable $i$, the ILCM function $\bar{s}_{i}$ is equal
to the solution function $s_{i}$ of the equivalent ELCM, which maps from noise
variables to causal variable $z_{i}$.

Thus, by learning to transform $\tilde{e}_{i}$ into
$\tilde{z}_{i}=\bar{s}(\tilde{e}_{i};e)$ in the ILCM, we learn the solution
function of the corresponding ELCM. This implicitly describes both the causal
graph and the causal mechanisms $f_{i}$. We can thus learn a causal model
without ever explicitly modelling a graph.333The solution function of an ELCM
only depends on ancestors in the graph. The learned transformation
$s_{i}(e_{i};e_{\setminus i})$ of an ILCM should thus also depend only on
ancestors of $i$. As each $s_{i}$ is constructed to be a diffeomorphism in its
first argument, jointly they have a triangular structure and thus a
diffeomorphism $s:e\mapsto z$. In practice, however, the learned solution
functions may still depend weakly on non-ancestors. Therefore, to ensure that
$s$ always forms a diffeomorphism, at some point in training, we test
functional dependence to infer ancestral dependence, pick a topological
ordering of variables conforming to the ancestry, and parameterize the
solution functions $s_{i}$ to only depend on earlier variables in the
ordering.

The final question is how to implement the first terms in Eq. (3), which
encode that those noise encodings that are not part of the intervention
targets $I$ should not change value under the intervention. We enforce this in
the encoder by setting the non-intervention components of $e$ and $\tilde{e}$
to the same value [similar to 5]. In Appendix C this procedure is described in
more detail. We will refer to this projective noise encoder as
$q(e,\tilde{e}|x,\tilde{x},I)$.

#### Learning

Putting everything together, an ILCM consists of an intervention encoder
$q(I|x,\tilde{x})$, a noise encoder $q(e,\tilde{e}|x,\tilde{x},I)$, a noise
decoder $p(x|e)$, and transformations / solution functions $s_{i}(\cdot;e)$,
see Fig. 3. All of these components are implemented with neural networks and
learnable, see Appendix C for details. The lower bound on the joint log
likelihood of pre-intervention and post-intervention data is given by

$\log p(x,\tilde{x})\geq\mathbb{E}_{I\sim
q(I|x,\tilde{x})}\mathbb{E}_{e,\tilde{e}\sim
q(e,\tilde{e}|x,\tilde{x},I)}\biggl{[}\log p(I)+\log p(e)+\log
p(\tilde{e}|e,I)\\\ -\log q(I|x,\tilde{x})-\log
q(e,\tilde{e}|x,\tilde{x},I)+\log p(x|e)+\log
p(\tilde{x}|\tilde{e})\biggr{]}\,.$ (4)

The model is trained by minimizing the corresponding VAE loss, learning to map
low-level data to noise variables (with $q$) and to map noise variables to
causal variables (with $s$). The expectation over $I$ is computed via
summation, but could alternatively be done with sampling.

In practice, we find it beneficial to add a regularization term to the loss
that disincentivizes collapse to a lower-dimensional submanifold of the latent
space. For each batch of training data, we compute the batch-aggregate
intervention posterior
$q_{I}(I)=\mathbb{E}_{x,\tilde{x}\in\text{batch}}[q(I|x,\tilde{x})]$. To the
beta-VAE loss we then add the negative entropy of this distribution, weighted
with a hyperparameter.

#### Downstream tasks

Despite the implicit representation of causal structure, we argue that ILCMs
let us solve various tasks:

  * •

_Causal representation learning / disentanglement_ : ILCMs allow us to map
low-level data $x$ to causal variables $z$ by applying the encoder $q$
followed by the solution functions $s$.

  * •

_Intervention inference_ : It is also straightforward to infer intervention
targets from an observed pair $(x,\tilde{x})$ of pre-intervention and post-
intervention data, as this just requires evaluating the intervention-target
encoder $q_{I}(x,\tilde{x})$.

  * •

_Causal discovery / identification_ : We propose two methods to infer the
causal graphs after training an ILCM. One is to use an off-the-shelf method
for causal discovery on the learned representations. Since the ILCM allows us
to infer intervention targets, we can use intervention-based algorithms. In
this paper, we use ENCO [28], a recent differentiable causal discovery method
that exploits interventions to obtain acyclic graphs without requiring
constrained optimization. Alternatives to ENCO include DCDI [27] and GIES
[30].

Alternatively, we can analyze the causal structure implicitly represented in
the learned solution functions $s_{i}$. We propose a heuristic algorithm that
proceeds in three steps. First, it infers the topological order by sorting
variables such that $s_{i}$ only depends on $e_{j}$ if $z_{i}$ is after
$z_{j}$ in the topological order. It then iteratively rewrites the solution
functions such that they only depend on ancestors in the topological order.
Finally, it determines which causal ancestors are direct parents by testing
the functional dependence of the causal mechanisms. We describe this algorithm
in more detail in Appendix C.

  * •

_Generation of interventions and counterfactuals_ : The ILCM entails a
generative model for pairs of pre- and post-intervention data. It is
straightforward to sample from the joint distribution $p(x,\tilde{x},I)$, from
the conditional $p(x,\tilde{x}|I)$, or from the conditional
$p(\tilde{x}|x,I)$.

##  5 Experiments

Finally, we demonstrate latent causal models in practice. Here we focus on
implicit LCMs; explicit LCMs are demonstrated in similar experiments in
Appendix E. We evaluate the causal graphs learned by the ILCM models either
with ENCO (ILCM-E) or with the heuristic algorithm described above (ILCM-H).

#### Baselines

Since we are to the best of our knowledge the first to study causal
representation learning in this weakly supervised setting, we are not aware of
any baseline methods designed for this task. We nevertheless compare ILCMs to
three other methods. First, we define a _disentanglement VAE_ that models the
weakly supervised process, but assumes independent factors of variation rather
than a non-trivial causal structure between the variables. This baseline is
similar to the method proposed by Ref. [5], but it differs in some
implementation details to be more comparable to our ILCM setup. We infer the
causal graph between the learned representations with ENCO (dVAE-E). We also
compare to an unstructured $\beta$-VAE that treats $x$ and $\tilde{x}$ as i.
i. d. and uses a standard Gaussian prior. Finally, for the pixel-level data,
we consider a slot attention model [31], which segments the image
unsupervisedly into as many objects as there are causal variables. The latent
representation associated to each object is considered a learned causal
variable.

###  5.1 2D toy experiment

We first demonstrate LCMs in a pedagogical toy experiment with
$\mathcal{X}=\mathcal{Z}=\mathbb{R}^{2}$. Training data is generated from a
nonlinear SCM with the graph $z_{1}\to z_{2}$ and mapped to the data space
through a randomly initialized normalizing flow.

An ILCM trained in the weakly supervised setting is able to reconstruct the
causal factors accurately up to elementwise reparameterizations, as shown in
Fig. 4. In Tbl. 1 we quantify the quality of the learned representations with
the DCI disentanglement score [32]. We find that our LCM is able to
disentangle the causal factors almost perfectly, while the baselines, which
assume independent factors of variation, fail as expected. Both the ILCM and
the dVAE baseline infer the intervention targets with high accuracy. Finally,
we test the quality of the learned causal graphs. We infer the implicit graph
with ENCO and the heuristic algorithm discussed above. In both cases, the
learned causal graph is identical to the correct one, whereas the
representations found by the dVAE baseline induce a wrong graph.

###  5.2 Causal3DIdent

Figure 4: 2D toy data with graph $z_{1}^{*}\to z_{2}^{*}$. The grey grids show
the map between true causal factors, data, and latent causal factors learned
by the LCM. The mint dots indicate the observational data distribution, the
arrows from $z$ to $\tilde{z}$ show interventions targeting $z_{1}^{*}$ (red)
or $z_{2}^{*}$ (blue). The fact that axis-aligned lines in the true latent
space are mapped to axis-aligned lines in the learned latent space implies
that the disentanglement succeeded. Figure 5: Causal3DIdent before (top) and
after (middle) interventions, and post-intervention samples generated from the
ILCM under the intervention inferred from the data (bottom), indicating we
correctly learned to intervene.

We then turn to pixel-level data and more complex causal graphs. We test ILCMs
on an adaptation of the Causal3DIdent dataset [14], which contains images of
three-dimensional objects under variable positions and lighting conditions. We
consider three causal variables representing object hue, the spotlight hue,
and the position of the spotlight. We construct six versions of this dataset,
each with a different causal graph, randomly initialized nonlinear structure
functions, and heteroskedastic noise. These are mapped to images with a
resolution of $64\times 64$, see Fig. 5 for examples.

ILCMs are again able to disentangle the causal variables reliably. The results
in Tbl. 1 show that the learned representations are more disentangled than
those learned by methods that do not account for causal structure. The LCM as
well as the dVAE baseline can infer interventions with almost perfect
accuracy. We demonstrate this in Fig. 5 by comparing true and inferred
interventions, see Appendix D.3 for details. The ILCMs also learn the causal
graphs accurately, while the acausal dVAE-E baseline does in most cases not
find the correct causal graphs.

###  5.3 CausalCircuit

Figure 6: Varying learned causal factors vs. intervening on them. With a
trained ILCM, we encode a single test image (left column). In the top row, we
then vary the latent $z_{1}$ independently, without computing causal effects,
and show the corresponding reconstructed images. Only the robot arm position
changes, highlighting that we learned a disentangled representation. In the
bottom row we instead _intervene_ on $z_{1}$ and observe the causal effects:
the robot arm may activate lights, which in turn can affect other lights in
the circuit.

While Causal3DIdent provides a good test of the ability to disentangle
features that materialize in pixel space in different ways, like through the
position of lights and the color of objects, the underlying causal structure
we imposed may feel rather ad-hoc. To explore causal representation learning
in a more intuitively causal setting, we introduce a new dataset, which we
call CausalCircuit.

Figure 7: Causal graph of the CausalCircuit dataset.

The CausalCircuit system consists of a robot arm that can interact with
multiple touch-sensitive lights. The lights are connected with a stochastic
circuit: a light is more likely to be on if its button is pressed or if its
parent lights are on. The robot arm itself can be seen as part of the causal
system. Concretely, we consider the causal graph shown in Fig. 7. This system
is observed from a fixed-position camera, and we generate samples in
$512\times 512\times 3$ resolution with MuJoCo [33], see Appendix D for more
details.

ILCMs are again able to disentangle the causal variables reliably and better
than the acausal baselines, see Tbl. 1. As shown in Appendix D, the slot
attention model fails because the lights have no limited spatial extent and
thus are not well represented by segments of the image. Interventions are
identified with high accuracy. ILCMs also correctly learn the causal graph
shown in Fig. 6, both when extracted with ENCO and with our heuristic
algorithm. In Fig. 6 we demonstrate how ILCMs let us infer and manipulate
causal factors and reason about interventions.

By studying variations of this dataset, we tested the limitations of our
method. We find that it works reliably only as long as the causal variables
are continuous (that is, when we model the lights with a continuous
intensity). As soon as we consider discrete states, the assumptions of our
identifiability theorem are violated and the model has difficulty
disentangling these variables.

###  5.4 Scaling with graph size

Figure 8: Scaling with graph size. LCMs disentangle causal variables robustly
in simple systems with up to $\sim 10$ causal variables.

Finally, we study how LCMs scale with the size of the causal system. We
generate simple synthetic datasets with
$\mathcal{X}=\mathcal{Z}=\mathbb{R}^{n}$. For each dimension $n$, we generate
three datasets, using linear SCMs with random DAGs, in which each edge in a
fixed topological order is sampled from a Bernoulli distribution with
probability 0.5. The causal variables are mapped to the data space through a
randomly sampled $SO(n)$ rotation.

We find that ILCMs are able to reliably disentangle the causal variables in
systems with up to approximately 10 causal variables, see Fig. 8. In this
regime, the true causal graphs are also identified with good accuracy, see
Appendix D.5. In larger causal systems, both disentanglement and graph
accuracy become worse; more work is required to improve the scaling of our
approach to causal representation learning.

Table 1: Experiment results. We compare our ILCM-E (using ENCO for graph inference) and ILCM-H (with a heuristic for graph inference) to disentanglement VAE (dVAE-E), unstructured $\beta$-VAE, and slot attention baselines. We show the DCI disentanglement score ($D$), the accuracy of intervention inference (Acc), and structural Hamming distance (SHD) between learned and true graph. Best results in bold. Dataset | Method | $D$ | Acc | SHD
---|---|---|---|---
2D toy data | ILCM-E (ours) | 0.99 | 0.96 | 0.00
| ILCM-H (ours) | 0.99 | 0.96 | 0.00
| dVAE-E | 0.35 | 0.96 | 1.00
|  $\beta$-VAE | 0.52 | – | –
Causal3DIdent | ILCM-E (ours) | 0.99 | 0.98 | 0.00
| ILCM-H (ours) | 0.99 | 0.98 | 0.17
| dVAE-E | 0.82 | 0.98 | 1.67
|  $\beta$-VAE | 0.66 | – | –
| Slot attention | 0.60 | – | –
CausalCircuit | ILCM-E (ours) | 0.97 | 1.00 | 0.00
| ILCM-H (ours) | 0.97 | 1.00 | 0.00
| dVAE-E | 0.34 | 1.00 | 5.00
|  $\beta$-VAE | 0.39 | – | –
| Slot attention | 0.38 | – | –

##  6 Discussion

What makes a variable causal? One school of thought is that it that causal
variables are those aspects of a system that can be intervened upon [34].
Following this logic, we find it interesting to ask: can we uniquely determine
the causal variables underlying a system just by observing the effect of
interventions?

In this work we have found a partial answer to this question: we have shown in
theory and practice that under certain assumptions, causal variables and their
causal structure are identifiable from low-level representations like the
pixels of a camera feed if the system is observed before and after random,
unlabeled interventions. Our identifiability theorem extends the results by
Locatello et al. [5] from independent factors of variation (trivial causal
graphs) to arbitrary causal graphs.

Latent causal structure can be described in a variational autoencoder setup.
However, a straightforward, explicit parameterization of the causal structure
requires simultaneously learning the variables and the causal graph. We found
that leads to challenging optimization problems, especially when scaling to
larger systems. As a more robust alternative, we introduced implicit latent
causal models (ILCMs), which parameterize causal structure without requiring
an explicit graph representation. We also discussed two algorithms for
extracting the learned causal mechanisms and graph after training.

In first experiments, we demonstrated that ILCMs let us reliably disentangle
causal factors, identify causal graphs, and infer interventions from
unstructured pixel data. For these experiments, we introduced the new
CausalCircuit dataset, which consists of images of a robot arm interacting
with connected switches and lights.

The setting we consider is motivated by a potentially useful scenario:
learning causal structure from passive observations of an agent (or
demonstrator) interacting with a causal system. However, it is currently far
from practical. Our identifiability result relies on a number of assumptions,
including that interventions are stochastic and perfect, that all atomic
interventions may be observed, and that the causal variables are real-valued.
In addition, realistic temporal sequence data are not likely to exactly
correspond to a causal system before and after an intervention (while
preserving the noise variables); whether our causal abstraction provides a
useful approximation remains to be tested. We discuss these requirements and
their potential relaxation in Appendix B. Similarly, our practical
implementation has so far been restricted to simplified datasets with
relatively few, continuous causal variables, and when trying to relax these
limitations we saw the model performance decrease quickly. While more work
will be required to make latent causal models applicable to real-world
settings, we believe that our results demonstrate that causal representation
learning is possible without explicit labels.

#### Acknowledgments

We want to thank Joey Bose, Thomas Kipf, Dominik Neuenfeld, and Frank Rösler
for useful discussions and Gabriele Cesa, Yang Yang, and Yunfan Zhang for
helping with our experiments.

## References

  * Schölkopf et al. [2021] Bernhard Schölkopf, Francesco Locatello, Stefan Bauer, Nan Rosemary Ke, Nal Kalchbrenner, Anirudh Goyal, and Yoshua Bengio.  Toward causal representation learning.  _Proceedings of the IEEE_ , 109(5):612–634, 2021\.
  * Eberhardt [2016] Frederick Eberhardt.  Green and grue causal variables.  _Synthese_ , 193(4):1029–1046, 2016.
  * Locatello et al. [2019] Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Raetsch, Sylvain Gelly, Bernhard Schölkopf, and Olivier Bachem.  Challenging common assumptions in the unsupervised learning of disentangled representations.  In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, _Proceedings of the 36th International Conference on Machine Learning_ , volume 97 of _Proceedings of Machine Learning Research_ , pages 4114–4124. PMLR, 2019.
  * Kingma and Welling [2014] Diederik P. Kingma and Max Welling.  Auto-Encoding Variational Bayes.  In _2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings_ , 2014.
  * Locatello et al. [2020a] Francesco Locatello, Ben Poole, Gunnar Rätsch, Bernhard Schölkopf, Olivier Bachem, and Michael Tschannen.  Weakly-supervised disentanglement without compromises.  In _International Conference on Machine Learning_ , pages 6348–6359. PMLR, 2020a.
  * Hyvärinen and Oja [2000] Aapo Hyvärinen and Erkki Oja.  Independent component analysis: algorithms and applications.  _Neural Networks_ , 13:411–430, 2000.
  * Shu et al. [2020] Rui Shu, Yining Chen, Abhishek Kumar, Stefano Ermon, and Ben Poole.  Weakly Supervised Disentanglement with Guarantees.  In _International Conference on Learning Representations_ , 2020.
  * Khemakhem et al. [2020] Ilyes Khemakhem, Diederik Kingma, Ricardo Monti, and Aapo Hyvarinen.  Variational Autoencoders and Nonlinear ICA: A Unifying Framework.  In Silvia Chiappa and Roberto Calandra, editors, _Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics_ , volume 108 of _Proceedings of Machine Learning Research_ , pages 2207–2217. PMLR, 2020.
  * Hälvä et al. [2021] Hermanni Hälvä, Sylvain Le Corff, Luc Lehéricy, Jonathan So, Yongjie Zhu, Elisabeth Gassiat, and Aapo Hyvarinen.  Disentangling Identifiable Features from Noisy Data with Structured Nonlinear ICA.  In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, _Advances in Neural Information Processing Systems_ , 2021.
  * Gresele et al. [2021] Luigi Gresele, Julius von Kügelgen, Vincent Stimper, Bernhard Schölkopf, and Michel Besserve.  Independent mechanism analysis, a new concept?  In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, _Advances in Neural Information Processing Systems_ , 2021.
  * Yao et al. [2022] Weiran Yao, Yuewen Sun, Alex Ho, Changyin Sun, and Kun Zhang.  Learning Temporally Causal Latent Processes from General Temporal Data.  In _International Conference on Learning Representations_ , 2022.
  * Lachapelle et al. [2022] Sebastien Lachapelle, Pau Rodriguez, Rémi Le, Yash Sharma, Katie E Everett, Alexandre Lacoste, and Simon Lacoste-Julien.  Disentanglement via Mechanism Sparsity Regularization: A New Principle for Nonlinear ICA.  In _First Conference on Causal Learning and Reasoning_ , 2022.
  * Lu et al. [2021] Chaochao Lu, Yuhuai Wu, Jośe Miguel Hernández-Lobato, and Bernhard Schölkopf.  Nonlinear invariant risk minimization: A causal approach.  _arXiv preprint arXiv:2102.12353_ , 2021.
  * von Kügelgen et al. [2021] Julius von Kügelgen, Yash Sharma, Luigi Gresele, Wieland Brendel, Bernhard Schölkopf, Michel Besserve, and Francesco Locatello.  Self-Supervised Learning with Data Augmentations Provably Isolates Content from Style.  In _Thirty-Fifth Conference on Neural Information Processing Systems_ , 2021.
  * Lippe et al. [2022a] Phillip Lippe, Sara Magliacane, Sindy Löwe, Yuki M. Asano, Taco Cohen, and Efstratios Gavves.  CITRIS: Causal Identifiability from Temporal Intervened Sequences.  In _Proceedings of the 39th International Conference on Machine Learning, ICML_ , 2022a.
  * Yang et al. [2021] Mengyue Yang, Furui Liu, Zhitang Chen, Xinwei Shen, Jianye Hao, and Jun Wang.  CausalVAE: Disentangled representation learning via neural structural causal models.  In _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_ , pages 9593–9602, 2021.
  * Adams et al. [2021] Jeffrey Adams, Niels Hansen, and Kun Zhang.  Identification of partially observed linear causal models: Graphical conditions for the non-gaussian and heterogeneous cases.  In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan, editors, _Advances in Neural Information Processing Systems_ , volume 34, pages 22822–22833. Curran Associates, Inc., 2021.  URL https://proceedings.neurips.cc/paper/2021/file/c0f6fb5d3a389de216345e490469145e-Paper.pdf.
  * Xie et al. [2020] Feng Xie, Ruichu Cai, Biwei Huang, Clark Glymour, Zhifeng Hao, and Kun Zhang.  Generalized independent noise condition for estimating latent variable causal graphs.  In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, _Advances in Neural Information Processing Systems_ , volume 33, pages 14891–14902. Curran Associates, Inc., 2020.  URL https://proceedings.neurips.cc/paper/2020/file/aa475604668730af60a0a87cc92604da-Paper.pdf.
  * Kivva et al. [2021] Bohdan Kivva, Goutham Rajendran, Pradeep Ravikumar, and Bryon Aragam.  Learning latent causal graphs via mixture oracles.  In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan, editors, _Advances in Neural Information Processing Systems_ , volume 34, pages 18087–18101. Curran Associates, Inc., 2021.  URL https://proceedings.neurips.cc/paper/2021/file/966aad8981dcc75b5b8ab04427a833b2-Paper.pdf.
  * Chalupka et al. [2014] Krzysztof Chalupka, Pietro Perona, and Frederick Eberhardt.  Visual causal feature learning.  _Uncertainty in Artificial Intelligence_ , December 2014.
  * Beckers and Halpern [2019] Sander Beckers and Joseph Y Halpern.  Abstracting causal models.  _Proc. Conf. AAAI Artif. Intell._ , 33:2678–2685, July 2019\.
  * Peters et al. [2017] Jonas Peters, Dominik Janzing, and Bernhard Schölkopf.  _Elements of causal inference: foundations and learning algorithms_.  The MIT Press, 2017.
  * Rubenstein et al. [2017] Paul K Rubenstein, Sebastian Weichwald, Stephan Bongers, Joris M Mooij, Dominik Janzing, Moritz Grosse-Wentrup, and Bernhard Schölkopf.  Causal consistency of structural equation models.  _Uncertainty in Artificial Intelligence_ , July 2017.
  * Pearl [2000] Judea Pearl.  _Causality : models, reasoning, and inference_.  Cambridge University Press, Cambridge, U.K. New York, 2000.  ISBN 978-0521895606.
  * Bongers et al. [2021] Stephan Bongers, Patrick Forré, Jonas Peters, and Joris M. Mooij.  Foundations of Structural Causal Models with Cycles and Latent Variables.  _Annals of Statistics_ , 49(5):2885–2915, 2021\.  doi: 10.1214/21-AOS2064.
  * Jang et al. [2017] Eric Jang, Shixiang Gu, and Ben Poole.  Categorical Reparameterization with Gumbel-Softmax.  In _5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings_ , 2017.
  * Brouillard et al. [2020] Philippe Brouillard, Sébastien Lachapelle, Alexandre Lacoste, Simon Lacoste-Julien, and Alexandre Drouin.  Differentiable Causal Discovery from Interventional Data.  In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, _Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual_ , 2020.
  * Lippe et al. [2022b] Phillip Lippe, Taco Cohen, and Efstratios Gavves.  Efficient Neural Causal Discovery without Acyclicity Constraints.  In _International Conference on Learning Representations_ , 2022b.
  * Charpentier et al. [2022] Bertrand Charpentier, Simon Kibler, and Stephan Günnemann.  Differentiable DAG sampling.  March 2022.
  * Hauser and Bühlmann [2012] Alain Hauser and Peter Bühlmann.  Characterization and Greedy Learning of Interventional Markov Equivalence Classes of Directed Acyclic Graphs.  _Journal of Machine Learning Research_ , 13(1):2409–2464, 2012.  ISSN 1532-4435.
  * Locatello et al. [2020b] Francesco Locatello, Dirk Weissenborn, Thomas Unterthiner, Aravindh Mahendran, Georg Heigold, Jakob Uszkoreit, Alexey Dosovitskiy, and Thomas Kipf.  Object-centric learning with slot attention.  _Advances in Neural Information Processing Systems_ , 33:11525–11538, 2020b.
  * Eastwood and Williams [2018] Cian Eastwood and Christopher K I Williams.  A framework for the quantitative evaluation of disentangled representations.  _International Conference on Learning Representations_ , February 2018\.
  * Todorov et al. [2012] Emanuel Todorov, Tom Erez, and Yuval Tassa.  MuJoCo: A physics engine for model-based control.  In _2012 IEEE/RSJ International Conference on Intelligent Robots and Systems_ , pages 5026–5033, October 2012.
  * Woodward [2005] James Woodward.  _Making Things Happen: A Theory of Causal Explanation_.  Oxford University Press, USA, October 2005.
  * Stack Exchange user zhw [2016] Stack Exchange user zhw.  Lebesgue measure-preserving differentiable function.  Mathematics Stack Exchange, 2016.  URL https://math.stackexchange.com/q/1755585.  (version: 2016-04-23).
  * Fritz [2020] Tobias Fritz.  A synthetic approach to markov kernels, conditional independence and theorems on sufficient statistics.  _Advances in Mathematics_ , 370:107239, 2020.  ISSN 0001-8708.  doi: https://doi.org/10.1016/j.aim.2020.107239.  URL https://www.sciencedirect.com/science/article/pii/S0001870820302656.
  * Fong [2013] Brendan Fong.  Causal theories: A categorical perspective on bayesian networks.  _arXiv preprint arXiv:1301.6201_ , 2013.
  * Riehl [2017] Emily Riehl.  _Category Theory in Context_.  Aurora: Dover Modern Math Originals. Dover Publications, 2017.  ISBN 9780486820804.
  * Kingma and Ba [2015] Diederik P. Kingma and Jimmy Ba.  Adam: A Method for Stochastic Optimization.  In Yoshua Bengio and Yann LeCun, editors, _3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings_ , 2015.
  * Loshchilov and Hutter [2016] Ilya Loshchilov and Frank Hutter.  SGDR: Stochastic gradient descent with warm restarts.  August 2016.
  * Kipf et al. [2021] Thomas Kipf, Gamaleldin F Elsayed, Aravindh Mahendran, Austin Stone, Sara Sabour, Georg Heigold, Rico Jonschkowski, Alexey Dosovitskiy, and Klaus Greff.  Conditional object-centric learning from video.  _arXiv preprint arXiv:2111.12594_ , 2021.
  * Pedregosa et al. [2011] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay.  Scikit-learn: Machine learning in Python.  _Journal of Machine Learning Research_ , 12:2825–2830, 2011\.
  * Blender Online Community [2021] Blender Online Community.  _Blender - a 3D modelling and rendering package_.  Blender Foundation, Stichting Blender Foundation, Amsterdam, 2021.  http://www.blender.org.
  * Newell [1975] Martin Edward Newell.  _The Utilization of Procedure Models in Digital Image Synthesis._ PhD thesis, The University of Utah, 1975.  AAI7529894.
  * Krishnamurthy and Levoy [1996] Venkat Krishnamurthy and Marc Levoy.  Fitting Smooth Surfaces to Dense Polygon Meshes.  In _Proceedings of the 23rd Annual Conference on Computer Graphics and Interactive Techniques_ , SIGGRAPH ’96, page 313–324, New York, NY, USA, 1996. Association for Computing Machinery.  ISBN 0897917464.  doi: 10.1145/237170.237270.
  * Turk and Levoy [1994] Greg Turk and Marc Levoy.  Zippered Polygon Meshes from Range Images.  In _Proceedings of the 21st Annual Conference on Computer Graphics and Interactive Techniques_ , SIGGRAPH ’94, page 311–318, New York, NY, USA, 1994. Association for Computing Machinery.  ISBN 0897916670.  doi: 10.1145/192161.192241.
  * Crane [2021] Keenan Crane.  Keenan’s 3D Model Repository.  https://www.cs.cmu.edu/~kmcrane/Projects/ModelRepository/, 2021\.
  * Curless and Levoy [1996] Brian Curless and Marc Levoy.  A Volumetric Method for Building Complex Models from Range Images.  In _Proceedings of the 23rd Annual Conference on Computer Graphics and Interactive Techniques_ , SIGGRAPH ’96, page 303–312, New York, NY, USA, 1996. Association for Computing Machinery.  ISBN 0897917464.  doi: 10.1145/237170.237269.
  * Praun et al. [2000] Emil Praun, Adam Finkelstein, and Hugues Hoppe.  Lapped Textures.  In _Proceedings of ACM SIGGRAPH 2000_ , pages 465–470, July 2000\.
  * Wüthrich et al. [2020] Manuel Wüthrich, Felix Widmaier, Felix Grimminger, Joel Akpo, Shruti Joshi, Vaibhav Agrawal, Bilal Hammoud, Majid Khadiv, Miroslav Bogdanovic, Vincent Berenz, et al.  Trifinger: An open-source robot for learning dexterity.  _arXiv preprint arXiv:2008.03596_ , 2020.
  * Zheng et al. [2018] Xun Zheng, Bryon Aragam, Pradeep Ravikumar, and Eric P. Xing.  DAGs with NO TEARS: Continuous Optimization for Structure Learning.  In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett, editors, _Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada_ , pages 9492–9503, 2018.

## Checklist

  1. 1.

For all authors…

    1. (a)

Do the main claims made in the abstract and introduction accurately reflect
the paper’s contributions and scope? [Yes]

    2. (b)

Did you describe the limitations of your work? [Yes] We strive to be
transparent about the limitations of our work. In the theory section we list
the assumptions, in the experiment section we discuss observed failures, and
in the conclusions and in Appendix B we discuss the requirements of our
approach again.

    3. (c)

Did you discuss any potential negative societal impacts of your work? [Yes]
See Appendix F.

    4. (d)

Have you read the ethics review guidelines and ensured that your paper
conforms to them? [Yes]

  2. 2.

If you are including theoretical results…

    1. (a)

Did you state the full set of assumptions of all theoretical results? [Yes] We
provide our list of assumptions in Sec. 5 and Appendix A and further discuss
them in Appendix B.

    2. (b)

Did you include complete proofs of all theoretical results? [Yes] Our
identifiability theorem is proven in Appendix A.

  3. 3.

If you ran experiments…

    1. (a)

Did you include the code, data, and instructions needed to reproduce the main
experimental results (either in the supplemental material or as a URL)? [No]
Not yet, but we aim to publish them as soon as we obtain approval to do so.

    2. (b)

Did you specify all the training details (e.g., data splits, hyperparameters,
how they were chosen)? [Yes] We provide these details in Appendix D.

    3. (c)

Did you report error bars (e.g., with respect to the random seed after running
experiments multiple times)? [No]

    4. (d)

Did you include the total amount of compute and the type of resources used
(e.g., type of GPUs, internal cluster, or cloud provider)? [No]

  4. 4.

If you are using existing assets (e.g., code, data, models) or
curating/releasing new assets…

    1. (a)

If your work uses existing assets, did you cite the creators? [Yes] We use the
Causal3DIdent dataset from von Kügelgen et al. [14].

    2. (b)

Did you mention the license of the assets? [No]

    3. (c)

Did you include any new assets either in the supplemental material or as a
URL? [No] We strive to publish our CausalCircuit dataset as soon as possible.

    4. (d)

Did you discuss whether and how consent was obtained from people whose data
you’re using/curating? [N/A] We only consider synthetic data showing simulated
objects.

    5. (e)

Did you discuss whether the data you are using/curating contains personally
identifiable information or offensive content? [N/A]

  5. 5.

If you used crowdsourcing or conducted research with human subjects…

    1. (a)

Did you include the full text of instructions given to participants and
screenshots, if applicable? [N/A]

    2. (b)

Did you describe any potential participant risks, with links to Institutional
Review Board (IRB) approvals, if applicable? [N/A]

    3. (c)

Did you include the estimated hourly wage paid to participants and the total
amount spent on participant compensation? [N/A]

## Appendices

In the following we provide additional results and details that did not fit
into our main paper. In Appendix A we provide precise definitions and a
complete proof of our identifiability theorem. We then discuss the assumptions
underlying this result and their generalization in Appendix B. Appendix C
covers implicit latent causal models (ILCMs) and their training, while
Appendix D provides details for our experiments. In Appendix E we describe
explicit latent causal models (ELCMs) and our experiments with them. Finally,
in Appendix F we discuss the potential societal impact of our work.

##  Appendix A Identifiability result

###  A.1 Definitions

Here we define objects and relations that were not formally defined in the
main body of the paper, but are necessary to make Thm. 1 precise and to prove
it.

We use the following notation:

  * •

$[n]=\\{1,...,n\\}$

  * •

$\mathrm{\mathbf{pa}}^{\mathcal{C}}_{i}\subseteq[n]$ the set of parent nodes
of node $i$ in graph $\mathcal{G}(\mathcal{C})$.

  * •

$\mathrm{\mathbf{desc}}^{\mathcal{C}}_{i}\subseteq[n]$ the set of descendant
nodes of node $i$ in graph $\mathcal{G}(\mathcal{C})$, excluding $i$ itself.

  * •

$\mathrm{\mathbf{anc}}^{\mathcal{C}}_{i}\subseteq[n]$ the set of ancestor
nodes of node $i$ in graph $\mathcal{G}(\mathcal{C})$, excluding $i$ itself.

  * •

$\mathrm{\mathbf{nonanc}}^{\mathcal{C}}_{i}=[n]\setminus(\mathrm{\mathbf{anc}}^{\mathcal{C}}_{i}\cup\\{i\\})$
the set of non-ancestor nodes of node $i$ in graph $\mathcal{G}(\mathcal{C})$,
excluding $i$ itself.

  * •

Given measure $p$ on space $A$ and measurable function $f:A\to B$, $f_{*}p$ is
the push-forward measure on $B$.

We describe causal structure with SCMs.

######  Definition 4 (Structural causal model (SCM)).

An SCM is a tuple
$\mathcal{C}=\langle\mathcal{Z},\mathcal{E},F,p_{\mathcal{E}}\rangle$
consisting of the following:

  * •

domains $\mathcal{Z}=\mathcal{Z}_{1}\times\dots\times\mathcal{Z}_{n}$ of
causal (endogenous) variables $z_{1},\dots,z_{n}$;

  * •

domains $\mathcal{E}=\mathcal{E}_{1}\times\dots\times\mathcal{E}_{n}$ of noise
(exogeneous) variables $\epsilon_{1},\dots,\epsilon_{n}$;

  * •

a directed acyclic graph $\mathcal{G}(\mathcal{C})$, whose nodes are the
causal variables and edges represent causal relations between the variables;

  * •

causal mechanisms $F=\\{f_{1},\dots,f_{n}\\}$ with
$f_{i}:\mathcal{E}_{i}\times\prod_{j\in\mathrm{\mathbf{pa}}_{i}}\mathcal{Z}_{j}\to\mathcal{Z}_{i}$;
and

  * •

a probability measure
$p_{\mathcal{E}}(\epsilon)=p_{\mathcal{E}_{1}}(\epsilon_{1})\,p_{\mathcal{E}_{2}}(\epsilon_{2})\dots
p_{\mathcal{E}_{n}}(\epsilon_{n})$ with full support that admits a continuous
density.

Additionally, we assume that $\forall i,\forall
z_{\mathrm{\mathbf{pa}}_{i}},f_{i}(\cdot,z_{\mathrm{\mathbf{pa}}_{i}}):\mathcal{E}_{i}\to\mathcal{Z}_{i}$
is a diffeomorphism.

We will need to reason about vectors being “equal up to permutation and
elementwise reparameterizations”. We formalize this in the following
definition:

######  Definition 5 ($\psi$-diagonal).

Let $\psi:[n]\to[n]$ be a bijection (that is, a permutation). Let
$\varphi:\prod_{i=1}^{n}X_{i}\to\prod_{i=1}^{n}Y_{i}$ be a function between
product spaces. Then $\varphi$ is $\psi$-diagonal if there exist functions,
called components, $\varphi_{i}:X_{i}\to Y_{\psi(i)}$ such that $\forall
i,\forall x,\varphi(x_{1},...,x_{i},...,x_{n})_{\psi(i)}=\varphi_{i}(x_{i})$.

This lets us define isomorphisms between SCMs:

######  Definition 6 (Isomorphism of SCMs).

Let $\mathcal{C}=\langle\mathcal{Z},\mathcal{E},F,p_{\mathcal{E}}\rangle$ and
$\mathcal{C}^{\prime}=\langle\mathcal{Z}^{\prime},\mathcal{E}^{\prime},F^{\prime},p_{\mathcal{E}}^{\prime}\rangle$
be SCMs. An isomorphism $\varphi:\mathcal{C}\rightarrow\mathcal{C}^{\prime}$
consists of

  1. 1.

a graph isomorphism
$\psi:\mathcal{G}(\mathcal{C})\rightarrow\mathcal{G}(\mathcal{C}^{\prime})$
that tells us how to identify corresponding variables in the two models and
which preserves parents:
$\mathrm{\mathbf{pa}}^{\mathcal{C}^{\prime}}_{\psi(i)}=\psi(\mathrm{\mathbf{pa}}^{\mathcal{C}}_{i})$
and

  2. 2.

$\psi$-diagonal diffeomorphisms for noise and endogenous variables that tell
us how to reparameterize them
$\varphi_{\mathcal{E}}:\mathcal{E}\to\mathcal{E}^{\prime}$ and
$\varphi_{\mathcal{Z}}:\mathcal{Z}\to\mathcal{Z}^{\prime}$, where
$\varphi_{\mathcal{E}}$ must be measure preserving
$p_{\mathcal{E}^{\prime}}={\varphi_{\mathcal{E}}}_{*}p_{\mathcal{E}}$. For
notational simplicity, we will drop the subscript in $\varphi_{\mathcal{Z}}$
and use the symbol $\varphi$ to refer both to the SCM isomorphism and the
noise isomorphism.

The elementwise diffeomorphisms are required to make the following diagrams
commute $\forall i,i^{\prime}=\psi(i)$:

${{\mathcal{Z}_{\mathrm{\mathbf{pa}}_{i}}\times\mathcal{E}_{i}}}$${{\mathcal{Z}^{\prime}_{\mathrm{\mathbf{pa}}^{\prime}_{i^{\prime}}}\times\mathcal{E}^{\prime}_{i^{\prime}}}}$${{\mathcal{Z}_{i}}}$${{\mathcal{Z}^{\prime}_{i^{\prime}}}}$$\scriptstyle{f_{i}}$$\scriptstyle{f^{\prime}_{i^{\prime}}}$$\scriptstyle{\varphi_{i}}$$\scriptstyle{(\varphi_{\mathrm{\mathbf{pa}}_{i}},\varphi_{\mathcal{E},i})}$
(5)

Intuitively, this says that if we apply a causal mechanism $f_{i}$ and then
reparameterize the causal variable $i$ using $\varphi_{i}$, we get the same
thing as first reparameterizing the parents and noise variable of variable
$i$, and then applying the causal mechanism $f^{\prime}_{i^{\prime}}$.

To reason about interventions, we equip SCMs with intervention distributions
in the following definition.

######  Definition 7 (Intervention structural causal model (ISCM)).

An intervention structural causal model (ISCM) is a tuple
$\mathcal{D}=\langle\mathcal{C},\mathcal{I},p_{\mathcal{I}}\rangle$ of

  1. 1.

an acyclic SCM
$\mathcal{C}=\langle\mathcal{Z},\mathcal{E},F,p_{\mathcal{E}}\rangle$ that
admits a faithful distribution, meaning that conditional independence of
causal variables $z$ implies $d$-separation [24].

  2. 2.

a set $\mathcal{I}$ of interventions on $\mathcal{C}$, where each intervention
$(I,(\tilde{f}_{i})_{i\in I})\in\mathcal{I}$ consist of

    1. (a)

a subset $I\subset\\{1,...,n\\}$ of the causal variables, called the
intervention target set, and

    2. (b)

for each $i\in I$, a new causal mechanism
$\tilde{f}_{i}:\mathcal{E}_{i}\to\mathcal{Z}_{i}$ which replaces the original
mechanism and which does not depend on the parents.

We define intervention set $\mathcal{I}$ to be atomic if the number of
targeted variables is one or zero.

  3. 3.

a probability measure $p_{\mathcal{I}}$ over $\mathcal{I}$.

We can extend the notion of isomorphism from SCMs to ISCMs.

######  Definition 8 (Isomorphism of ISCMs).

Let $\mathcal{D}=\langle\mathcal{C},\mathcal{I},p_{\mathcal{I}}\rangle$ and
$\mathcal{D}^{\prime}=\langle\mathcal{C}^{\prime},\mathcal{I}^{\prime},p^{\prime}_{\mathcal{I}^{\prime}}\rangle$
be ISCMs. An ISCM isomorphism is an SCM isomorphism
$\varphi:\mathcal{C}\rightarrow\mathcal{C}^{\prime}$ with underlying graph
isomorphism
$\psi:\mathcal{G}(\mathcal{C})\rightarrow\mathcal{G}(\mathcal{C}^{\prime})$
and a $\psi$-diagonal diffeomorphism
$\tilde{\varphi}_{\mathcal{E}}:\mathcal{E}\to\mathcal{E}^{\prime}$ such that

  * •

the graph isomorphism $\psi$ induces a bijection of intervention sets

$\psi_{\mathcal{I}}:\mathcal{I}\to\mathcal{I}^{\prime}:(I,(\tilde{f}_{i})_{i\in
I})\mapsto(\psi(I),(\tilde{f}^{\prime}_{i^{\prime}})_{i^{\prime}\in\psi(I)})$

  * •

for each intervention $(I,(\tilde{f}_{i})_{i\in I})\in\mathcal{I}$, and each
intervened on variable $i\in I$, the following diagram commutes:

${{\mathcal{E}_{i}}}$${{\mathcal{E}^{\prime}_{\psi(i)}}}$${{\mathcal{Z}_{i}}}$${{\mathcal{Z}^{\prime}_{\psi(i)}}}$$\scriptstyle{\tilde{f}_{i}}$$\scriptstyle{\tilde{f}^{\prime}_{\psi(i)}}$$\scriptstyle{\varphi_{i}}$$\scriptstyle{\tilde{\varphi}_{\mathcal{E},i}}$
(6)

  * •

$\tilde{\varphi}_{\mathcal{E}}$ is measure preserving, i. e.
$p_{\mathcal{E}^{\prime}}=({\tilde{\varphi}_{\mathcal{E}}})_{*}p_{\mathcal{E}}$.

  * •

the bijection $\psi_{\mathcal{I}}:\mathcal{I}\to\mathcal{I}^{\prime}$
preserves the distribution over interventions:
$\psi_{*}p_{\mathcal{I}}=p^{\prime}_{\mathcal{I}^{\prime}}$.

Latent Causal Models (LCMs), defined in Def. 1, add a map to the data space to
an ILCM. We can lift ISCM isomorphisms to LCM isomorphisms by requiring that
these decoders must respect the ISCM isomorphism.

######  Definition 9 (Isomorphism of LCMs).

Let
$\mathcal{M}=\langle\mathcal{C},\mathcal{X},g,\mathcal{I},p_{\mathcal{I}}\rangle$
and
$\mathcal{M}^{\prime}=\langle\mathcal{C}^{\prime},\mathcal{X},g^{\prime},\mathcal{I}^{\prime},p^{\prime}_{\mathcal{I}^{\prime}}\rangle$
be LCMs with identical observation space $\mathcal{X}=\mathcal{X}^{\prime}$.
An LCM isomorphism is an ISCM isomorphism
$\varphi:\mathcal{D}\rightarrow\mathcal{D}^{\prime}$ such that the decoders
respect the SCM isomorphism, so this diagram must commute:

${\mathcal{Z}}$${{\mathcal{Z}^{\prime}}}$${\mathcal{X}}$$\scriptstyle{\varphi}$$\scriptstyle{g}$$\scriptstyle{g^{\prime}}$
(7)

######  Remark 1.

By defining objects and isomorphisms, we have defined a groupoid of SCMs, a
groupoid of ISCMs and a groupoid of LCMs, as the isomorphisms are composed and
inverted in an obvious way.

######  Definition 10 (Equivalence).

We call two SCMs, ISCMs, or LCMs equivalent if an isomorphism exists between
them.

Informally, two SCMs, ISCMs, or LCMs are equivalent if there is a
$\psi$-diagonal map between their causal variables (i. e. the causal variables
are equal up to permutation and elementwise diffeomorphisms), there is a
$\psi$-diagonal map between their noise encodings, and all other structure
(decoders, intervention sets, intervention distributions) is compatible with
these reparameterizations.

Next, we define the solution function of an SCM or ISCM, which maps from noise
variables to causal variables by repeatedly applying the causal mechanisms.

######  Definition 11 (Solution).

Given an ISCM
$\mathcal{D}=\langle\mathcal{C},\mathcal{I},p_{\mathcal{I}}\rangle$, the
solution function $s:\mathcal{E}\to\mathcal{Z}$ is the unique function such
that for all $i\in[n]$, the following diagram commutes [25]

${\mathcal{E}}$${{\mathcal{Z}_{\mathrm{\mathbf{pa}}_{i}}\times\mathcal{E}_{i}}}$${{\mathcal{Z}_{i}}}$$\scriptstyle{s_{i}}$$\scriptstyle{(s_{\mathrm{\mathbf{pa}}_{i}},\operatorname{id}_{\mathcal{E}_{i}})}$$\scriptstyle{f_{i}}$

In equations, we have that
$s(\epsilon)_{i}=f(\epsilon_{i};s(\epsilon_{\mathrm{\mathbf{pa}}_{i}}))$.
Similarly, intervention $(I,(\tilde{f}_{i})_{i\in I})\in\mathcal{I}$ yields a
solution function $\tilde{s}_{I}:\mathcal{E}\to\mathcal{Z}$ with the modified
causal mechanisms.

For example, with two variables with $z_{1}\to z_{2}$, the solution is given
by:

$s:\mathcal{E}\to\mathcal{Z}:\begin{pmatrix}\epsilon_{1}\\\
\epsilon_{2}\end{pmatrix}\mapsto\begin{pmatrix}z_{1}\\\
z_{2}\end{pmatrix}=\begin{pmatrix}f_{1}(\epsilon_{1})\\\
f_{2}(\epsilon_{2},f_{1}(\epsilon_{1}))\end{pmatrix}.$

Since we require causal mechanisms to be pointwise diffeomorphic, the solution
function is a diffeomorphism as well.

${{\epsilon,\tilde{\epsilon}}}$${{\epsilon^{\prime},\tilde{\epsilon}^{\prime}}}$${{z,\tilde{z}}}$${{z^{\prime},\tilde{z}^{\prime}}}$${{x,\tilde{x}}}$${{x,\tilde{x}}}$$\scriptstyle{\varphi_{\mathcal{E}},\tilde{\varphi}_{\mathcal{E}}}$$\scriptstyle{s,\tilde{s}_{I}}$$\scriptstyle{s^{\prime},\tilde{s}^{\prime}_{I^{\prime}}}$$\scriptstyle{\varphi_{\mathcal{Z}},\varphi_{\mathcal{Z}}}$$\scriptstyle{g,g}$$\scriptstyle{g^{\prime},g^{\prime}}$
Figure 9: An illustration of the spaces and maps in our definitions and proof.
When LCMs $\mathcal{M},\mathcal{M}^{\prime}$ are isomorphic, all squares in
the diagram should commute. Additionally, all maps should preserve the weakly
supervised distributions on the variables and all horizontal maps should be
$\psi$-diagonal. Note that the latent variables $(\epsilon,z)$ can differ up
to a diffeomorphism, but the $x$ variables are actually observed, so must be
identically equal. From that equality, the other horizontal maps are uniquely
defined.

Pushing the noise distribution of an SCM through the solution function finally
gives us the (observable) distribution entailed by an SCM or ISCM. In an ISCM
or LCM we can define several other (observational or interventional)
distributions.

######  Definition 12 (Distributions).

Given an LCM
$\mathcal{M}=\langle\mathcal{C},\mathcal{X},g,\mathcal{I},p_{\mathcal{I}}\rangle$,
we have the following generative process:

$\displaystyle\epsilon$ $\displaystyle\sim p_{\mathcal{E}}\,,$ $\displaystyle
z$ $\displaystyle=s(\epsilon)\,,$ $\displaystyle x$ $\displaystyle=g(z)\,,$
$\displaystyle e$ $\displaystyle=s^{-1}(z)\,$ $\displaystyle I$
$\displaystyle\sim p_{\mathcal{I}}\,,$ $\displaystyle\tilde{\epsilon}$
$\displaystyle\sim\tilde{p}_{\tilde{\mathcal{E}}}(\tilde{\epsilon}\mid\epsilon,I)\,,$
$\displaystyle\tilde{z}$ $\displaystyle=\tilde{s}_{I}(\tilde{\epsilon})\,,$
$\displaystyle\tilde{x}$ $\displaystyle=g(\tilde{z})\,,$
$\displaystyle\tilde{e}$ $\displaystyle=s^{-1}(\tilde{z})\,.$ (8)

where $p(\tilde{\epsilon}_{i}\mid\epsilon_{i},i\in
I)=p_{\mathcal{E}_{i}}(\tilde{\epsilon}_{i})$ and
$p(\tilde{\epsilon}_{i}\mid\epsilon_{i},i\not\in
I)=\delta(\tilde{\epsilon}_{i}\mid\epsilon_{i})$ is the Dirac measure.

Then we define the following weakly supervised distributions:

  * •

The weakly supervised noise distribution with interventions:
$p_{\mathcal{C}}^{\mathcal{E},\mathcal{I}}(\epsilon,\tilde{\epsilon},I)$.

  * •

The weakly supervised causal distribution with interventions:
$p_{\mathcal{C}}^{\mathcal{Z},\mathcal{I}}(z,\tilde{z},I)$.

  * •

The weakly supervised observational distribution with interventions:
$p_{\mathcal{M}}^{\mathcal{X},\mathcal{I}}(x,\tilde{x},I)$.

These distributions are given by appropriate pushforwards of the noise
distributions through the transformations in Eq. (8).

By marginalizing over $I$, we get
$p_{\mathcal{C}}^{\mathcal{E}},p_{\mathcal{C}}^{\mathcal{Z}},p_{\mathcal{C}}^{e},p_{\mathcal{M}}^{\mathcal{X}}$
respectively.

The relationships between all the maps can be found in Fig. 9.

###  A.2 Identifiability proof

First, we prove two auxiliary lemmata.

######  Lemma 1.

Let $f:[0,1]\to[0,1]$ be differentiable and Lebesgue measure preserving. Then
either $f(x)=x$ or $f(x)=1-x$.

###### Proof.

We follow the celebrated proof from Stack Exchange user zhw [35]. Let
$\lambda$ be the Lebesgue measure. Measure preservation means that for any
measurable subset $U\subseteq[0,1]$, $\lambda(U)=\lambda(f^{-1}(U))$.

First, note that $f$ is surjective, because otherwise the image of $f$ is a
proper subinterval $[a,b]\subsetneq[0,1]$ and
$\lambda(f^{-1}([a,b]))=\lambda([0,1])=1>\lambda([a,b])=b-a$, which
contradicts measure-preservation.

Define the open ball $B(x,r)=\\{y\in[0,1]\mid|y-x|<r\\}$. Suppose that
$f^{\prime}(0)=0$ for some $x\in[0,1]$. Then there exists an $r>0$ such that
$f(B(x,r))\subseteq B(f(x),r/4)$, and thus $B(x,r)\subseteq
f^{-1}(B(f(x),r/4))$. Therefore,
$r\leq\lambda(B(x,r))\leq\lambda(f^{-1}(B(f(x),r/4)))$, while
$\lambda(B(f(x),r/4))\leq 2\cdot r/4=r/2$, contradicting measure preservation.
Hence $f^{\prime}(x)\neq 0$ on $[0,1]$.

By the Darboux theorem, $f^{\prime}$ is either strictly positive or strictly
negative on the interval and thus $f$ is either strictly increasing or
decreasing and thus a bijection. Assume that it is strictly increasing, then
$\forall
x\in[0,1],x=\lambda([0,x])=\lambda(f^{-1}(f([0,x])))=\lambda(f([0,x]))=f(x)-f(0)=f(x)$.
Similarly, if it is strictly decreasing, we find $f(x)=1-x$. ∎

######  Lemma 2.

Let $A=C=\mathbb{R}$ and $B=\mathbb{R}^{n}$. Let $f:A\times B\to C$ be
differentiable. Define differentiable measures $p_{A}$ on $A$ and $p_{C}$ on
$C$. Let $\forall b\in B$, $f(\cdot,b):A\to C$ be measure-preserving. Then $f$
is constant in $B$.

###### Proof.

Let $P_{A}:A\to[0,1],P_{C}:C\to[0,1]$ be the diffeomorphic cumulative density
functions. Then $P_{A}^{-1}$ and $P_{C}^{-1}$ are measure-preserving maps from
the uniform distribution on $[0,1]$. Now write $g:[0,1]\times
B\to[0,1]:(z,b)\mapsto P_{C}(f(P_{A}^{-1}(z),b))$ such that this diagram of
measure-preserving differentiable maps commutes:

${A}$${C}$${{[0,1]}}$${{[0,1]}}$$\scriptstyle{f(\cdot,b)}$$\scriptstyle{P_{A}}$$\scriptstyle{P_{C}^{-1}}$$\scriptstyle{g(\cdot,b)}$

Then $g$ is differentiable and $\forall b\in B$ measure-preserving
$[0,1]\to[0,1]$. By the previous Lemma 1, the only differentiable measure-
preserving functions $[0,1]\to[0,1]$ are $\operatorname{id}$ and
$1-\operatorname{id}$. As $g$ is continuous in $B$, it can not vary between
$\operatorname{id}$ and $1-\operatorname{id}$ and thus $g$, and consequently
$f$ are constant in $B$. ∎

We can interpret this lemma in terms of statistical independence. Starting
from a product measure on $A\times B$, the requirements of the lemma
correspond to $a{\perp\\!\\!\\!\perp}b$ and $c{\perp\\!\\!\\!\perp}b$. The
lemma thus defines a sense in which for real-valued variables, statistical
independence implies functional independence (the converse is always true).

Now in the remainder of this subsection, we prove the main theorem.

######  Theorem 1 (Identifiability of $\mathbb{R}$-valued LCMs from weak
supervision).

Let
$\mathcal{M}=\langle\mathcal{C},\mathcal{X},g,\mathcal{I},p_{\mathcal{I}}\rangle$
and
$\mathcal{M}^{\prime}=\langle\mathcal{C}^{\prime},\mathcal{X},g^{\prime},\mathcal{I}^{\prime},p^{\prime}_{\mathcal{I}^{\prime}}\rangle$
be LCMs with the following properties:

  * •

The SCMs $\mathcal{C}$ and $\mathcal{C}^{\prime}$ both consist of $n$ real-
valued endogeneous variables, i. e.
$\mathcal{E}_{i}=\mathcal{Z}_{i}=\mathcal{Z}^{\prime}_{i}=\mathcal{E}^{\prime}_{i}=\mathbb{R}$.

  * •

The intervention sets $\mathcal{I}$ and $\mathcal{I}^{\prime}$ consist of the
empty intervention and all atomic interventions,
$\mathcal{I}=\\{\emptyset,\\{z_{0}\\},\dots,\\{z_{n}\\}\\}$ and similar for
$\mathcal{I}^{\prime}$.

  * •

The intervention distribution $p_{\mathcal{I}}$ and
$p^{\prime}_{\mathcal{I}^{\prime}}$ have full support.

Then the following two statements are equivalent:

  1. 1.

The weakly supervised distributions entailed by the LCMs are equal,
$p_{\mathcal{M}}(x,\tilde{x})=p_{{\mathcal{M}^{\prime}}}(x,\tilde{x})$.

  2. 2.

The LCMs are equivalent, $\mathcal{M}\sim\mathcal{M}^{\prime}$.

###### Proof.

“$(2)\Rightarrow(1)$”: If the LCMs are equivalent, then the fact that
$\varphi_{\mathcal{E}}$ and $\tilde{\varphi}_{\mathcal{E}}$ are measure
preserving and that diagrams (5) and (6) commute, implies that
$p_{\mathcal{C}^{\prime}}^{\mathcal{Z}^{\prime}}=(\varphi_{\mathcal{Z}},\varphi_{\mathcal{Z}})_{*}p_{\mathcal{C}}^{\mathcal{Z}}$.
Then because diagram (7) commutes, the weakly supervised distributions
coincide,
$p_{\mathcal{M}^{\prime}}^{\mathcal{X}}=p_{\mathcal{M}}^{\mathcal{X}}$.

“$(1)\Rightarrow(2)$”: Conversely, if the weakly supervised distributions
coincide,
$p_{\mathcal{M}^{\prime}}^{\mathcal{X}}=p_{\mathcal{M}}^{\mathcal{X}}$, the
images of
$g:\mathcal{Z}\to\mathcal{X},g^{\prime}:\mathcal{Z}^{\prime}\to\mathcal{X}$
coincide,

$\varphi=g^{\prime-1}\circ g:\mathcal{Z}\to\mathcal{Z}^{\prime}$ (9)

is a diffeomorphism, and $\varphi$ preserves the weakly supervised
distribution over causal variables:
$p_{\mathcal{C}^{\prime}}^{\mathcal{Z}^{\prime}}=(\varphi,\varphi)_{*}p_{\mathcal{C}}^{\mathcal{Z}}$.

LCM equivalence then follows from showing that
$\varphi:\mathcal{D}\to\mathcal{D}^{\prime}$ is an ISCM isomorphism, where
$\mathcal{D}=\langle\mathcal{C},\mathcal{I},p_{\mathcal{I}}\rangle$ and
$\mathcal{D}^{\prime}=\langle\mathcal{C}^{\prime},\mathcal{I}^{\prime},p^{\prime}_{\mathcal{I}^{\prime}}\rangle$
be the ISCMs inherent to $\mathcal{M}$ and $\mathcal{M}^{\prime}$. We show
this in the following steps:

  1. 1.

For each intervention $I$ in $\mathcal{D}$, there is a corresponding
intervention $I^{\prime}$ in $\mathcal{D}^{\prime}$, given by a permutation
$\psi:[n]\to[n]$, such that $\varphi$ preserves the interventional
distribution.

  2. 2.

The diffeomorphism $\varphi$ is $\psi$-diagonal.

  3. 3.

The permutation $\psi$ preserved the ancestry structure of graphs
$\mathcal{G}(\mathcal{C})$ and $\mathcal{G}(\mathcal{C}^{\prime})$.

  4. 4.

The diffeomorphism $\varphi_{\mathcal{E}}:\mathcal{E}\to\mathcal{E}$ of noise
variables is $\psi$-diagonal.

  5. 5.

The causal mechanisms are compatible with $\varphi$.

#### Step 1: Interventions preserved

Remember that the diffeomorphism $\varphi:\mathcal{Z}\to\mathcal{Z}^{\prime}$
is such that
$p_{\mathcal{C}^{\prime}}^{\mathcal{Z}^{\prime}}=(\varphi,\varphi)_{*}p_{\mathcal{C}}^{\mathcal{Z}}$.
For atomic interventions $I\neq J\in\mathcal{I}$, consider the intersection of
the supports of the weakly supervised distribution for interventions on $I$
and $J$:
$U=\operatorname{supp}p_{\mathcal{C}}^{\mathcal{Z},\mathcal{I}}(z,\tilde{z}\mid
I)\cap\operatorname{supp}p_{\mathcal{C}}^{\mathcal{Z},\mathcal{I}}(z,\tilde{z}\mid
J)\subset\mathcal{Z}\times\mathcal{Z}$. Note that $U$ has zero measure in
$p_{\mathcal{C}}^{\mathcal{Z},\mathcal{I}}(U\mid
I)=p_{\mathcal{C}}^{\mathcal{Z},\mathcal{I}}(U\mid J)=0$. The distribution is
thus a discrete mixture on $(z,\tilde{z})$ of non-overlapping distributions.

The diffeormorphism $(\varphi,\varphi)$ must map between these mixtures. Thus
there exists a bijection $\psi:\mathcal{I}\to\mathcal{I}^{\prime}$, also
inducing a permutation $\psi:[n]\to[n]$, such that

$p_{\mathcal{C}^{\prime}}^{\mathcal{Z}^{\prime},\mathcal{I}^{\prime}}=(\varphi,\varphi,\psi)_{*}p_{\mathcal{C}}^{\mathcal{Z},\mathcal{I}}\,.$

#### Step 2: $\varphi$ is $\psi$-diagonal

This measure preservation lets us define two equal distributions on
$\mathcal{Z}\times\widetilde{\mathcal{Z}}^{\prime}\times\mathcal{I}$, namely
$(\operatorname{id}_{\mathcal{Z}},\varphi,\operatorname{id}_{\mathcal{I}})_{*}p_{\mathcal{C}}^{\mathcal{Z},\mathcal{I}}$
and
$(\varphi^{-1},\operatorname{id}_{\widetilde{\mathcal{Z}}^{\prime}},\psi^{-1})_{*}p_{\mathcal{C}^{\prime}}^{\mathcal{Z}^{\prime},\mathcal{I}^{\prime}}$.
In particular, these must then have equal conditionals
$p(\tilde{z}^{\prime}\mid z,I)$. Thus, for any
$U\subseteq\widetilde{\mathcal{Z}}^{\prime},z\in\mathcal{Z},I\in\mathcal{I}$,

$p_{\mathcal{C}^{\prime}}^{\mathcal{Z}^{\prime},\mathcal{I}^{\prime}}(\tilde{z}^{\prime}\in
U\mid\varphi(z),\psi(I))=p_{\mathcal{C}}^{\mathcal{Z},\mathcal{I}}(\tilde{z}\in\varphi^{-1}(U)\mid
z,I)$

The conditional probability
$p_{\mathcal{C}}^{\mathcal{Z},\mathcal{I}}(\tilde{z}\mid z,I)$ can be
interpreted as a stochastic map $\mathcal{Z}\to\tilde{\mathcal{Z}}$. The above
relation can then be written as a commuting diagram of stochastic maps,
$\forall I\in\mathcal{I},I^{\prime}=\psi(I)$:

${\mathcal{Z}}$${{\tilde{\mathcal{Z}}}}$${{\mathcal{Z}^{\prime}}}$${{\tilde{\mathcal{Z}}^{\prime}}}$$\scriptstyle{p_{\mathcal{C}}^{\mathcal{Z},\mathcal{I}}(\tilde{z}\mid
z,I)}$$\scriptstyle{p_{\mathcal{C}^{\prime}}^{\mathcal{Z}^{\prime},\mathcal{I}^{\prime}}(\tilde{z}^{\prime}\mid
z^{\prime},I^{\prime})}$$\scriptstyle{\varphi}$$\scriptstyle{\varphi}$ (10)

where we treat $\varphi:\mathcal{Z}\to\mathcal{Z}^{\prime}$ as a deterministic
stochastic map.

For any variable $i\in[n]$, write the other nodes as $o=[n]\setminus\\{i\\}$.
Let $I=\\{i\\}$. Then $p_{\mathcal{C}}^{\mathcal{Z},\mathcal{I}}(\tilde{z}\mid
z,I)$ can be written as a string diagram of stochastic maps:

$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$

This string diagram represents a conditional probability distribution
$p(\tilde{z}_{i},\tilde{z}_{o}\mid z)$ and is read from the bottom to the top.
String diagrams map formally to a generative process [36] and have been used
previously in the context of causal models [37]. In this case, the diagram
maps to:

$\tilde{z}_{i}\sim
p(\tilde{z}_{i}),\quad\tilde{z}_{o}=\hat{f}_{o}(\tilde{z}_{i},z)$

where $p(\tilde{z}_{i})$ is the interventional distribution and the
deterministic map
$\hat{f}_{o}:\widetilde{\mathcal{Z}}_{i}\times\mathcal{Z}\to\widetilde{\mathcal{Z}}_{o}$
can be constructed from the inverse solution
$s^{-1}:\mathcal{Z}\to\mathcal{E}$ and the causal mechanisms. Each box in a
string diagram of stochastic maps denotes a stochastic map and each line to a
measurable space. The triangle is the stochastic map
$\star\to\widetilde{\mathcal{Z}}_{i}$ (the star denoting the one-point space;
maps from which correspond to probability distributions over the codomain).
The $\bullet$ represents copying a variable.

The above commuting diagram (10) can then be written as the equality of the
following two string diagrams, where
$\psi(I)=I^{\prime}=\\{i^{\prime}\\},o^{\prime}=[n]\setminus\\{i^{\prime}\\}$.
We write $\varphi:\mathcal{Z}\to\mathcal{Z}^{\prime}$ as the pair
$\varphi_{i^{\prime}}:\mathcal{Z}\to\mathcal{Z}^{\prime}_{i^{\prime}},\varphi_{o^{\prime}}:\mathcal{Z}\to\mathcal{Z}^{\prime}_{o^{\prime}}$
obtained by projecting the output of $\varphi$ to the partition
$\mathcal{Z}^{\prime}=\mathcal{Z}^{\prime}_{i^{\prime}}\times\mathcal{Z}^{\prime}_{o^{\prime}}$:

$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$\hat{f}^{\prime}_{o^{\prime}}$$z^{\prime}$$\varphi$$z$$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\varphi_{o^{\prime}}$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$=$
(11)

This should be read as the equality of the two conditional probability
distributions
$p(\tilde{z}^{\prime}_{i^{\prime}},\tilde{z}^{\prime}_{o^{\prime}}\mid z)$
generated in the following way:

Left: $\displaystyle\tilde{z}_{i}\sim p(\tilde{z}_{i})\,,$
$\displaystyle\tilde{z}_{o}$ $\displaystyle=\hat{f}_{o}(\tilde{z}_{i},z)\,,$
$\displaystyle\tilde{z}^{\prime}_{i^{\prime}}$
$\displaystyle=\varphi(\tilde{z}_{i},\tilde{z}_{o})_{i^{\prime}}\,,$
$\displaystyle\tilde{z}_{o^{\prime}}$
$\displaystyle=\varphi(\tilde{z}_{i},\tilde{z}_{o})_{o^{\prime}}\,.$ Right:
$\displaystyle z^{\prime}=\varphi(z)\,,$
$\displaystyle\tilde{z}^{\prime}_{i^{\prime}}$ $\displaystyle\sim
p^{\prime}(\tilde{z}^{\prime}_{i^{\prime}})\,,$
$\displaystyle\tilde{z}^{\prime}_{o^{\prime}}$
$\displaystyle=f^{\prime}_{o^{\prime}}(\tilde{z}^{\prime}_{i^{\prime}},z^{\prime})\,.$

The string diagram equality (11) implies equality when we disregard outputs
$\mathcal{Z}^{\prime}_{o^{\prime}}$:

$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$\hat{f}^{\prime}_{o^{\prime}}$$z^{\prime}$$\varphi$$z$$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\varphi_{o^{\prime}}$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$=$$\tilde{z}^{\prime}_{i^{\prime}}$$z$$\tilde{z}_{i}$$\hat{f}_{o}$$z$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$

where the upwards pointing triangle represents discarding a variable.

Using Lemma 2, and the fact that
$\widetilde{\mathcal{Z}}_{i}=\widetilde{\mathcal{Z}}^{\prime}_{i^{\prime}}=\mathbb{R}$,
the composed differentiable function
$\widetilde{\mathcal{Z}}_{i}\times\mathcal{Z}\to\widetilde{\mathcal{Z}}^{\prime}_{i^{\prime}}$
is constant in $\mathcal{Z}$. Thus we have a deterministic function
$\widetilde{\mathcal{Z}}_{i}\to\widetilde{\mathcal{Z}}^{\prime}_{i^{\prime}}$
such that:

$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$\hat{f}^{\prime}_{o^{\prime}}$$z^{\prime}$$\varphi$$z$$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\varphi_{o^{\prime}}$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$=$$\tilde{z}^{\prime}_{i^{\prime}}$$z$$\tilde{z}_{i}$$\hat{f}_{o}$$z$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}^{\prime}_{i^{\prime}}$$z$$\tilde{z}_{i}$$\hat{f}_{o}$$z$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}_{i}$

The deterministic function
$\widetilde{\mathcal{Z}}_{i}\times\mathcal{Z}\to\widetilde{\mathcal{Z}}_{i}\times\widetilde{\mathcal{Z}}_{o}$
is surjective and both the left- and right-hand side can be seen as first
applying this function (though the output is discarded on the right hand
side), which implies there exists a function
$\widetilde{\mathcal{Z}}_{i}\to\widetilde{\mathcal{Z}}^{\prime}_{i^{\prime}}$
such that

$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$\hat{f}^{\prime}_{o^{\prime}}$$z^{\prime}$$\varphi$$z$$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\varphi_{o^{\prime}}$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$=$$\tilde{z}^{\prime}_{i^{\prime}}$$z$$\tilde{z}_{i}$$\hat{f}_{o}$$z$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}^{\prime}_{i^{\prime}}$$z$$\tilde{z}_{i}$$\hat{f}_{o}$$z$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}_{i}$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}_{o}$$\tilde{z}_{i}$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}_{i}$

In words, the function
$\varphi_{i^{\prime}}:\mathcal{Z}_{i}\times\mathcal{Z}_{o}\to\mathcal{Z}^{\prime}_{i^{\prime}}$
is constant in $\mathcal{Z}_{o}$. This holds for all $i$ and thus $\varphi$ is
$\psi$-diagonal.

#### Step 3: Ancestry preserved

Let $i\neq j\in[n]$, $i^{\prime}=\psi(i)$, $j^{\prime}=\psi(j)$, and
$I=\\{i\\}$. Writing $\varphi$ as $\psi$-diagonal, the commuting diagram (10)
for the $j^{\prime}$ component of $\tilde{z}^{\prime}$, can be written as the
following string diagram:

$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$\hat{f}^{\prime}_{o^{\prime}}$$z^{\prime}$$\varphi$$z$$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\varphi_{o^{\prime}}$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$=$$\tilde{z}^{\prime}_{i^{\prime}}$$z$$\tilde{z}_{i}$$\hat{f}_{o}$$z$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}^{\prime}_{i^{\prime}}$$z$$\tilde{z}_{i}$$\hat{f}_{o}$$z$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}_{i}$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}_{o}$$\tilde{z}_{i}$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}_{i}$$\tilde{z}^{\prime}_{j^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$\hat{f}^{\prime}_{j^{\prime}}$$z^{\prime}$$\varphi$$z$$\tilde{z}_{j}$$\tilde{z}_{i}$$\hat{f}_{j}$$z$$\varphi_{j^{\prime}}$$\tilde{z}^{\prime}_{j^{\prime}}$$=$

The left hand side is a deterministic map
$\mathcal{Z}\to\widetilde{\mathcal{Z}}^{\prime}_{j^{\prime}}$ if and only if
$\hat{f}_{j}$ is constant in $\widetilde{\mathcal{Z}}_{i}$ which by
faithfulness is the case if and only if $i\not\in\mathrm{\mathbf{anc}}_{j}$.
The same holds on the right hand side, so $\forall i\neq j\in[n]$,
$i\in\mathrm{\mathbf{anc}}^{\mathcal{C}}_{j}\iff\psi(i)\in\mathrm{\mathbf{anc}}^{\mathcal{C}^{\prime}}_{\psi(j)}$.

#### Step 4: Noise map diagonal

Define $\varphi_{\mathcal{E}}=s^{\prime-1}\circ\varphi\circ
s:\mathcal{E}\to\mathcal{E}^{\prime}$. Note that
$\varphi_{\mathcal{E}}(\epsilon)_{i^{\prime}}$ only depends on $\epsilon_{i}$
and $\epsilon_{\mathrm{\mathbf{anc}}_{i}}$, because
$s(\epsilon)_{\mathrm{\mathbf{anc}}_{i},i}$ and
$s^{\prime-1}(z^{\prime})_{i^{\prime}}$ only depend on ancestors, $\varphi$ is
$\psi$-diagonal and $\psi$ preserves ancestry.

The map $\varphi$ is measure-preserving. Thus $\forall i$ and writing
$A=\mathrm{\mathbf{anc}}_{i}$, the conditional $p(z_{i}\mid z_{A})=p(z_{i}\mid
z_{\mathrm{\mathbf{pa}}_{i}})$, interpreted as a stochastic map, is preserved
by $\varphi$. We can express this as another commuting diagram, in which the
two paths from $\mathcal{E}_{A}$ to $\mathcal{E}^{\prime}_{i^{\prime}}$ must
be equal:

$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$\hat{f}^{\prime}_{o^{\prime}}$$z^{\prime}$$\varphi$$z$$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\varphi_{o^{\prime}}$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$=$$\tilde{z}^{\prime}_{i^{\prime}}$$z$$\tilde{z}_{i}$$\hat{f}_{o}$$z$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}^{\prime}_{i^{\prime}}$$z$$\tilde{z}_{i}$$\hat{f}_{o}$$z$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}_{i}$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}_{o}$$\tilde{z}_{i}$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}_{i}$$\tilde{z}^{\prime}_{j^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$\hat{f}^{\prime}_{j^{\prime}}$$z^{\prime}$$\varphi$$z$$\tilde{z}_{j}$$\tilde{z}_{i}$$\hat{f}_{j}$$z$$\varphi_{j^{\prime}}$$\tilde{z}^{\prime}_{j^{\prime}}$$=$${{\mathcal{E}_{A}}}$${{\mathcal{Z}_{A}}}$${{\mathcal{Z}_{A,i}}}$${{\mathcal{Z}^{\prime}_{A^{\prime}}}}$${{\mathcal{Z}^{\prime}_{A^{\prime},i^{\prime}}}}$${{\mathcal{E}^{\prime}_{i^{\prime}}}}$$\scriptstyle{p(z_{i}|z_{\mathrm{\mathbf{pa}}_{i}})}$$\scriptstyle{\varphi_{A}}$$\scriptstyle{\varphi_{A,i}}$$\scriptstyle{p(z^{\prime}_{i^{\prime}}|z^{\prime}_{\mathrm{\mathbf{pa}}_{i^{\prime}}})}$$\scriptstyle{{f^{\prime}_{i^{\prime}}}^{-1}}$$\scriptstyle{s_{A}}$

where
${f^{\prime}_{i^{\prime}}}^{-1}(z^{\prime})=f(z^{\prime}_{\mathrm{\mathbf{pa}}_{i^{\prime}}},\cdot)^{-1}(z^{\prime}_{i^{\prime}})$.
Then we have:

$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$\hat{f}^{\prime}_{o^{\prime}}$$z^{\prime}$$\varphi$$z$$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\varphi_{o^{\prime}}$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$=$$\tilde{z}^{\prime}_{i^{\prime}}$$z$$\tilde{z}_{i}$$\hat{f}_{o}$$z$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}^{\prime}_{i^{\prime}}$$z$$\tilde{z}_{i}$$\hat{f}_{o}$$z$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}_{i}$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}_{o}$$\tilde{z}_{i}$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}_{i}$$\tilde{z}^{\prime}_{j^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$\hat{f}^{\prime}_{j^{\prime}}$$z^{\prime}$$\varphi$$z$$\tilde{z}_{j}$$\tilde{z}_{i}$$\hat{f}_{j}$$z$$\varphi_{j^{\prime}}$$\tilde{z}^{\prime}_{j^{\prime}}$$=$$\epsilon_{i}$$f_{i}$$\varphi_{A^{\prime}}$$\varphi_{i^{\prime}}$${f^{\prime}_{i^{\prime}}}^{-1}$$z_{i}$$\epsilon^{\prime}_{i^{\prime}}$$z_{A}$$z^{\prime}_{A^{\prime}}$$z^{\prime}_{i^{\prime}}$$\epsilon^{\prime}_{i^{\prime}}$$f^{\prime}_{i^{\prime}}$$\varphi_{A^{\prime}}$${f^{\prime}_{i^{\prime}}}^{-1}$$\epsilon^{\prime}_{i^{\prime}}$$z_{A}$$z^{\prime}_{A^{\prime}}$$z^{\prime}_{i^{\prime}}$$\epsilon^{\prime}_{i^{\prime}}$$\epsilon_{A}$$\stackrel{{\scriptstyle(2)}}{{=}}$$\stackrel{{\scriptstyle(3)}}{{=}}$$\epsilon_{A}$$s_{A}$$\epsilon_{A}$$s_{A}$$\epsilon_{i}$$\varphi_{\mathcal{E},i^{\prime}}$$\epsilon^{\prime}_{i^{\prime}}$$\epsilon_{A}$$\stackrel{{\scriptstyle(1)}}{{=}}$

where the first equality follows from the definition of
$\varphi_{\mathcal{E},i^{\prime}}$, the second equality from the commuting
diagram above and the third equality from the fact that
$f^{\prime}_{i^{\prime}}$ and ${f^{\prime}_{i^{\prime}}}^{-1}$ cancel. Then,
again using Lemma 2, the map on the left hand side must be constant in
$\epsilon_{A}$. The noise encoding is thus also $\psi$-diagonal.

#### Step 5: Equivalence

Consider for a variable $i$ and with $i^{\prime}=\psi(i)$ the following
commuting diagram of deterministic maps. Note that we write the causal
mechanism $f_{i}$ as a function of all ancestors, not just the parents, so it
is constant in the non-parents. Because of faithfulness, it is non-constant in
the parents. Since $\psi$ preserves ancestors, $f^{\prime}_{i^{\prime}}$ is
well-typed.

$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$\hat{f}^{\prime}_{o^{\prime}}$$z^{\prime}$$\varphi$$z$$\tilde{z}_{i}$$\tilde{z}_{o}$$\hat{f}_{o}$$z$$\varphi_{o^{\prime}}$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}^{\prime}_{o^{\prime}}$$=$$\tilde{z}^{\prime}_{i^{\prime}}$$z$$\tilde{z}_{i}$$\hat{f}_{o}$$z$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}^{\prime}_{i^{\prime}}$$z$$\tilde{z}_{i}$$\hat{f}_{o}$$z$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}_{i}$$\tilde{z}^{\prime}_{i^{\prime}}$$\tilde{z}_{o}$$\tilde{z}_{i}$$\varphi_{i^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$=$$\tilde{z}_{o}$$\tilde{z}_{i}$$\tilde{z}^{\prime}_{j^{\prime}}$$\tilde{z}^{\prime}_{i^{\prime}}$$\hat{f}^{\prime}_{j^{\prime}}$$z^{\prime}$$\varphi$$z$$\tilde{z}_{j}$$\tilde{z}_{i}$$\hat{f}_{j}$$z$$\varphi_{j^{\prime}}$$\tilde{z}^{\prime}_{j^{\prime}}$$=$$\epsilon_{i}$$f_{i}$$\varphi_{A^{\prime}}$$\varphi_{i^{\prime}}$${f^{\prime}_{i^{\prime}}}^{-1}$$z_{i}$$\epsilon^{\prime}_{i^{\prime}}$$z_{A}$$z^{\prime}_{A^{\prime}}$$z^{\prime}_{i^{\prime}}$$\epsilon^{\prime}_{i^{\prime}}$$f^{\prime}_{i^{\prime}}$$\varphi_{A^{\prime}}$${f^{\prime}_{i^{\prime}}}^{-1}$$\epsilon^{\prime}_{i^{\prime}}$$z_{A}$$z^{\prime}_{A^{\prime}}$$z^{\prime}_{i^{\prime}}$$\epsilon^{\prime}_{i^{\prime}}$$\epsilon_{A}$$\stackrel{{\scriptstyle(2)}}{{=}}$$\stackrel{{\scriptstyle(3)}}{{=}}$$\epsilon_{A}$$s_{A}$$\epsilon_{A}$$s_{A}$$\epsilon_{i}$$\varphi_{\mathcal{E},i^{\prime}}$$\epsilon^{\prime}_{i^{\prime}}$$\epsilon_{A}$$\stackrel{{\scriptstyle(1)}}{{=}}$${\mathcal{E}}$${{\mathcal{E}^{\prime}}}$${{\mathcal{Z}_{\mathrm{\mathbf{anc}}_{i}}\times\mathcal{E}_{i}}}$${{\mathcal{Z}^{\prime}_{\mathrm{\mathbf{anc}}_{i^{\prime}}}\times\mathcal{E}^{\prime}_{i^{\prime}}}}$${{\mathcal{Z}_{i}}}$${{\mathcal{Z}^{\prime}_{i^{\prime}}}}$$\scriptstyle{\varphi_{\mathcal{E}}}$$\scriptstyle{\varphi_{\mathcal{Z},i}}$$\scriptstyle{(s_{\mathrm{\mathbf{anc}}_{i}},\operatorname{id}_{\mathcal{E}_{i}})}$$\scriptstyle{(s^{\prime}_{\mathrm{\mathbf{anc}}_{i^{\prime}}},\operatorname{id}_{\mathcal{E}^{\prime}_{i^{\prime}}})}$$\scriptstyle{f_{i}}$$\scriptstyle{f^{\prime}_{i^{\prime}}}$$\scriptstyle{(\varphi_{\mathcal{Z},\mathrm{\mathbf{anc}}_{i}},\varphi_{\mathcal{E},i})}$

The composition of the left vertical maps is equal to $s_{i}$, the composition
of the right vertical maps to $s^{\prime}_{i^{\prime}}$. Therefore and because
of the definition of $\varphi_{\mathcal{E}}$, the outer and the top square
commute. Then, because
$(s_{\mathrm{\mathbf{anc}}_{i}},\operatorname{id}_{\mathcal{E}_{i}})$ is
surjective, the bottom square also commutes [38, Lemma 1.6.21].

Then for $z_{j}\in\mathrm{\mathbf{anc}}_{i}$, we have that

$\displaystyle z_{j}\in\mathrm{\mathbf{pa}}^{\mathcal{C}}_{i}\iff f_{i}\text{
not constant in }z_{j}\iff f^{\prime}_{i^{\prime}}\text{ not constant in
}z^{\prime}_{j^{\prime}}\iff
z^{\prime}_{j^{\prime}}\in\mathrm{\mathbf{pa}}^{\mathcal{C}^{\prime}}_{i^{\prime}}\,.$

And thus $\psi$ not only preserves ancestry, but also parenthood and is thus a
graph isomorphism
$\psi:\mathcal{G}(\mathcal{C})\to\mathcal{G}(\mathcal{C}^{\prime})$. Diagram
(5) commutes, and we have established an SCM isomorphism
$\varphi:\mathcal{C}\to\mathcal{C}^{\prime}$.

To have this also be an ISCM isomorphism, we need diagram $\eqref{cd:iscm-
iso}$ to commute and the distribution over interventions to be preserved. For
the first, use the fact that all maps in (6) are isomorphisms to simply define
$\tilde{\varphi}_{\mathcal{E}}$ so that the diagram commutes. The second
follows directly from the assumptions. Hence
$\varphi:\mathcal{D}\to\mathcal{D}^{\prime}$ is an ISCM isomorphism,
$\mathcal{D}\sim\mathcal{D}^{\prime}$, and—together with the arguments in the
beginning of this proof—finally $\mathcal{M}\sim\mathcal{M}^{\prime}$. ∎

##  Appendix B Limitations & generalization

Our identifiability result relies on a few assumptions. Here we discuss some
key requirements of Thm. 1 and whether they can be relaxed.

#### Diffeomorphic causal mechanisms

In Def. 4, we require causal mechanisms to be pointwise diffeomorphisms from
noise variables to causal variables. Under some mild smoothness assumptions,
any SCM can be brought into this form by elementwise redefinitions of the
variables, without affecting the observational or interventional
distributions. However, such a redefinition may change counterfactual / weakly
supervised distributions.

#### All interventions observed

To guarantee identifiability, we require that the intervention distribution
has support for any atomic intervention: datasets need to contain data pairs
generated from interventions on any causal variable. However, in many systems
not all variables can be intervened upon, for instance because some variables
are fundamentally immutable or for safety reasons. In that case, the LCM may
not be fully identifiable, but there may still be partial identifiability.
Interventions on child variables, for instance, can guarantee the
identifiability of the parents [14]. We leave a precise characterization of
the equivalence classes under such partial weak supervision for future work.

#### Perfect interventions

Our proof of Thm. 1 requires perfect interventions, i. e. that intervened-upon
mechanisms do not depend on any causal variables. This is arguably the biggest
mismatch between our assumptions and many real-world systems.

If we try to generalize this assumption and allow the intervention mechanisms
to depend on the parent variables, identifiability is lost. A simple
counterexample is the following.

######  Example 1 (Non-identifiable ISMCs under imperfect interventions).

Consider two inequivalent ISCMs $\mathcal{D},\mathcal{D}^{\prime}$, each with
two variables and graph $z_{1}\to z_{2}$. Let the mechanisms be equal, except
that $f^{\prime}_{2}(\epsilon_{2};z_{1})=f_{2}(\epsilon_{2};z_{1})+z_{1}$ and
$\tilde{f}^{\prime}_{2}(\tilde{\epsilon}_{2};z_{1})=\tilde{f}_{2}(\tilde{\epsilon}_{2};z_{1})+z_{1}$.
Then it is easy to see that a $\phi$ that is the identity on the first
variable and on the second variable is $\phi_{2}(z_{1},z_{2})=z_{1}+z_{2}$,
preserves the weakly supervised distribution, but is not an ISCM isomorphism.

#### Diffeomorphic decoder

Definition 1 and Thm. 1 assume that the map from causal variables to observed
data is given by a deterministic, diffeomorphic decoder. However, our
practical implementation in a VAE uses a stochastic decoder and allows for
noisy data. Our experiments provide empirical evidence for identifiability in
this setting. We believe that it may be possible to extend Thm. 1 to
stochastic decoders, similarly to Khemakhem et al. [8]. We plan to study this
extension in future work.

Independent of whether the decoder is deterministic or stochastic, however, is
the requirement that the value of all causal variables need to be reflected in
the observed low-level data. Our approach (and as far as we are aware all
other methods for causal representation learning) is not able to detect causal
variables that do not directly influence the low-level data. Latent
confounders, present in many real-world problems, provide an as-of-now
unsolved hurdle to causal representation learning.

#### Real-valued causal variables

Theorem 1 assumes real-valued causal and noise variables,
$\mathcal{Z}_{i}=\mathcal{E}_{i}=\mathbb{R}$. We can easily extend this to
intervals $(a,b)\in\mathbb{R}$, as these are isomorphic to $\mathbb{R}$.
However, the extension to arbitrary continuous spaces or $\mathbb{R}^{n}$ is
not straightforward. The main reason is that our proof relies on Lemma 2,
which does not generalize.

Let us provide a counterexample for identifiability with circle $S^{1}$-valued
causal variables.

######  Example 2 ($S^{1}$-valued non-identifiable LCMs).

Consider an LCM
$\mathcal{M}=\langle\mathcal{C},\mathcal{X},g,\mathcal{I},p_{\mathcal{I}}\rangle$
with the following components:

  * •

The SCM $\mathcal{C}$ consists of two circle-valued variables $z_{1},z_{2}\in
S^{1}$ with noise variables $\epsilon_{1},\epsilon_{2}\in S^{1}$. We
parameterize $S^{1}$ as $[0,2\pi)$ with addition defined modulo $2\pi$.

  * •

The causal graph is $z_{1}\to z_{2}$.

  * •

The causal mechanisms are $f_{1}(\epsilon_{1})=\epsilon_{1}$ and
$f_{2}(\epsilon_{2};z_{1})=\epsilon_{2}+z_{1}$.

  * •

The solution function is
$s(\epsilon_{1},\epsilon_{2})=(\epsilon_{1},\epsilon_{2}+\epsilon_{1})$.

  * •

The noise variables are distributed as $\epsilon_{1}\sim\mathcal{U}$,
uniformly, and $\epsilon_{2}\sim q$, which we require to not be invariant
under translations (so in particular not uniform). For example, one can take
the von Mises distribution $\log
q(\epsilon_{2})=\cos(\epsilon_{2})+\textup{const}$.

  * •

The observation space is $\mathcal{X}$ and the decoder $g:S^{1}\times
S^{1}\to\mathcal{X}$ is diffeomorphic.

  * •

The intervention set $\mathcal{I}$ consists of the empty intervention, atomic
interventions on $z_{1}$ with $\tilde{z}_{1}\sim\mathcal{U}$, and atomic
interventions on $z_{2}$ with $\tilde{z}_{2}\sim\mathcal{U}$. Each of these
interventions has probability $\frac{1}{3}$ in $p_{\mathcal{I}}$.

Note that the SCM is faithful, as $z_{1}{{\perp\\!\\!\\!\not\perp}}z_{2}$ in
the observational distribution, because $q$ is not translationally invariant.
The LCM entails the weakly supervised causal distribution

$p_{\mathcal{C}}^{\mathcal{Z}}(z,\tilde{z})=\mathcal{U}(z_{1})\;q(z_{2}-z_{1})\;\biggl{[}\frac{1}{3}\;\delta(\tilde{z}_{1}-z_{1})\;\delta(\tilde{z}_{2}-z_{2})\\\
+\frac{1}{3}\;\mathcal{U}(\tilde{z}_{1})\;\delta(\tilde{z}_{2}-z_{2}-\tilde{z}_{1}+z_{1})+\frac{1}{3}\;\delta(\tilde{z}_{1}-z_{1})\;\mathcal{U}(\tilde{z}_{2})\biggr{]}$
(12)

with Dirac delta $\delta$. The weakly supervised data distribution is then
given by
$p_{\mathcal{M}}^{\mathcal{X}}=(g_{*},g_{*})p_{\mathcal{C}}^{\mathcal{Z}}$.

Now consider a second LCM
$\mathcal{M}^{\prime}=\langle\mathcal{C}^{\prime},\mathcal{X},g^{\prime},\mathcal{I}^{\prime},p^{\prime}_{\mathcal{I}^{\prime}}\rangle$:

  * •

The SCM $\mathcal{C}^{\prime}$ consists of two circle-valued variables
$z^{\prime}_{1},z^{\prime}_{2}\in S^{1}$ with noise variables
$\epsilon^{\prime}_{1},\epsilon^{\prime}_{2}\in S^{1}$.

  * •

The causal graph is trivial and the causal mechanisms are given by the
identity, $f^{\prime}_{i}(\epsilon^{\prime}_{i})=\epsilon^{\prime}_{i}$.

  * •

The noise variables are distributed as $\epsilon^{\prime}_{1}\sim\mathcal{U}$
and $\epsilon^{\prime}_{2}\sim q$.

  * •

The observation space is $\mathcal{X}$ and the decoder $g^{\prime}:S^{1}\times
S^{1}\to\mathcal{X}$ is given by the diffeomorphism
$g^{\prime}(z^{\prime})=g\circ s(z^{\prime})$, where $s$ is the solution
function of $\mathcal{C}$.

  * •

The intervention set $\mathcal{I}^{\prime}$ consists of empty interventions,
atomic interventions on $z^{\prime}_{1}$ with
$\tilde{z}^{\prime}_{1}\sim\mathcal{U}$, and atomic interventions on
$z^{\prime}_{2}$ with $\tilde{z}^{\prime}_{2}\sim\mathcal{U}$. Each of these
interventions has probability $\frac{1}{3}$ in $p_{\mathcal{I}^{\prime}}$.

We find a weakly supervised causal distribution

$p_{\mathcal{C}^{\prime}}^{\mathcal{Z}^{\prime}}(z^{\prime},\tilde{z}^{\prime})=\mathcal{U}(z^{\prime}_{1})\;q(z^{\prime}_{2})\;\biggl{[}\frac{1}{3}\;\delta(\tilde{z}^{\prime}_{1}-z^{\prime}_{1})\;\delta(\tilde{z}^{\prime}_{2}-z^{\prime}_{2})\\\
+\frac{1}{3}\;\mathcal{U}(\tilde{z}^{\prime}_{1})\;\delta(\tilde{z}^{\prime}_{2}-z^{\prime}_{2})+\frac{1}{3}\;\delta(\tilde{z}^{\prime}_{1}-z^{\prime}_{1})\;\mathcal{U}(\tilde{z}^{\prime}_{2})\biggr{]}\,.$
(13)

Clearly, two LCMs are not equivalent, because their graphs are non-isomorphic.
Yet, if we define

$\varphi:\mathcal{Z}\to\mathcal{Z}^{\prime}:(z_{1},z_{2})\mapsto(z_{1},z_{2}-z_{1})$

then the weakly supervised distribution of the causal variables is preserved:

$\displaystyle((\varphi,\varphi)_{*}p_{\mathcal{C}}^{\mathcal{Z}})(z^{\prime},\tilde{z}^{\prime})$
$\displaystyle=p_{\mathcal{C}}^{\mathcal{Z}}((z^{\prime}_{1},z^{\prime}_{2}+z^{\prime}_{1}),(\tilde{z}^{\prime}_{1},\tilde{z}^{\prime}_{2}+\tilde{z}^{\prime}_{1}))$
$\displaystyle=\mathcal{U}(z^{\prime}_{1})\;q(z^{\prime}_{2}+z^{\prime}_{1}-z^{\prime}_{1})\;\biggl{[}\frac{1}{3}\;\delta(\tilde{z}^{\prime}_{1}-z^{\prime}_{1})\;\delta(\tilde{z}^{\prime}_{2}+\tilde{z}^{\prime}_{1}-(z^{\prime}_{2}+z^{\prime}_{1}))$
$\displaystyle\quad+\frac{1}{3}\;\mathcal{U}(\tilde{z}^{\prime}_{1})\;\delta(\tilde{z}^{\prime}_{2}+\tilde{z}^{\prime}_{1}-(z^{\prime}_{2}+z^{\prime}_{1})-\tilde{z}^{\prime}_{1}+z^{\prime}_{1})+\frac{1}{3}\;\delta(\tilde{z}^{\prime}_{1}-z^{\prime}_{1})\;\mathcal{U}(\tilde{z}^{\prime}_{2}+\tilde{z}^{\prime}_{1})\biggr{]}$
$\displaystyle=\mathcal{U}(z^{\prime}_{1})\;q(z^{\prime}_{2})\;\biggl{[}\frac{1}{3}\;\delta(\tilde{z}^{\prime}_{1}-z^{\prime}_{1})\;\delta(\tilde{z}^{\prime}_{2}-z^{\prime}_{2})$
$\displaystyle\quad+\frac{1}{3}\;\mathcal{U}(\tilde{z}^{\prime}_{1})\;\delta(\tilde{z}^{\prime}_{2}-z^{\prime}_{2})+\frac{1}{3}\;\delta(\tilde{z}^{\prime}_{1}-z^{\prime}_{1})\;\mathcal{U}(\tilde{z}^{\prime}_{2})\biggr{]}$
$\displaystyle=p_{\mathcal{C}^{\prime}}^{\mathcal{Z}^{\prime}}(z^{\prime},\tilde{z}^{\prime})$

where we use that the density $\mathcal{U}$ is constant. Also, because
$\varphi=s^{-1}$ and $g^{\prime}(z^{\prime})=g\circ s(z^{\prime})$, we have
that $p_{\mathcal{M}}^{\mathcal{X}}=p_{\mathcal{M}^{\prime}}^{\mathcal{X}}$.

So these two models with their non-isomorphic graph structures have identical
weakly-supervised distributions on the observables $x,\tilde{x}$. They
therefore provide a counter-example for a straightforward generalization of
Thm. 1 to causal variables with arbitrary continuous domains.

The key issue here is that the interventional distribution on $\tilde{z}_{2}$
has many symmetries or automorphisms: diffeomorphic maps
$\mathcal{Z}_{2}\to\mathcal{Z}_{2}$ that preserve $p(\tilde{z}_{2})$ — in this
case these are the cyclic translations. In general, for any causal model
$\mathcal{D}$ with two variables $z_{1}\to z_{2}$, we can construct a map
$\phi(z_{1},z_{2})=(z_{1},\Gamma(z_{1})(z_{2}))$ where for all $z_{1}$,
$\Gamma(z_{1}):\mathcal{Z}_{2}\to\mathcal{Z}_{2}$ is a differentiable map from
$\mathcal{Z}_{1}$ to a diffeomorphism on $\mathcal{Z}_{2}$ that preserves the
interventional distribution $p(\tilde{z}_{2})$. This map $\phi$ preserves the
weakly supervised distribution from $\mathcal{D}$ to a unique model
$\mathcal{D}^{\prime}$, whose causal mechanisms are:
$f^{\prime}_{1}(\epsilon_{1})=f_{1}(\epsilon_{1})$ and
$f^{\prime}_{2}(z_{1},\epsilon_{1})=\Gamma(z_{1})(f_{2}(z_{1},\epsilon_{2}))$.
However, $\phi$ is only an ISCM morphism if it is also diagonal, and thus
$\Gamma$ must be constant in $z_{1}$.

For the $\mathbb{R}$-valued variables of the main paper, any smooth
distribution on $\mathbb{R}$ has exactly two automorphisms, related to the
automorphisms of the univariate Gaussian distribution $x\mapsto x$ and
$x\mapsto-x$. $\Gamma$ can not smoothly switch between these and thus must be
constant, making $\phi$ diagonal and an ISCM morphism. However, any multi-
dimensional distribution has many automorphisms. One class of these is related
to the orthogonal transformations of a standard multivariate Gaussian.
Another, much larger, class is related to the flows generated by divergence-
free vector fields on the unit ball. $\Gamma$ can smoothly choose different
such automorphisms for different values of $z_{1}$, making $\phi$ not diagonal
and thus not an ISCM morphism. In conclusion, this smooth space of
automorphisms make the multivariate case unidentifiable from weak supervision.

##  Appendix C Implicit latent causal models

###  C.1 Behaviour of noise encodings under interventions

We first prove a key property of ISCMs, which motivate the construction of
ILCMs:

######  Lemma 3.

Let $\mathcal{D}=\langle\mathcal{C},\mathcal{I},p_{\mathcal{I}}\rangle$ be an
ISCM with $n$ real-valued causal variables. Sample from the weakly-supervised
distribution over noise encodings $(e,\tilde{e})\sim p(e,\tilde{e}|I)$. Then
$\forall i\not\in I$, almost surely $e_{i}=\tilde{e}_{i}$.

###### Proof.

First, note that $z=s(\epsilon)$ and $e=s^{-1}(z)$, so $\epsilon=e$. If
$i\not\in I$, then the unintervened noise equals the intervened noise
$\tilde{\epsilon}_{i}=\epsilon_{i}$, so

$\displaystyle\tilde{e}_{i}$ $\displaystyle=s^{-1}(\tilde{z})_{i}$
$\displaystyle=f_{i}(\cdot,\tilde{z}_{\mathrm{\mathbf{pa}}_{i}})^{-1}(\tilde{z}_{i})$
$\displaystyle=f_{i}(\cdot,\tilde{z}_{\mathrm{\mathbf{pa}}_{i}})^{-1}(f_{i}(\tilde{\epsilon}_{i},\tilde{z}_{\mathrm{\mathbf{pa}}_{i}}))$
$\displaystyle=\tilde{\epsilon}_{i}=\epsilon_{i}=e_{i}\qed$

###  C.2 Model specification

An implicit latent causal model for a system of $n$ causal variables consists
of the following components:

  * •

a Gaussian noise encoder $q(e|x)$ with mean $\mu_{e}(x)$ and standard
deviation $\sigma_{e}(x)$ implemented as neural networks;

  * •

a Gaussian noise decoder $p(x|e)$ with mean $\mu_{x}(e)$ implemented as neural
network and fixed, constant standard deviation;

  * •

an intervention encoder $q(I|x,\tilde{x})$ defined as

$\log q(i\in
I|x,\tilde{x})=\frac{1}{Z}\;\\!\bigl{(}a+b\left|\mu_{e}(x)_{i}-\mu_{e}(\tilde{x})_{i}\right|+c\left|\mu_{e}(x)_{i}-\mu_{e}(\tilde{x})_{i}\right|^{2}\bigr{)}\,,$

where $a<0$ and $b,c>0$ are learnable parameters and where the normalization
constant $Z$ is defined such that $\sum_{I}q(i\in I|x,\tilde{x})=1$;

  * •

solution functions $s_{i}(e_{i};e_{\setminus i})$ for $i=1,\dots,n$
implemented as invertible affine transformations, where the offset and slope
are functions of $e_{\setminus i}$ implemented with neural networks;

  * •

noise priors $p_{i}(e_{i})$, which we choose to be standard Gaussian;

  * •

an post-intervention causal-variable prior $\tilde{\pi}(\tilde{z}_{i})$, which
we choose to be standard Gaussian; and

  * •

an intervention-target prior $p(I)$, which we choose to be uniform.

Encoding a data pair $(x,\tilde{x})$ during training consists of the following
steps:

$\displaystyle I$ $\displaystyle\sim q(I|x,\tilde{x})$ $\displaystyle
e_{\text{preliminary}}$ $\displaystyle\sim q(e|x)$
$\displaystyle\tilde{e}_{\text{preliminary}}$ $\displaystyle\sim
q(\tilde{e}_{\text{preliminary}}|\tilde{x})$ $\displaystyle\forall
i\,,\;\lambda_{i}$ $\displaystyle\sim\mathrm{Uniform}(0,1)$ $\displaystyle
e_{\text{average}\,i}$
$\displaystyle=\lambda_{i}e_{\text{preliminary}\,i}+(1-\lambda_{i})\tilde{e}_{\text{preliminary}\,i}$
$\displaystyle e_{i}$
$\displaystyle=\begin{cases}e_{\text{preliminary}\,i}&i\in I\\\
e_{\text{average}\,i}&i\notin I\end{cases}$ $\displaystyle\tilde{e}_{i}$
$\displaystyle=\begin{cases}\tilde{e}_{\text{preliminary}\,i}&i\in I\\\
e_{\text{average}\,i}&i\notin I\end{cases}\,.$ (14)

In the first line, we encode to an intervention target (either by sampling or
by enumerating all possibilities and summing up the corresponding loss terms).
In the second line, the data is encoded to the noise-encoding space. The third
and fourth line project these noise encodings such that for those components
$e_{i}$ that are not intervened upon, $i\notin I$, we have that the pre-
intervention noise encoding and post-intervention noise encoding are equal,
$e_{i}=\tilde{e}_{i}$. This makes sure that the latents are consistent with
the weakly supervised structure, and punishes deviations from this structure
through the reconstruction error (likelihood). We use the symbol
$e,\tilde{e}\sim q(e,\tilde{e}|x,\tilde{x},I)$ to refer to the second to last
line together.

The prior is given by

$p(e,\tilde{e}_{I},I)=p(I)\,\prod_{i}p_{i}(e_{i})\,\prod_{i\in
I}p(\tilde{e}_{i}|e)$

with, for $i\in I$,

$p(\tilde{e}_{i}|e)=\tilde{p}\bigl{(}s_{i}(\tilde{e}_{i}|e_{\setminus
i})\bigr{)}\;\left|\frac{\partial\bar{s}_{i}(\tilde{e}_{i};e_{\setminus
i})}{\partial\tilde{e}_{i}}\right|\,.$ (15)

###  C.3 Training

1:Training data $p_{\text{data}}(x,\tilde{x})$

2:ILCM with encoder $q(e,\tilde{e},I|x,\tilde{x})$, decoder $p(x|e)$, solution
functions $s_{i}(e_{i};e_{\backslash i})$.

3:Optimizer

4:Loss weights $\alpha$, $\beta$, optimizer hyperparameters, ILCM
initialization

5:Randomly initialize ILCM

6:while not converged do

7: Sample data batch $x,\tilde{x}\sim p_{\text{data}}(x,\tilde{x})$

8: Encode $e\sim q^{\text{phase 1}}(x)$, $\tilde{e}\sim q^{\text{phase
1}}(\tilde{x})$

9: Compute loss $L\leftarrow\mathcal{L}^{\text{phase 1}}(x,\tilde{x})$ (Eq.
(17))

10: Train ILCM on $L$ with optimizer

11:end while

12:while not converged do

13: Sample data batch $x,\tilde{x}\sim p_{\text{data}}(x,\tilde{x})$

14: Encode $e,\tilde{e},I\sim q(e,\tilde{e},I|x,\tilde{x})$ (Eq. (14))

15: Compute loss $L\leftarrow\mathcal{L}^{\text{phase 2}}(x,\tilde{x})$ (Eq.
(18))

16: Train ILCM on $L$ with optimizer

17:end while

18:Freeze convolutional layers in $q(e,\tilde{e},I|x,\tilde{x})$

19:while not converged do

20: Sample data batch $x,\tilde{x}\sim p_{\text{data}}(x,\tilde{x})$

21: Encode $e,\tilde{e},I\sim q(e,\tilde{e},I|x,\tilde{x})$ (Eq. (14))

22: Compute loss $L\leftarrow\mathcal{L}(x,\tilde{x})$ (Eq. (16))

23: Train ILCM on $L$ with optimizer

24:end while

25:Determine top. order
$o\leftarrow\mathrm{TopoOrderHeuristic}(\mathrm{ILCM},p_{\text{data}}(x,\tilde{x}))$
(described in Sec. C.5)

26:Modify $s_{i}$ to only depend on
$s_{i}(e_{i};e_{\mathrm{\mathbf{anc}}_{i}})$ according to $o$

27:while not converged do

28: Sample data batch $x,\tilde{x}\sim p_{\text{data}}(x,\tilde{x})$

29: Encode $e,\tilde{e},I\sim q^{\text{phase 4}}(e,\tilde{e},I|x,\tilde{x})$
(Eq. (20)

30: Compute loss $L\leftarrow\mathcal{L}(x,\tilde{x})$ (Eq. (16))

31: Train ILCM on $L$ with optimizer

32:end while

Algorithm 1 Schematic ILCM training.

#### Loss

We train ILCMs by minimizing the $\beta$-VAE loss

$\mathcal{L}_{\text{ILCM}}=\mathbb{E}_{x,\tilde{x}}\mathbb{E}_{I\sim
q(I|x,\tilde{x})}\mathbb{E}_{e,\tilde{e}\sim
q(e,\tilde{e}|x,\tilde{x},I)}\biggl{[}\log p(x|e)+\log
p(\tilde{x}|\tilde{e})\\\ +\beta\Bigl{\\{}\log p(e,\tilde{e}_{I},I)-\log
q(I|x,\tilde{x})-\log q(e,\tilde{e}_{I}|x,\tilde{x},I)\Bigr{\\}}\biggr{]}\,,$

where $\beta$ is a hyperparameter.

Two additional loss terms are used as regularizers during training. The first
is a plain reconstruction error (or log likelihood term) that does not use the
projections given in Eq. (14) to encourage consistency between the noise
encoder and noise decoder:

$\mathcal{L}_{\text{reco}}=\mathbb{E}_{x,\tilde{x}}\mathbb{E}_{e\sim
q(e|x)}\mathbb{E}_{\tilde{e}\sim q(\tilde{e}|\tilde{x})}\Bigl{[}\log
p(x|e)+\log p(\tilde{x}|\tilde{e})\Bigr{]}\,.$

Throughout training, we also add the negative entropy of the batch-aggregate
intervention posterior
$q^{\text{batch}}_{I}(I)=\mathbb{E}_{x,\tilde{x}\in\text{batch}}[q(I|x,\tilde{x})]$:

$\mathcal{L}_{\text{entropy}}=\mathbb{E}_{\text{batches}}\Bigl{[}-\sum_{I}q^{\text{batch}}_{I}(I)\log
q^{\text{batch}}_{I}(I)\Bigr{]}\,.$

This helps avoid a collapse of the latent space to a lower-dimensional
subspace. The overall loss is then given by

${\mathcal{L}=\mathcal{L}_{\text{ILCM}}+\alpha\mathcal{L}_{\text{reco}}+\gamma\mathcal{L}_{\text{entropy}}}$
(16)

with hyperparameters $\alpha,\gamma\geq 0$.

#### Training phases

We train ILCM models in four phases:

  1. 1.

We begin with a short pre-training phase, in which the noise encoder and noise
decoder are trained on a plain $\beta$-VAE loss with a standard Gaussian
prior,

${\mathcal{L}^{\text{phase
1}}=\mathbb{E}_{x,\tilde{x}}\mathbb{E}_{e,\tilde{e}\sim
q(e|x)q(\tilde{e}|\tilde{x})}\biggl{[}\log p(x|e)+\log
p(\tilde{x}|\tilde{e})}\\\
{+\beta\Bigl{\\{}\log\mathcal{N}(e)+\log\mathcal{N}(\tilde{e})-\log
q(e|x)-\log q(\tilde{e}|\tilde{x})\Bigr{\\}}\biggr{]}\,.}$ (17)

This provides a good starting point for the remainder of the training, in
which the encoders and decoders have already learned some patterns in the data
space.

  2. 2.

Next, we train the noise encoder, noise decoder, and intervention encoder. In
this phase we do not yet use the neural solution functions and instead model
$p(\tilde{e}_{i}|e)$ with a uniform probability density. Ignoring irrelevant
constants, the total loss is given by

${\mathcal{L}^{\text{phase 2}}=\mathbb{E}_{x,\tilde{x}}\mathbb{E}_{I\sim
q(I|x,\tilde{x})}\mathbb{E}_{e,\tilde{e}\sim
q(e,\tilde{e}|x,\tilde{x},I)}\biggl{[}\log p(x|e)+\log
p(\tilde{x}|\tilde{e})+\beta\Bigl{\\{}\log p(I)}\\\ {+\sum_{i}\log
p_{i}(e_{i})-\log q(I|x,\tilde{x})-\log
q(e,\tilde{e}_{I}|x,\tilde{x},I)\Bigr{\\}}\biggr{]}+\alpha\mathcal{L}_{\text{reco}}+\gamma\mathcal{L}_{\text{entropy}}\,.}$
(18)

This avoids harmful feedback from the randomly initialized solution functions
influencing the training of the encoder and decoders, stabilizing the learning
of good latent representations.

  3. 3.

We then “switch on” the solution functions and model the intervention targets
with the density $p(\tilde{e}_{i}|e)$ as given above and train on the combined
loss $\mathcal{L}$.

On image datasets, we freeze the convolutional layers in the encoder in this
stage and only continue training the final layers of the encoder together with
the solution functions.

  4. 4.

For a final fine-tuning phase, we change the setup in two more ways. First, we
analyze the learned solution functions to infer the most likely topological
order. For this we use the step 1 of the heuristic algorithm for graph
inference, which we will define in Sec. C.5 below. Then the solution functions
are modified such that $s_{i}$ only depends on the ancestors
$e_{\mathrm{\mathbf{anc}}_{i}}$ according to the inferred topological order:

$s_{i}(e_{i};e_{\setminus i})\to
s_{i}(e_{i};e_{\mathrm{\mathbf{anc}}_{i}})\,.$ (19)

This is implemented with a suitable masking layer in the neural network
implementation of $s_{i}$. We find that this form of inductive bias in the
prior helps with learning cleanly disentangled representations.

Second, we fix the intervention encoders to the deterministic,

$\displaystyle
q^{\text{deterministic}}(I|x,\tilde{x})=\begin{cases}1&I=\operatorname*{arg\,max}_{I}q(I|x,\tilde{x})\\\
0&\text{else}\,,\end{cases}$
$\displaystyle{q(e,\tilde{e},I|x,\tilde{x})=q^{\text{deterministic}}(I|x,\tilde{x})q(e,\tilde{e}|x,\tilde{x},I)\,.}$
(20)

This further improves the training efficiency.

We summarize the whole ILCM training procedure in Alg. 1. The separation of
phase 2 and 3—first training the encoder with a simplified prior, then
training the solution functions—improved the success of our method
substantially. Adding the pre-training and fine-tuning phases 1 and 4 slightly
improved the efficiency of the training, but is not critical.

We use the Adam optimizer [39] with a cosine annealing schedule [40], which is
restarted at the beginning of training phases 3 and 4. The hyperparameters
differ slightly between experiments and will be given in Sec. D.

###  C.4 Identifiability

We will now show that our identifiability result extends to implicit latent
causal models. We construct an equivalence $\Omega:ILCM\to ELCM$ between ILCMs
and ELCMs, which preserves the weakly supervised distribution
$p(x,\tilde{x})$. This gives an equivalence relation on ILCMs, namely if their
corresponding ELCMs are isomorphic according to Def. 7. A direct corollary of
Thm. 1 is then that the weakly supervised distributions of ILCMs
$\mathcal{N},\mathcal{N}^{\prime}$ are equal,
$p_{\mathcal{N}}(x,\tilde{x})=p_{\mathcal{N}^{\prime}}(x,\tilde{x})$, if and
only if they are equivalent, $\mathcal{N}\sim\mathcal{N^{\prime}}$.

To construct the map $\Omega$ between an ILCM $\mathcal{N}$ and ELCM
$\mathcal{M}$, let both have equal: solution function
$s:\mathcal{E}\to\mathcal{Z}$, noise distribution $p(\epsilon)$, intervention
distribution $p(I)$, intervention encoder. Let the encoder $q(e|x)$ of
$\mathcal{N}$ be equal to the encoder $q(z|x)$ of $\mathcal{M}$, post-composed
with the inverse solution function $s^{-1}:\mathcal{Z}\to\mathcal{E}$, and the
decoder be pre-composed with the solution function. Let the explicit graph in
$\mathcal{M}$ equal the graph induced by the solution function of
$\mathcal{N}$, with $\forall i\neq j$, the edge $i\to j$ exists if
$\exists\epsilon$ such that $\partial s(\epsilon)_{j}/\partial\epsilon_{i}\neq
0$.

To map from an ILCM $\mathcal{N}$ to an ELCM $\mathcal{M}$, we pick the
intervened causal mechanism $\tilde{f}_{i}$ as any map such that the causal
distribution $p(\tilde{z}_{i})=(\tilde{f}_{i})_{*}p(e_{i})$ of $\mathcal{M}$
equals the post-intervention causal-variable prior
$\tilde{\pi}(\tilde{z}_{i})$ in $\mathcal{N}$. For $\mathbb{R}$-valued
variables and fully supported distributions with smooth densities, there are
exactly two possible choices for $\tilde{f}_{i}$. To map from an ELCM
$\mathcal{M}$ to an ILCM $\mathcal{N}$, we set
$\tilde{\pi}(\tilde{z}_{i}):=(\tilde{f}_{i})_{*}p(e_{i})$.

Following the definitions of the weakly supervised distributions, it is easy
to see that $\Omega$ preserves weakly supervised distribution, so that if
$\mathcal{M}=\Omega(\mathcal{N})$, then
$p_{\mathcal{M}}(x,\tilde{x})=p_{\mathcal{N}}(x,\tilde{x})$, and if
$\mathcal{N}=\Omega^{-1}(\mathcal{M})$, then
$p_{\mathcal{M}}(x,\tilde{x})=p_{\mathcal{N}}(x,\tilde{x})$. This proves that
our identifiability result of ELCMs also applies to ILCMs.

###  C.5 Graph inference

ILCMs do not contain an explicit graph representation, but the causal
structure is implicitly represented by the learned solution functions. We
propose two algorithms for causal discovery based on a trained ILCM model.

#### ILCM-E

We can perform causal discovery in a two-stage procedure. After training an
ILCM to learn the causal representations, we use an off-the-shelf method for
causal discovery on the learned representations. Since the ILCM allows us to
infer intervention targets, we can use intervention-based algorithms. In this
paper, we use ENCO [28], a recent differentiable causal discovery method that
exploits interventions to obtain acyclic graphs without requiring constrained
optimization. Alternatives to ENCO include DCDI [27] and GIES [30].

#### ILCM-H

Alternatively, we can unearth the causal structure encoded in the learned
solution functions $s_{i}$, which map noise variables to causal variables. We
introduce a heuristic algorithm that can find the causal graph $\mathcal{G}$
and the causal mechanisms $f_{i}$ from a trained ILCM. It proceeds in three
steps:

  1. 1.

_Computing the topological order_ : To determine the topological order of the
causal graph, we use the property that after convergence, the solution
function $z_{i}=s_{i}(e_{i};e)$ will only depend on the ancestors of $e_{i}$.
This allows us to define a heuristic that determines whether $z_{i}$ is an
ancestor of $z_{j}$. For each pair $(i,j)$, we compute

$\mathrm{ancestry}(i,j)=d\Bigl{(}s_{j}(e_{j};e),s_{j}(e_{j};\mathrm{mask}_{i}[e])\Bigr{)}\,.$
(21)

Here $d(\cdot,\cdot)$ is a distance measure between two functions; in
practice, we use the expected MSE over a validation dataset. The function
$\mathrm{mask}_{i}[e]$ replaces the $i$-th component of $e$ with uninformative
input, for instance median of that component computed over the training
dataset.

After computing these ancestry scores, we can compute a topological order by
sorting the variables such that likely ancestors appear before their likely
descendants according to this heuristic. We do this with a greedy algorithm.

  2. 2.

_Extracting the causal mechanisms_ : Next, we compute the causal mechanisms
$f_{i}$ such that $z_{i}=f_{i}(e_{i};z_{\mathrm{\mathbf{anc}}_{i}})$. We begin
by setting $i$ to the root node (the first variable in the topological order
computed in step 1) and proceed in topological order. At every step we set

$f_{i}(e_{i};z_{\mathrm{\mathbf{anc}}_{i}})=s_{i}(e_{i};\hat{e})\quad\text{with}\quad\hat{e}_{j}=\begin{cases}f_{j}^{-1}(z_{j};z_{\mathrm{\mathbf{anc}}_{j}})&j\in\mathrm{\mathbf{anc}}_{i}\\\
\mathrm{mask}[e_{j}]&\mathrm{otherwise}\,.\end{cases}$ (22)

  3. 3.

_Finding causal parents_ : Finally, we check whether an ancestor $z_{i}$ is a
parent of a node $z_{j}$ by testing whether $f_{j}$ explicitly depends on
$z_{i}$. Again, we use a heuristic measure of functional dependence:

$\mathrm{paternity}(i,j)=d\Bigl{(}f_{j}(e_{j};z_{\mathrm{\mathbf{anc}}_{j}}),f_{j}(e_{j};\mathrm{mask}_{i}[z_{\mathrm{\mathbf{anc}}_{j}}])\Bigr{)}\,.$
(23)

We then construct the causal graph by thresholding on this heuristic. This
gives us the inferred adjacency matrix

$\hat{A}_{ij}=\begin{cases}1&i\in\mathrm{\mathbf{anc}}_{j}\quad\text{and}\quad\mathrm{paternity}(i,j)>p_{\text{min}}\\\
0&\text{else}\end{cases}$ (24)

where $p_{\text{min}}>0$ is a hyperparameter.

The heuristic algorithm (ILCM-H) does not require any optimization and is thus
computationally more efficient, but arguably less principled than the
likelihood-based ENCO approach (ILCM-E). In our experiments, the ILCM-H
approach finds the correct graph in 7 out of the 8 datasets, while ILCM-E
always yields the correct causal graph.

##  Appendix D Experiments

###  D.1 General setup

#### Baselines

We compare our ILCM-E and ILCM-H results (which differ only by the graph
inference algorithm, as described above) to three baseline methods. The
_disentanglement VAE_ (dVAE) method is a VAE for paired data with individual
latent components changing between the pre-intervention latents and the post-
intervention latents, but without causal structure. We implement it by using
an ILCM, but enforce a trivial causal graph by not allowing the solution
functions $s_{i}(\cdot;e)$ to depend on $e$.

Our second baseline is an unstructured $\beta$-VAE, which treats pre-