Estimating categorical counterfactuals via deep twin networks

Vlontzos A, Kainz B, Gilligan-Lee CM (2023)

Publication Type: Journal article

Publication year: 2023


Book Volume: 5

Pages Range: 159-168

Journal Issue: 2

DOI: 10.1038/s42256-023-00611-x


Counterfactual inference is a powerful tool, capable of solving challenging problems in high-profile sectors. To perform counterfactual inference, we require knowledge of the underlying causal mechanisms. However, causal mechanisms cannot be uniquely determined from observations and interventions alone. This raises the question of how to choose the causal mechanisms so that the resulting counterfactual inference is trustworthy in a given domain. This question has been addressed in causal models with binary variables, but for the case of categorical variables, it remains unanswered. We address this challenge by introducing for causal models with categorical variables the notion of counterfactual ordering, a principle positing desirable properties that causal mechanisms should possess and prove that it is equivalent to specific functional constraints on the causal mechanisms. To learn causal mechanisms satisfying these constraints, and perform counterfactual inference with them, we introduce deep twin networks. These are deep neural networks that, when trained, are capable of twin network counterfactual inference—an alternative to the abduction–action–prediction method. We empirically test our approach on diverse real-world and semisynthetic data from medicine, epidemiology and finance, reporting accurate estimation of counterfactual probabilities while demonstrating the issues that arise with counterfactual reasoning when counterfactual ordering is not enforced

Authors with CRIS profile

Involved external institutions

How to cite


Vlontzos, A., Kainz, B., & Gilligan-Lee, C.M. (2023). Estimating categorical counterfactuals via deep twin networks. Nature Machine Intelligence, 5(2), 159-168.


Vlontzos, Athanasios, Bernhard Kainz, and Ciarán M. Gilligan-Lee. "Estimating categorical counterfactuals via deep twin networks." Nature Machine Intelligence 5.2 (2023): 159-168.

BibTeX: Download