SlowGuess/NeurIPS_2023_OCR huggingface dataset:
We evaluate the different intervention targeting methods in online causal discovery, see Algorithm 1. We utilize an observational dataset of size 5000. We use  $T = 100$  rounds, in each one acquiring an interventional batch of 32 samples. We distinguish two regimes: regular, with all 100 rounds ( $N = 3200$  interventional samples), and low, with 33 rounds ( $N = 1056$  interventional samples). We use  $|\mathcal{G}| = 50$  graphs and  $|\mathcal{D}_{G,i}| = 128$  data samples from each graph for the Monte-Carlo approximation of the GIT score. We tested different sizes of the Monte-Carlo sample and found that it does not have a major impact on performance, see Appendix F.4. For all experiments in this section we assume, following the approach of Lippe et al. [2022], that all interventions are single-node, hard, and change the conditional distribution of the intervened node to uniform.
Datasets We use synthetic and real-world datasets. The synthetic dataset consists of bidiag, chain, collider, jungle, fulldag and random DAGs, each with 25 nodes. The variable distributions are categorical, with 10 categories<sup>3</sup>. The real-world dataset consists of alarm, asia, cancer, child,
2At every step, a target node is chosen uniformly at random from the set of yet not visited nodes. After every node has been selected, the visitation counts are reset to 0.
<sup>3</sup>We create the datasets using the code provided by Lippe et al. [2022]. See Appendix E.1 for details.
Figure 2: The distribution of SAUSHD (see equation 10), calculated using 25 seeds, for synthetic graphs (lower is better). The intense color (left-hand side of each violin plot) indicates the low data regime ( $N = 1056$  samples). The faded color (right-hand side of each violin plot) represents a higher amount of data ( $N = 3200$  samples). Note that even though the solution quality is improved when more samples are available, typically, SAUSHD is smaller in the low data regime. This is because it measures relative improvement over the random baseline, which is most visible for the small number of samples in most methods.
earthquake, and Sachs graphs, taken from the BnLearn repository [Scutari, 2010]. Both synthetic and real-world graphs are commonly used as benchmarking datasets [Ke et al., 2019, Lippe et al., 2022, Scherrer et al., 2021].
Metrics We use the Structural Hamming Distance (SHD) [Tsamardinos et al., 2006] between the predicted and the ground truth graph as the main metric. SHD between two directed graphs is defined as the number of edges that need to be added, removed, or reversed in order to transform one graph into the other. More precisely, for two DAGs represented as adjacency matrices  $c$  and  $c'$ ,
$$
\operatorname {S H D} \left(c, c ^ {\prime}\right) := \sum_ {i > j} \mathbf {1} \left(c _ {i j} + c _ {j i} \neq c _ {i j} ^ {\prime} + c _ {j i} ^ {\prime} \text {o r} c _ {i j} \neq c _ {i j} ^ {\prime}\right). \tag {8}
$$
In the experiments, we always compute SHD between the predicted and the ground truth graph. In order to aggregate SHD values over different data regimes, we introduce the area under the SHD curve (AUSHD):
$$
\mathrm {A U S H D} _ {m} ^ {T} := \frac {1}{T} \sum_ {t = 1} ^ {T} \mathrm {S H D} _ {m} ^ {t}, \quad \mathrm {S H D} _ {m} ^ {t} := \mathrm {S H D} \left(c _ {g t}, c _ {m, t}\right) \tag {9}
$$
where  $m$  is the used method,  $T$  is the number of interventional data batches,  $c_{gt}$  is the ground truth graph, and  $c_{m,t}$  is the graph fitted by the method  $m$  using  $t$  interventional data batches. Intuitively, for small to moderate values of  $T$ , AUSHD captures a method's speed of convergence: the faster the SHD converges to 0, the smaller the area. For large values of  $T$ , AUSHD measures the asymptotic convergence. Smaller values indicate a better method. For visualizations, we use surplus of AUSHD over Random method (SAUSHD), which compares method  $m$  the the Random baseline. Precisely,
$$
\mathrm {S A U S H D} _ {m} ^ {T} := \mathrm {A U S H D} _ {m} ^ {T} - \mathbb {E} \left[ \mathrm {A U S H D} _ {\text {R a n d o m}} ^ {T} \right], \tag {10}
$$
where the expectation averages all randomness sources (e.g. stemming from the initialization). Again, smaller values indicate a better method.
5.2 Main Result: GIT's Empirical Performance
GIT's Overall Strong Performance We evaluate GIT on 24 training setups: twelve graphs (synthetic and real-world, six in each category) and two data regimes. GIT is the best or comparable to the baseline methods (excluding GIT-privileged) in 18 cases according to mean AUSHD, and 17 cases according to mean SHD, see Table 1. Additionally, GIT is stable, as the distribution of its AUSHD has most frequently the smallest variation among non-privileged methods (11 out of 24 cases), see Table 8 and Table 9 in Appendix F.2.2. In terms of pairwise comparison with other methods, GIT is better in 45 cases and comparable in 35 cases, out of a total of 96 ( $= 24$  setups  $\times 4$
Figure 3: The distribution of SAUSHD (see equation 10), calculated using 25 seeds, for real-world graphs (lower is better). The intense color (left-hand side of each violin plot) indicates the low data regime ( $N = 1056$  samples). The faded color (right-hand side of each violin plot) represents a higher amount of data ( $N = 3200$  samples). Notice that the two plots have different scales.
other methods), see Table 7 in Appendix F.2.1. Interestingly, GIT's performance for graphs with fewer nodes (cancer, earthquake) is less impressive. We hypothesize that this is because in these cases, the corresponding Markov Equivalence Class is a singleton (see Figure 4). Consequently, they require less interventional data to converge (see training curves in Appendix F.2.4), which diminishes the impact of different intervention strategies.
GIT is Especially Efficient for Low Data In the low data regime ( $N = 1056$ ), GIT is better or comparable to all the other non-privileged methods for 11 out of 12 graphs, see Table 1. Pictorially, this phenomenon can be seen in Figure 2 and Figure 3, where the left-hand side of the GIT violin plot tends to display the most favorable behavior compared to AIT, CBED, and Random methods. This suggests that GIT could be a good choice when access to interventional data is limited or costly.
GIT Outperforms MI-based Approaches We also notice that the performance of MI-based approaches (CBED and AIT) is worse than the one of GIT, typically attaining significantly worse AUSHD (see Figure 2 and Figure 3) and SHD values (see Figure 7 and Figure 8 in the Appendix F.2). This problem is further corroborated in Section 5.3, where we show that even in the case of large interventional batch size, these methods occasionally underperform Random, unlike GIT, which clearly wins in such a scenario. We hypothesize the poor performance comes from approximation errors and model mismatches, subverting the MI criterion which should lead to near-optimal decisions in the case of exact mutual information computation Krause and Guestrin [2005], Nemhauser et al. [1978], Tigas et al. [2022].
GIT Approximates GIT-privileged's Decisions GIT-privileged performs the best, as it is better or comparable with all other methods for each graph and data regime (see Table 1). This strong performance is also visible in Figure 2 and Figure 3, where the mass of the method consistently occupies the favorable regions of the SAUSHD metric. These results solidify the perception of GIT-privileged as a soft upper-bound. Importantly, GIT follows it quite closely: the methods are equivalent in terms of performance in 10 cases in the low data regime, and in 5 cases in the regular data regime. Furthermore, the choices of GIT and GIT-privileged correlate highly (Spearman correlation equal  $73\%$ ), see Appendix F.6. These results provide additional evidence in favor of GIT soundness and suggest that using data sampled from the model to compute GIT's scores does not lead to severe performance deterioration. The training curves and more detailed results can be found in Appendix F.2.
5.3 Performance under larger interventional batch size
ENCO is sensitive to errors in the estimation of properties of interventional data. In particular, small interventional batch size may cause errors in the estimation of conditional likelihood and disrupt the causal discovery process [Lippe et al., 2022, Appendix B.2.3]. We hypothesize that those estimation errors are an important factor hindering the advantage of using our method over Random in the larger data regime. Acquiring data with small batches may result in a misaligned gradient for the model and, in consequence, in the poor assessment of the next interventional target scores.
Figure 4: The interventional target distributions obtained by different strategies on real-world data. The probability is represented by the intensity of the node's color. The green color represents the edges for which there exists a graph in the Markov Equivalence Class that has the corresponding connection reversed. The number below each graph denotes the entropy of the distribution.
Figure 5: Histograms of intervention targets chosen by GIT. In this experiment, a node  $v$  was chosen (denoted by a red color;  $v$ 's parents are indicated by green). Parameters were initialized so that the model is only unsure about the neighborhood of  $v$ . The solid lines denote known edges and dashed ones are to be discovered.
We perform an additional experiment in a modified regime, where each intervention yields 1024 data points instead of the previous 32. Such a regime is relevant in scenarios where setting up an intervention with a new target is costly but obtaining the individual samples is relatively cheap. We run the experiment on synthetic graphs with 25 nodes and we run for 25 acquisition rounds. We present the AUSHD values in Table 2 and
full SHD curves in Appendix F.3. In this setting, GIT outperforms all the standard baselines and is on par with GIT-privileged. Importantly, GIT reaches the SHD value of 0 for all graphs. Additionally, we found that GIT selects each intervention target exactly once, except for the chain graph, for which the discovery process converges already after only 15 rounds.
Table 2: Average AUSHD values (from 5 seeds) for experiments with interventional batch size equal 1024.
AIT	CBED	Random	GIT(ours)	| GIT-privileged
bidiat	22.6	17.6	20.4	16.8	15.4
chain	11.4	8.2	10.2	8.0	7.7
collider	11.2	11.4	9.9	5.0	4.8
full	120.1	116.0	101.1	100.9	93.2
jungle	22.3	16.7	19.9	11.4	10.6
random	38.4	36.2	32.4	29.9	28.3
5.4 Investigating GIT's intervention target distributions
In order to gain a qualitative understanding of the GIT's behavior, we analyze the node distributions generated by respective methods on the BnLearn graphs in Figure 4. We observe that GIT often selects nodes with high out-degree, as visible in the Sachs and child graphs. Intuitively, interventions on such nodes bring much information, as they affect multiple other nodes. In addition, the most frequently selected nodes in the Sachs, child, and asia graphs are also adjacent to the edges for which there exists a graph in the MEC that has the corresponding connection reversed (as indicated by the green color in Figure 4). Note that in general, establishing the directionality of such an edge  $(v,w)$  requires performing interventions on nodes  $v,w$  (recall Section 3.1).<sup>4</sup>
We further explore the interventional targets and verify that GIT is able to target the most uncertain regions of the graph. In the considered setup, we select a node  $v$  in the graph. Let  $E_v$  be edges adjacent to  $v$ . We set the structural parameters corresponding to edges  $e \notin E_v$  to the ground truth values and initialize in the standard way the parameters for  $e \in E_v$ . Such a model is only unsure
For example, in the ENCO framework the directionality parameter  $\theta_{ij}$  can only be reliably detected from the data obtained by intervening either on variable  $X_{j}$  or  $X_{i}$  [Lippe et al., 2022].
about the connectivity around  $v$ , while the rest of the solution is given. We then run the ENCO framework with GIT and report the intervention target distributions in Figure 5.
The interventions concentrate on  $v$  (red color) and its parents (green color). This indicates the efficiency of our approach, as these are most relevant to discovering the graph structure. Indeed, to recover the solution, only the parameters for  $e \in E_v$  need to be found. Intervening on  $v$  changes the distributions of its descendants, providing information on the existence of edges between these variables.
- The theoretical grounding of the method involves multiple assumptions. Further work that simplifies or relaxes the assumptions and identifies fail cases would benefit the community.
- We provide proof that epsilon-greedy GIT converges with any causal discovery framework. As for pure GIT, we show its convergence only with the ENCO framework. The development of a more general theory that solidifies the approach is a promising future work direction.
- Our method can be applied in the soft-intervention case, and providing appropriate experimental evaluation would be an interesting follow-up to this work.
- Our method may need more interventions than the minimal number required to identify the causal structure. For example, GIT can be biased towards high-degree nodes, as interventions on them tend to affect a larger amount of structural parameters and result in larger gradients, which might cause suboptimal choices.
- Intervention acquisition methods (including GIT) seem to be less effective in a continuous setting. We believe investigating this area would benefit the community.
In this paper, we consider the problem of experimental design for causal discovery. We introduce a novel Gradient-based Intervention Targeting (GIT) method, which leverages the gradients of gradient-based causal discovery objectives to score intervention targets. We demonstrate that the method is particularly effective in the low-data regime, outperforming competitive baselines. We also provide a theoretical justification for the method and perform several analyses, confirming that GIT typically selects informative targets.
The work of Piotr Miłos was supported by the Polish National Science Center grant UMO-2017/26/E/ST6/00622 and UMO-2019/35/O/ST6/03464. The work of Michal Zajac was supported by the Polish National Science Center Grant No. 2021/43/B/ST6/01456. The research of Michal Zajac and Aleksandra Nowak has been supported by a flagship project entitled "Artificial Intelligence Computing Center Core Facility" from the DigiWorld Priority Research Area under the Strategic Programme Excellence Initiative at Jagiellonian University. We gratefully acknowledge Polish high-performance computing infrastructure PLGrid for providing computer facilities and support. Our experiments were managed using https://neptune.ai. We thank the Neptune team for providing us access to the team version and technical support. We thank Swedish National Supercomputing and the Berzelius Cluster for providing compute resources.
Raj Agrawal, Chandler Squires, Karren D. Yang, Karthikeyan Shanmugam, and Caroline Uhler. Abcd-strategy: Budgeted experimental design for targeted causal structure discovery. In Kamalika Chaudhuri and Masashi Sugiyama, editors, The 22nd International Conference on Artificial Intelligence and Statistics, AISTATS 2019, 16-18 April 2019, Naha, Okinawa, Japan, volume 89 of Proceedings of Machine Learning Research, pages 3400-3409. PMLR, 2019. URL http://proceedings.mlr.press/v89/agrawal19b.html. (Cited on page 2)
Yashas Annadani, Jonas Rothfuss, Alexandre Lacoste, Nino Scherrer, Anirudh Goyal, Yoshua Bengio, and Stefan Bauer. Variational causal networks: Approximate bayesian inference over causal structures. arXiv preprint arXiv:2106.07635, 2021. (Cited on page 3)
Simon Tong and Daphne Koller. Active learning for structure in bayesian networks. In Bernhard Nebel, editor, Proceedings of the Seventeenth International Joint Conference on Artificial Intelligence, IJCAI 2001, Seattle, Washington, USA, August 4-10, 2001, pages 863-869. Morgan Kaufmann, 2001. (Cited on page 1)
Sofia Triantafillou, Vincenzo Lagani, Christina Heinze-Deml, Angelika Schmidt, Jesper Tegner, and Ioannis Tsamardinos. Predicting causal relationships from biological data: Applying automated causal discovery on mass cytometry data of human immune cells. *Scientific Reports*, 7(1):12724, Oct 2017. ISSN 2045-2322. doi: 10.1038/s41598-017-08582-x. URL https://doi.org/10.1038/s41598-017-08582-x. (Cited on page 1)
Ioannis Tsamardinos, Laura E. Brown, and Constantin F. Aliferis. The max-min hill-climbing bayesian network structure learning algorithm. Machine Learning, 65(1):31-78, Oct 2006. ISSN 1573-0565. doi: 10.1007/s10994-006-6889-7. URL https://doi.org/10.1007/s10994-006-6889-7. (Cited on page 7)
Ji Q. Wu, Nanda Horeweg, Marco de Bruyn, Remi A. Nout, Ina M. Jürgenliemk-Schulz, Ludy C. H. W. Lutgens, Jan J. Jobsen, Elzbieta M. van der Steen-Banasik, Hans W. Nijman, Vincent T. H. B. M. Smit, Tjalling Bosse, Carien L. Creutzberg, and Viktor H. Koelzer. Automated causal inference in application to randomized controlled clinical trials. Nature Machine Intelligence, 4(5):436-444, May 2022. ISSN 2522-5839. doi: 10.1038/s42256-022-00470-y. URL https://doi.org/10.1038/s42256-022-00470-y. (Cited on page 1)
Xun Zheng, Bryon Aragam, Pradeep K Ravikumar, and Eric P Xing. Dags with no tears: Continuous optimization for structure learning. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. URL https://proceedings.neurips.cc/paper/2018/file/e347c51419ffb23ca3fd5050202f9c3d-Paper.pdf. (Cited on page 19)
A Convergence of causal discovery with GIT
Suppose that we have some causal discovery algorithm  $\mathcal{A}$  which is guaranteed to converge to the true graph in the limit of infinite data. Here we investigate if such convergence property still holds if we extend  $\mathcal{A}$  with GIT.
Let us define  $\epsilon$ -greedy GIT as follows: every time we need to select an intervention target, we use GIT with probability  $1 - \epsilon$ , and otherwise, we choose randomly uniformly from all available targets.
Proposition 1. If the causal discovery algorithm  $\mathcal{A}$  is guaranteed to converge given an infinite amount of samples from each possible intervention target, then  $\mathcal{A}$  with  $\epsilon$ -greedy GIT is also guaranteed to converge.
Proof. Since the  $\epsilon$ -exploration guarantees visiting every target infinitely many times in the limit, the proof follows from the asserted convergence of  $\mathcal{A}$ .
Remark 2. ENCO with  $\epsilon$ -greedy GIT is guaranteed to converge to the true graph under the standard assumptions [Lippe et al., 2022, Appendix B.1].
Remark 3. Proposition 1 is asymptotic and holds for arbitrary  $\epsilon >0$ . However, in a finite setup, we can choose  $\epsilon$  small enough that  $\epsilon$ -GIT and GIT behave similarly. Our experiments show that GIT performs well (compared with other benchmarks) and is indistinguishable from an asymptotically convergent method.
B Convergence conditions of ENCO framework with GIT
B.1 Preliminaries (ENCO recap)
In this section, we recall results from Lippe et al. [2022] for convergence of their causal discovery method ENCO. They formulate four theorems and a set of conditions that guarantee that the parameters of the structure converge to the true graph. For full proof and detailed explanation please refer to Appendix B in Lippe et al. [2022].
Remark 4. ENCO identifies common conditions for correct convergence of directionality parameters. They go as follows (see theorems B.1, B.2, and appendix B.4 in ENCO):
1. For all possible sets of parents of  $X_{j}$  excluding  $X_{i}$ , adding  $X_{i}$  improves the log-likelihood estimate of  $X_{j}$  under the intervention on  $X_{i}$ , or leaves it unchanged.
$$
\forall \widehat {\mathbf {p a}} (X _ {j}) \subseteq X _ {- i, j}: \mathbb {E} _ {I _ {X _ {i}}, \mathbf {X}} \left[ \log p (X _ {j} | \widehat {\mathbf {p a}} (X _ {j}), X _ {i}) - \log p (X _ {j} | \widehat {\mathbf {p a}} (X _ {j})) \right] \geq 0
$$
2. There exists a set of nodes  $\widehat{\mathrm{pa}}(X_j)$ , for which the probability to be sampled as parents of  $X_j$  is greater than 0, and the following condition holds:
$$
\exists \widehat {\mathbf {p a}} (X _ {j}) \subseteq X _ {- i, j}: \mathbb {E} _ {I _ {X _ {i}}, \mathbf {X}} \left[ \log p (X _ {j} | \widehat {\mathbf {p a}} (X _ {j}), X _ {i}) - \log p (X _ {j} | \widehat {\mathbf {p a}} (X _ {j})) \right] > 0
$$
3. For all possible sets of parents of  $X_{i}$  excluding  $X_{j}$ , adding  $X_{j}$  does not improve the log-likelihood estimate of  $X_{i}$  under the intervention on  $X_{j}$ , or leaves it unchanged.
$$
\forall \widehat {\mathbf {p a}} (X _ {i}) \subseteq X _ {- i, j}: \mathbb {E} _ {I _ {X _ {j}}, \mathbf {X}} [ \log p (X _ {i} | \widehat {\mathbf {p a}} (X _ {i}), X _ {j}) - \log p (X _ {i} | \widehat {\mathbf {p a}} (X _ {i})) ] \geq 0
$$
For at least one parent set  $\widehat{\mathrm{pa}}(X_i)$ , which has a probability greater than zero to be sampled, this inequality is strictly smaller than zero.
Remark 5. The following condition guarantees convergence of existence parameters (see theorem B.3 in ENCO):
$$
\min _ {\hat {\mathbf {p a}} \subseteq \mathbf {g p a} _ {i} (X _ {j})} \mathbb {E} _ {\hat {I} \sim p _ {I _ {- j}} (I)} \mathbb {E} _ {\tilde {p} _ {\hat {I}}} (\boldsymbol {x}) \left[ \log p (X _ {j} | \hat {\mathbf {p a}}, X _ {i}) - \log p (X _ {j} | \hat {\mathbf {p a}}) \right] > \lambda_ {s p a r s e}
$$
where  $\mathrm{gpa}_i(X_j)$  is a set of nodes excluding  $X_{i}$  which, according to the ground truth graph, could have an edge to  $X_{j}$  without introducing a cycle,  $p_{I_{-j}}(I)$  refers to the distribution over conducted interventions  $p_I(I)$  excluding the intervention on variable  $X_{j}$ , and  $\lambda_{\text{sparse}}$  is a positive constant.
Theorem 6. (Theorem B.1 from Appendix B.4 in ENCO.) Consider the edge  $X_{i} \to X_{j}$  in the true causal graph. The orientation parameter  $\theta_{ij}$  converges to  $\sigma(\theta_{ij}) = 1$  if the conditions from remark 4 are fulfilled.
Theorem 7. (Theorem B.2 from Appendix B.4 in ENCO.) Consider a pair of variables  $X_{i}$ ,  $X_{j}$  for which  $X_{i}$  is an ancestor of  $X_{j}$  without direct edge in the true causal graph. Assume all edges that appear in the true graph have converged according to theorem 6. The orientation parameter  $\theta_{ij}$  converges to  $\sigma(\theta_{ij}) = 1$  if the conditions from remark 4 are fulfilled.
By Appendix B.4 from ENCO, Theorems 6, 7 hold regardless of whether we collected interventional data from node  $X_{i}$  or  $X_{j}$ .
Theorem 8. Consider an edge  $X_{i} \to X_{j}$  in the true causal graph. The parameter  $\gamma_{ij}$  converges to  $\sigma(\gamma_{ij}) = 1$  if the condition from remark 5 holds.
Theorem 9. Assume for all edges  $X_{i}\rightarrow X_{j}$  in the true causal graph,  $\sigma (\theta_{ij})$  and  $\sigma (\gamma_{ij})$  have converged to one. Then, the likelihood of all other edges, i.e.  $\sigma (\theta_{lk})\cdot \sigma (\gamma_{lk})$  will converge to zero under the condition that  $\lambda_{sparse} > 0$
B.2 GIT-privileged proof
We follow with proof of ENCO convergence with the GIT-privileged acquisition method under the same set of conditions from remarks 4, 5. We show that GIT-privileged collects interventional data as long as it is needed for the orientation parameters to converge according to theorems 6 and 7. Then theorems 8 and 9 can be applied to show that the algorithm reached convergence.
Assumption We assume that in all local minima of our loss function, the existence parameters take extreme values:  $\forall_{i,j}\sigma (\gamma_{ij})\in \{0,1\}$ , thus, when sufficient time for optimization is given, they stop contributing to the score. Hence in our analysis, we focus on describing only the behavior of orientation parameter gradients.
The proof is structured as follows: