Cohomological Obstructions to Global Counterfactuals: A Sheaf-Theoretic Foundation for Generative Causal Models
Authors: Rui Wu, Hong Xie, Yongjun Li
Organizations: School of Management, University of Science and Technology of China · School of Computer Science and Engineering, University of Science and Technology of China
Current continuous generative models (e.g., Diffusion Models, Flow Matching) implicitly assume that locally consistent causal mechanisms naturally yield globally coherent counterfactuals. In this paper, we prove that this assumption fails fundamentally when the causal graph exhibits non-trivial homology (e.g., structural conflicts or hidden confounders). We formalize structural causal models as cellular sheaves over Wasserstein spaces, providing a strict algebraic topological definition of cohomological obstructions in measure spaces. To ensure computational tractability and avoid deterministic singularities (which we define as manifold tearing), we introduce entropic regularization and derive the Entropic Wasserstein Causal Sheaf Laplacian, a novel system of coupled non-linear Fokker-Planck equations. Crucially, we prove an entropic pullback lemma for the first variation of pushforward measures. By integrating this with the Implicit Function Theorem (IFT) on Sinkhorn optimality conditions, we establish a direct algorithmic bridge to automatic differentiation (VJP), achieving O(1)-memory reverse-mode gradients strictly independent of the iteration horizon. Empirically, our framework successfully leverages thermodynamic noise to navigate topological barriers ("entropic tunneling") in high-dimensional scRNA-seq counterfactuals. Finally, we invert this theoretical framework to introduce the Topological Causal Score, demonstrating that our Sheaf Laplacian acts as a highly sensitive algebraic detector for topology-aware causal discovery.
Figures & tables
Figure 1: The impact of topological obstructions on causal generative models. (a) Unregularized, deterministic models attempt to resolve the contradiction by pushing probability measures to infinity, resulting in catastrophic manifold tearing. (b) Our proposed Entropic Sheaf Laplacian leverages thermodynamic diffusion to gracefully resolve the conflict, guiding the system to a globally coherent stationary state.
Figure 2: High-resolution vector field of the 2D Wasserstein Sheaf Flow over 500 steps, overcoming orthogonal topological conflicts.
Metric
Initial ( t=0 )
Converged ( t=500 )
Change / Shift
Causal Dirichlet Energy
128.38
45.54
−64.53%
Node C Center of Mass
(8.01,0.01)
(5.79,1.22)
(−2.21,+1.21)
Node A Center of Mass
(0.00,0.03)
(0.97,−1.54)
(+0.97,−1.57)
Node A Variance
-
41.10
Stable (Compact)
Table 1: Quantitative analysis of the 500-step Entropic Sheaf Flow.
Figure 3: Algorithmic Benchmarks (IFT vs. Naive Unrolling). (Left): Gradient computation time per backward pass. The IFT explicitly avoids traversing the L -step computational graph, achieving significant acceleration. (Right): Reverse-mode memory footprint. Naive unrolling suffers from catastrophic O(L⋅N2) linear explosion, effectively prohibiting high-dimensional deep learning. In stark contrast, our IFT-VJP formulation dynamically strictly bounds the memory strictly to O(N2) , rendering the algorithmic footprint completely invariant to the Sinkhorn horizon.
Figure 4: Counterfactual Intervention on PBMC 3k scRNA-seq. The Naive ODE (dashed gray) fails by entering the zero-density void (Biological Chimera). The GACF Path (solid red) autonomously navigates the manifold, utilizing entropic tunneling to overcome the topological frustration and reach the target Monocyte cluster.
Candidate Graph Topology
Cohomological Status
Topological Score S(G)
Energy Gap Ratio
True Graph ( Gtrue )
H1=0 (Exact)
5.9287
1.0x (Baseline)
Spurious Graph ( Gcand )
H1=0 (Frustrated)
22.4863
3.79x (Bottlenecked)
Table 2: Quantitative comparison of the steady-state Topological Causal Scores. The spurious graph exhibits a massive residual energy gap due to the unresolvable harmonic flow.
Figure 5: Evolution of the Topological Causal Score S(G) during the Entropic Sheaf Flow. The Dirichlet energy of the true graph converges to the thermodynamic floor, whereas the spurious graph is permanently trapped by the H1 topological barrier, perfectly verifying Theorem 14 .
Causal counterfactual generation creates plausible alternative outcomes under interventions while preserving the relevant causal structure of a scenario.
Judea Pearl's do-calculus provides a foundation for causal inference, but its translation to continuous generative models remains fraught with geometric challenges. We establish the fundamental limits of such interventions. We define the Counterfactual Event Horizon and prove the Manifold Tearing Theorem: deterministic flows inevitably develop finite-time singularities under extreme interventions. We establish the Causal Uncertainty Principle for the trade-off between intervention extremity and identity preservation. Finally, we introduce Geometry-Aware Causal Flow (GACF), a scalable algorithm that utilizes a topological radar to bypass manifold tearing, validated on high-dimensional scRNA-seq data.
Rui Wu, Hong Xie, Yongjun Li
School of Management, University of Science and Technology of China 96 Jinzhai Road, Hefei, 230026, Anhui, China · School of Computer Science and Engineering, University of Science and Technology of China 96 Jinzhai Road, Hefei, 230026, Anhui, China
Counterfactual generation seeks to sample outcomes under a hypothetical intervention or decision using observational data collected under the factual assignment mechanism. We develop a flow-matching approach that combines a sample-split, doubly robust training objective with a learned coupling between observed source outcomes and target outcomes drawn from a fitted conditional outcome model. To enable finite-step generation, we leverage a score-corrected stochastic sampler based on a Gaussian-smoothed interpolation. Our main theoretical contribution is a coupling-sensitive KL bound for constant-step Euler discretization: the error is controlled by moments of the source--target displacement under the chosen coupling, rather than by global uniform regularity of the velocity field, and has near-linear dependence on the ambient dimension. We also establish finite-sample non-parametric guarantees for the learned velocity and score fields when both the conditional outcome model and the source-target coupling are estimated from data. These bounds separate approximation, coupling-replacement, nuisance-estimation, generalization, and Monte Carlo errors and, combined with the sampler analysis, yield an end-to-end guarantee for counterfactual generation. Experiments on synthetic and semi-synthetic image benchmarks support the coupling-dependent theory and show that, at finite discretization budgets, the stochastic sampler can outperform the corresponding deterministic ODE sampler.
Causal generative modeling is essential for developing reliable and transparent AI systems capable of counterfactual reasoning. While existing approaches focus on integrating causal constraints during the training of generative models, they often lack a unified framework to leverage the zero-shot reasoning capabilities of pretrained foundation models. We introduce FM-CGM, a modular framework for end-to-end visual causal reasoning using pretrained foundation models. FM-CGM formalizes the causal pipeline through three core components: a concept extractor, a concept manipulator, and a counterfactual generator. By leveraging a large reasoning model for causal inference and a text-to-image diffusion model for generation, our approach enables zero-shot causal discovery, intervention, and counterfactual generation. We then develop Causal Semantic Guidance (CSG), a cross-attention-based mechanism that ensures semantic interventions propagate to descendant concepts while preserving invariant regions. We empirically show that our approach can identify plausible causal structures and is suitable for faithful counterfactual image generation.
Aneesh Komanduri, Xintao Wu
University of Arkansas Fayetteville, Arkansas, USA