SlowGuess/NeurIPS_2023_OCR huggingface dataset:
1. We show that following GIT-privileged score allows collecting enough interventional data to direct all edges that appear in the true graph correctly, see proposition 12.
2. Then we show that, if required, additional interventional data that allows directing other edges according to theorem 7 will be collected, see proposition 13.
3. Finally, theorems 8 and 9 can be applied to show that we learned the correct graph, see proposition 14.
Proposition 10. Consider the edge  $X_{i} \to X_{j}$  in the true causal graph. The parameter  $\gamma_{ij}$  converges to  $\sigma(\gamma_{ij}) = 1$  under any set of interventions  $p_{I}(I)$  if
$$
\min _ {\hat {p a} \subseteq \mathcal {V} _ {- i}} \mathbb {E} _ {\hat {I} \sim p _ {I - j} (I)} \mathbb {E} _ {\tilde {p} _ {\hat {I}}} (\boldsymbol {X}) \left[ \log p (X _ {j} | \hat {p a}, X _ {i}) - \log p (X _ {j} | \hat {p a}) \right] > \lambda_ {s p a r s e}
$$
where  $\mathcal{V}_{-i}$  is the set of all nodes excluding  $X_{i}$ , and  $p_{I_{-j}}(I)$  refers to the distribution over conducted interventions  $p_I(I)$  excluding the intervention on variable  $X_{j}$ .
Proof. The condition guarantees that the gradient of  $\gamma_{ij}$  is positive.
Proposition 11. Consider the edge  $X_{i} \to X_{j}$  in the true causal graph. When conditions from remark 4 are fulfilled  $\| \nabla_{\theta_{ij}} L_{graph}(X_{I_i}) \| = \| \nabla_{\theta_{ji}} L_{graph}(X_{I_i}) \| = \| \nabla_{\theta_{ij}} L_{graph}(X_{I_j}) \| = \| \nabla_{\theta_{ji}} L_{graph}(X_{I_j}) \| = 0$  and the edge converged to its true value if and only if we acquired interventional data from  $X_{i}$  or  $X_{j}$ .
Proof. First, recall that ENCO does not update orientation parameters unless the interventional data was acquired from a neighboring node. Therefore, the gradient can only be zero before the intervention if the existence parameters converge to zero. This situation is guaranteed not to happen by proposition 10.
Second, when interventional data is acquired, based on the theorem 6, we know that the edge converges to its true value.
Proposition 12. Choosing intervention targets with GIT-privileged score allows collecting enough data to direct all edges that appear in the true graph properly if the following is true:
- For any pair of variables  $X_{i}$ ,  $X_{j}$  without a direct edge in the true causal graph, when conditions from remark 4 are fulfilled, and we acquired interventional data from either  $X_{i}$  or  $X_{j}$ , and sufficient time for the optimization process is given, then the orientation parameters will converge to extreme values  $\sigma(\theta_{ij})$ ,  $\sigma(\theta_{ji}) \in \{0,1\}$  or the existence parameters will converge to  $\sigma(\gamma_{ij}) = \sigma(\gamma_{ji}) = 0$ .
Proof. The assumption and proposition 11 imply that after collecting interventional data from a node, edges that are connected to this node will not contribute to the score anymore. Thus we will not intervene on the same node twice. On the other hand, proposition 11 guarantees the score of edges that appear in the true graph will be positive until they are directed.  $\square$
Proposition 13. Consider a pair of variables  $X_{i}$ ,  $X_{j}$  for which  $X_{i}$  is an ancestor of  $X_{j}$  without a direct edge in the true causal graph. Assume all edges that appear in the true graph has converged according to theorem 6. When conditions from remark 4 are fulfilled, and if  $\| \nabla_{\theta_{ij}} L_{graph}(X_{I_i}) \| = \| \nabla_{\theta_{ji}} L_{graph}(X_{I_i}) \| = \| \nabla_{\theta_{ij}} L_{graph}(X_{I_j}) \| = \| \nabla_{\theta_{ji}} L_{graph}(X_{I_j}) \| = 0$  then the edge converged as described in theorem 7 or its existence parameters converged to 0.
Proof. To zero out the gradient either orientation or existence parameters had to converge. If the orientation parameters converged we had to collect interventional data from a neighboring node (because otherwise, ENCO does not update parameters). Thus, based on the theorem 7, we know that the edge converged to its true value.  $\square$
Proposition 14. Given sufficient acquisition rounds and time for optimization ENCO with GIT-privileged intervention acquisition method will recover the true graph.
Proof. From propositions 12, 13 we have that GIT-privileged will collect interventional data from new nodes until edges that appear in the true graph are correctly directed and edges between pairs of variables  $X_{i}$ ,  $X_{j}$  without a direct edge in the true causal graph either disappear from the model or are directed according to theorem 7. By theorems 8, 9 we conclude that we indeed acquired enough interventional data to converge to the correct graph.
B.3 GIT convergence
Proposition 15. Given sufficient acquisition rounds and time for optimization ENCO with GIT intervention acquisition method will recover the true graph if the following is true:
- For any graph  $G$  sampled from the structural belief  $\mathbb{P}_{\rho}(\cdot)$  (recall equation 5) during GIT score estimation, the theorems and propositions from sections B.1 and B.2 hold when we use  $G$  instead of the true graph and compute gradient using data from the sampled model  $\mathbb{P}_{G,\phi,i}(X)$  (recall equation 6).
Proof. First, note that thanks to proposition 10, if there is an edge  $X_{i} \to X_{j}$  in the true graph there exists a model, that can be sampled from the belief with non-zero probability, in which this edge appears.
For each undirected edge  $X_{i} \to X_{j}$  in the structural belief for which the existence parameter converged to  $\sigma(\theta_{ij}) = 1$ , there exists a model (with a positive probability to be sampled), that will yield a gradient of positive magnitude if and only if there is no interventional data acquired from the node connected to it. This model contains the edge  $X_{i} \to X_{j}$ , thus by the assumption made above and proposition 11, it will yield a positive gradient. In consequence, expectation over all possible models, when the edge is not yet directed, will yield a positive score.
Note that, when interventional data from  $X_{i}$  or  $X_{j}$  is acquired, the edge  $X_{i}\rightarrow X_{j}$  is directed and it does not yield a gradient of positive magnitude under data sampled from  $\mathbb{P}_{G,\phi ,i}(X)$  for any  $G\sim \mathbb{P}_{\rho}(\cdot)$ . This stems from the fact that the gradient term zeroes out when parameter  $\sigma (\theta_{ij})$  takes extreme values (0 or 1).
Hence, GIT score will allow to sequentially "eliminate" undirected edges. Since to update our structural belief  $\mathbb{P}_{\rho}(\cdot)$  we use interventional data sampled from the true graph when all edges are directed, we are guaranteed (by B.2 section) that they are directed according to theorems 6, 7. Then the same argument as for GIT-privileged can be applied to show that we converged to the true graph.
C Details about Employed Causal Discovery Frameworks
C.1 ENCO
We extend the description of the ENCO framework [Lippe et al., 2022] from Section 4.1.
Structural Parameters. ENCO learns a distribution over the graph structures by associating with each edge  $(i,j)$ , for which  $i \neq j$ , a probability  $p_{i,j} = \sigma(\gamma_{i,j})\sigma(\theta_{i,j})$ . Intuitively, the  $\gamma_{i,j}$  parameter represents the existence of the edge, while  $\theta_{i,j} = -\theta_{j,i}$  is associated with the direction of the edge. The parameters  $\gamma_{i,j}$  and  $\theta_{i,j}$  are updated in the graph fitting stage.
Distribution Fitting Stage. The goal of the distribution fitting stage is to learn the conditional probabilities  $P(X_{i}|PA_{(i,C)})$  for each variable  $X_{i}$  given a graph represented by an adjacency matrix  $C$ , sampled from  $C_{i,j} \sim Bernoulli(p_{i,j})$ . Note that self-loops are not allowed and thus  $p_{i,i} = 0$ . The conditionals are modeled by neural networks  $f_{\phi_i}$  with an input dropout-mask defined by the adjacency matrix. In consequence, the negative log-probability of a variable can be expressed as  $L_{C}(X_{i}) = -\log f_{\phi_{i}}(PA_{(i,C)})(X_{i})$ , where  $PA_{(i,C)}$  is obtained by computing  $C_{,i} \odot X$ , with  $\odot$  denoting the element-wise multiplication. The optimization objective for this stage is defined as minimizing the negative log-likelihood (NLL) of the observational data over the masks  $C_{,i}$ . Under the assumption that the distributions satisfy the Markov factorization property defined in Equation 1, the NLL can be expressed as:
$$
L _ {D} = \mathbb {E} _ {X} \mathbb {E} _ {C} \left[ \sum_ {i = 1} ^ {n} L _ {C} \left(X _ {i}\right) \right]. \tag {11}
$$
Graph Fitting Stage and Implementation of Interventions. The graph fitting stage updates the structural parameters  $\theta$  and  $\gamma$  defining the graph distribution. After selecting an intervention target  $I$ , ENCO samples the data from the postinterventional distribution  $\widetilde{P}_I$ . In experiments, in the current paper, where the variables are assumed to be categorical the intervention is implemented by changing the target node's conditional to uniform over the set of node's categories. As the loss, ENCO uses the graph struture loss  $L_{graph}$  defined in Equation 7 in the main text plus a regularization term  $\lambda L_{\gamma,\theta}^{sparse}$  that influences the sparsity of the generated adjacency matrices, where  $\lambda$  is the regularization strength.
Gradients Estimators. In order to update the structural parameters  $\gamma$  and  $\theta$  ENCO uses REINFORCE-inspired gradient estimators. For each parameter  $\gamma_{i,j}$  the gradient is defined as:
$$
\frac {\partial L _ {G}}{\partial \gamma_ {i , j}} = \sigma^ {\prime} (\gamma_ {i, j}) \sigma (\theta_ {i, j}). \tag {12}
$$
$$
\cdot \mathbb {E} _ {\mathbf {X}, C _ {- i j}} \left[ L _ {X _ {i} \to X _ {j}} (X _ {j}) - L _ {X _ {i} \not \to X _ {j}} (X _ {j}) + \lambda \right],
$$
where  $\mathbb{E}_{\mathbf{X},C_{-}ij}$  denotes all of the three expectations in Equation 7 (in the main text), but excluding the edge  $(i,j)$  from  $C$ . The term  $L_{X_i\neq X_j}(X_j)$  describes the negative log-likelihood of the variable  $X_{j}$  under the adjacency matrix  $C_{-ij}$ , while  $L_{X_i\to X_j}(X_j)$  is the negative log-likelihood computed by including the edge  $(i,j)$  in  $C_{-ij}$ . For parameters  $\theta_{i,j}$  the gradient is defined as:
$$
\frac {\partial L _ {G}}{\partial \theta_ {i , j}} = \sigma^ {\prime} (\theta_ {i, j}) \cdot
$$
$$
\cdot \left(p (I _ {i}) \sigma \left(\gamma_ {i, j}\right) \mathbb {E} _ {I _ {i}, \mathbf {X}, C _ {- i j}} \left[ L _ {X _ {i} \rightarrow X _ {j}} \left(X _ {j}\right) - L _ {X _ {i} \neq X _ {j}} \left(X _ {j}\right)\right] - \right.
$$
$$
p \left(I _ {j}\right) \sigma \left(\gamma_ {j, i}\right) \mathbb {E} _ {I _ {j}, \mathbf {X}, C _ {- i j}} \left[ L _ {X _ {j} \rightarrow X _ {i}} \left(X _ {i}\right) - L _ {X _ {j} \neq X _ {i}} \left(X _ {i}\right)\right]\left. \right), \tag {13}
$$
where  $p(I_i)$  is the probability of intervening on node  $i$  (usually uniform) and  $\mathbb{E}_{I_i,\mathbf{X},C_{-ij}}$  is the same expectation as  $\mathbb{E}_{\mathbf{X},C_{-ij}}$  but under the intervention on node  $i$ .
C.2 DiBS
DiBS [Lorch et al., 2021] is a Bayesian structure learning framework which performs posterior inference over graphs with gradient based variational inference. This is achieved by parameterising the belief about the presence of an edge between any two nodes with corresponding learnable node embeddings. This turns the problem of discrete inference over graph structures to inference over node embeddings, which are continuous, thereby opening up the possibility to use gradient based inference techniques. In order to restrict the space of distributions to DAGs, NOTEARS constraint [Zheng et al., 2018] which enforces acyclicity is introduced as a prior through a Gibbs distribution.
Formally, for any two nodes  $(i,j)$ , the belief about the presence of the edge from  $i$  to  $j$  is parameterised as:
$$
p \left(g _ {i j} \mid u _ {i}, v _ {j}\right) = \frac {1}{1 + \exp \left(- \alpha \left(u _ {i} ^ {T} v _ {j}\right)\right)} \tag {14}
$$
Here,  $g_{ij}$  is the random variable corresponding to the presence of an edge between  $i$  to  $j$ ,  $\alpha$  is a tunable hyperparameter and  $u_i, v_j \in \mathbb{R}^k$  are embeddings corresponding to node  $i$  and  $j$ . The entire set of learnable embeddings, i.e.  $\mathbf{U} = \{u_i\}_{i=1}^d$ ,  $\mathbf{V} = \{v_i\}_{i=1}^d$  and  $\mathbf{Z} = [\mathbf{U}, \mathbf{V}] \in \mathbb{R}^{2 \times d \times k}$  form the latent variables for which posterior inference needs to be performed. Such a posterior can then be used to perform Bayesian model averaging over corresponding posterior over graph structures they induce.
DiBS uses a variational inference framework and learns the posterior over the latent variables  $\mathbf{Z}$  using SVGD [Liu and Wang, 2016]. SVGD uses a set of particles for each embedding  $u_{i}$  and  $v_{j}$ , which form an empirical approximation of the posterior. These particles are then updated based on the gradient from Evidence Lower Bound (ELBO) of the corresponding variational inference problem, and a term which enforces diversity of the particles using kernels. The prior over the latent variable  $\mathbf{Z}$  is given by a Gibbs distribution with temperature  $\beta$  which enforces soft-acyclicity constraint:
$$
p (\mathbf {Z}) \propto \exp (- \beta \mathbb {E} _ {p (\mathbf {G} | \mathbf {Z})} [ h (\mathbf {G}) ]) \prod_ {i j} \mathcal {N} \left(z _ {i j}; 0, \sigma_ {z} ^ {2}\right) \tag {15}
$$
Here,  $h$  is the DAG constraint function given by NOTEARS [Zheng et al., 2018].
D Details about Intervention Targeting Methods
In this section we briefly introduce other intervention acquisition methods used for comparison in this work.
Active Intervention Targeting (AIT) Assume that the structural graph distribution maintained by the causal discovery algorithm can be described by some parameters  $\rho$ . Consider a set of graphs  $\mathcal{G} = \{\mathcal{G}_j\}$  sampled from this distribution. AIT assigns to each possible intervention target  $i \in V$  a discrepancy score that is computed by measuring the variance between the graphs (VBG) and variance within the graphs (VWG). The  $VBG_i$  for intervention  $i$  is defined as:
$$
V B G _ {i} = \sum_ {j} \left\langle \mu_ {j, i} - \bar {\mu} _ {i}, \mu_ {j, i} - \bar {\mu} _ {i} \right\rangle , \tag {16}
$$
where  $\mu_{j,i}$  is the mean of all samples drawn from graph  $\mathcal{G}_j$  under the intervention on target  $i$ , and  $\mu_i$  is the mean of all samples drawn from graphs under intervention on target  $i$ . The variance within graphs is described by:
$$
V W G _ {i} = \sum_ {j} \sum_ {k} \left\langle \left[ S _ {j, i} \right] _ {k} - \mu_ {j, i}, \left[ S _ {j, i} \right] _ {k} - \mu_ {j, i} \right\rangle , \tag {17}
$$
where  $[S_{j,i}]_k$  is the  $k$ -th sample from graph  $\mathcal{G}_j$  under the intervention on target  $i$ . The AIT score is then defined as the ratio  $D_i = \frac{VBG_i}{VWG_i}$ . The method selects then the intervention attaining the highest score  $D_i$ .
CBED Targeting Bayesian Optimal Experimental Design for Causal Discovery (BOECD) selects the intervention with the highest information gain obtained about the graph belief after observing the
interventional data. Let the tuple  $(j,v)$  define the intervention, where  $j\in V$  describes the intervention target, and  $v$  represents the change in the conditional distribution of variable  $X_{j}$ . Specifically, this means that the new conditional distribution of  $X_{j}$  is a distribution with point mass concentrated on  $v$ . Moreover, let  $Y_{(j,v)}$  denote the interventional distribution under the intervention  $(j,v)$ , and let  $\psi$  denote the current belief about the graph structure (i.e. the random variable corresponding to the structural and distributional parameters  $\psi = (\rho ,\phi)$ ). BOECD selects the intervention that maximizes [Tigas et al., 2022]:
$$
(j ^ {*}, v ^ {*}) = \underset {(j, v)} {\arg \max } I (Y _ {(j, v)}; \psi \mid \mathcal {D}), \tag {18}
$$
where  $\mathcal{D}$  are the observational data. The above formulation necessities the use of an MI estimator. One possible choice is a BALD-inspired estimator Tigas et al. [2022], Houlsby et al. [2011]:
$$
I \left(Y _ {(j, v)}; \psi \mid \mathcal {D}\right) = H \left(Y _ {(j, v)} \mid \mathcal {D}\right) - H \left(Y _ {(j, v)}; \phi \mid \mathcal {D}\right), \tag {19}
$$
with  $H(\cdot ;\cdot)$  denoting the cross-entropy. Note that this approach allows to select not only most informative target, but also the value of the intervention.
E.1 Synthetic Graphs Details
The synthetic graph structure is deterministic and is specified by the name of graph (chain, collider, jungle, fulldag), except for random, where the structure is sampled. Following ENCO [Lippe et al., 2022], we set the only parameter of sampling procedure, edge_prob, to 0.3.
The ground truth conditional distributions of the causal graphs are modeled by randomly initialized MLPs. Additionally, a randomly initialized embedding layer is applied at the input to each MLP that converts categorical values to real vectors. We used the code provided by Lippe et al. [2022]. For more detailed explanation, refer to Lippe et al. [2022, Appendix C.1.1].
E.2 ENCO Hyperparameters
For experiments on ENCO framework we used exactly the same parameters as reported by Lippe et al. [2022, Appendix C.1.1]. We provide them in Table 3 for the completeness of our report.
Table 3: Hyperparameters used for the ENCO framework.
parameter	value
Sparsity regularizer λsparse	4 × 10-3
Distribution model	2 layers, hidden size 64, LeakyReLU(α = 0.1)
Batch size	128
Learning rate - model	5 × 10-3
Weight decay - model	1 × 10-4
Distribution fitting iterations F	1000
Graph fitting iterations G	100
Graph samples K	100
Epochs	30
Learning rate - γ	2 × 10-2
Learning rate - θ	1 × 10-1
E.3 DiBS Hyperparameters
In Table 4, we present hyperparameters used for the DiBS framework.
E.4 Computational Cost
We used two hardware settings, one with GPU: a single Nvidia A100, and another one with CPUs: 12 cores of Intel Xeon E5-2697 processor. In our synthetic graph experiments with ENCO on GPU, a
Table 4: Hyperparameters used for the DiBS framework.
parameter	value
Number of particles	20
Number of particle updates	20000
Choice of Kernel	k([Z, Θ], [Z', Θ']) = σZ exp(−1/hZ||Z - Z'||F) + σΘ exp(−1/hΘ||Θ - Θ'||F)
hZ	5
hΘ	500
σZ	1
σΘ	1
Optimizer	RMSProp
Learning rate Optimizer	0.005
single experiment takes on average  $4\mathrm{h}$  to run, with  $57\mathrm{min}$  being used by GIT to make its decisions; the rest is devoted to the underlying causal discovery algorithm (in this case, ENCO). In the case of the CPU setup, an experiment takes on average  $126\mathrm{h}$ , with the GIT part taking up only  $6\mathrm{h}$ . We estimate the project's overall cost to be around 50K GPUh and 2M CPUh.
F.1 Experiments in DiBS Framework
Experimental setup The experimental setup closely follows the one from Tigas et al. [2022]. In the experiments, 10 batches of 10 data-points each are acquired. Each batch can contain various intervention targets. The acquisition method chooses intervention targets and values. For some of the methods, the GP-UCB strategy is used to select a value for a given intervention; see Tigas et al. [2022] for details. For every method, we run 40 random seeds. We compare the following methods:
- Soft GIT (ours): gradient magnitudes corresponding to different interventions are normalized by the maximum one, then passed to the softmax function (with temperature 1). Obtained scores are used as probabilities to sample a given intervention in the current batch. GP-UCB is used for value selection.
- Random (fixed values): Intervention targets are chosen uniformly randomly. The intervention value is fixed at 0.
- Random (uniform values): Intervention targets are chosen uniformly randomly. The intervention value is chosen uniformly randomly from the variable support.
- Soft AIT: Intervention targets are chosen from the softmax probabilities of AIT scores [Scherrer et al., 2021], with the temperature 2. GP-UCB is used for value selection.
- Soft CBED: Intervention targets are chosen from the softmax probabilities of CBED scores [Tigas et al., 2022], with the temperature 0.2. GP-UCB is used for value selection.
The results are presented in Figure 6. We can see the performance of Soft GIT is comparable to that of Random (uniform values) in both considered graph classes. Soft AIT and Soft CBED behave similarly for Erdos-Renyi graphs, while for Scale-Free they seem to bring a small improvement.
F.2 Performance in ENCO Framework - All Results
F.2.1 Ranking Statistics
We present ranking statistics in Tables 5, 6, 7.
F.2.2 AUSHD Tables
We present all AUSHD results with confidence intervals in Tables 8, 9.
Figure 6: Expected SHD metric for different acquisition methods on top of the DiBS framework, for graphs with 50 nodes and two different graph classes: Erdos-Renyi and Scale-Free.  $95\%$  bootstrap confidence intervals are shown.
Table 5: We count the number of training setups (24), where a given method was best or at least comparable to other methods (AIT, CBED, and Random; GIT-privileged was not compared against), basing on  $90\%$  confidence intervals for AUSHD. Each entry shows the total count, broken down into two data regimes,  $N = 1056$  and  $N = 3200$  resp., presented in the parenthesis.
AIT	CBED	Random	GIT (ours)	GIT-privileged
Best	0 (0 + 0)	0 (0 + 0)	2 (0 + 2)	8 (4 + 4)	5 (1 + 4)
Best or comparable	6 (2 + 4)	6 (4 + 2)	12 (5 + 7)	18 (11 + 7)	24 (12 + 12)
Table 6: We count the number of training setups (24), where a given method was best or at least comparable to other methods (AIT, CBED, and Random; GIT-privileged was not compared against), basing on  $90\%$  confidence intervals for SHD. Each entry shows the total count, broken down into two data regimes,  $N = 1056$  and  $N = 3200$  resp., presented in the parenthesis.
AIT	CBED	Random	GIT (ours)	priv. GIT
Best	1 (0 + 1)	1 (0 + 1)	2 (1 + 1)	1 (1 + 0)	3 (1 + 2)
Best or comparable	10 (4 + 6)	7 (4 + 3)	22 (12 + 10)	17 (10 + 7)	24 (12 + 12)
Table 7: For each method we show its pairwise performance against other methods (whether it is better, comparable, or worse) based on  $90\%$  confidence intervals for AUSHD, across two data regimes ( $N = 1056$  and  $N = 3200$ ) and all twelve graphs (hence for each method there are  $2 \times 12 \times 4 = 96$  pairs to consider). Each entry shows the total count, broken down into two data regimes,  $N = 1056$  and  $N = 3200$  resp., presented in the parenthesis.
Better	Comparable	Worse
AIT	9 (3+6)	27 (11+16)	60 (34+26)
CBED	9 (7+2)	35 (20+15)	52 (21+31)
Random	34 (13+21)	36 (21+15)	26 (14+12)
GIT (ours)	45 (24+21)	35 (21+14)	16 (3+13)
GIT-privileged	57 (25+32)	39 (23+16)	0 (0+0)
F.2.3 SHD Tables
We present SHD results for small and large data regime with confidence intervals in Tables 10, 11.
F.2.4 ENCO - Training Curves
We provide SHD training curves for main experiments in Figures 7 and 8.