CausalCACTUS: A Causally Consistent and Context-Aware Framework for Counterfactual Explanations
Abstract Counterfactual explanations have been proposed to provide actionable insights for complex black-box classifiers by suggesting “what-if” explanations that alter undesirable prediction outcomes to desired ones. Recent advances have emphasized desirable properties such as causality, plausibility, and contextual alignment; however, existing methods often address these objectives in isolation. In particular, causal counterfactual approaches enforce structural dependencies among features, typically assuming access to a fully specified structural causal model, while context-aware counterfactual frameworks focus on improving alignment with user-defined contextual constraints. As a result, a gap remains between context-aware and causally grounded counterfactual generation, especially in latent-space representations, which can jointly address multiple objectives and improve validity across domains. In this work, we introduce CausalCACTUS, a causally consistent and context-aware counterfactual explanation framework that extends the CACTUS method by integrating automatically learned causal structure into latent-space counterfactual generation using a composite $$\beta $$ -VAE model. CausalCACTUS incorporates a directed acyclic graph learned from data-driven causal discovery to impose causal feasibility constraints, together with a phase-based latent optimization strategy that improves convergence stability and counterfactual validity while preserving user-defined contextual constraints. Our experimental evaluation across five publicly available tabular datasets and multiple baseline models demonstrates that CausalCACTUS achieves improved context alignment and causal consistency metrics while maintaining competitive performance on standard counterfactual metrics, such as validity and proximity. Ablation studies and qualitative examples further illustrate that jointly enforcing context preservation and causal structure leads to more actionable, trustworthy counterfactual explanations that respect user-defined contexts and causal dependencies in real-world scenarios.
Authors
- Magnus Jansson (ORCID: https://orcid.org/0000-0002-6855-5868)
- José María Enguita
- Zhendong Wang (ORCID: https://orcid.org/0000-0002-8575-421X)
- Diego García (ORCID: https://orcid.org/0000-0002-5047-6846)
- Saikat Chatterjee
Institutions
- Universidad de Oviedo (ES)
- KTH Royal Institute of Technology (SE)
Publication Details
- Journal
- Machine Learning
- Published
- 2026-09-28
- DOI
- https://doi.org/10.1007/s10994-026-07155-2
- Primary Topic
- Explainable Artificial Intelligence (XAI)
- Type
- article
- Field-Weighted Citation Impact
- 0.00