A Knowledge-Informed Pretrained Model for Causal Discovery

Wenbo Xu, Yue He, Yunhai Wang, Xingxuan Zhang, Kun Kuang, Yueguo Chen, Peng CuiarXiv 2026

TL;DR

Kode is a novel, knowledge-informed pretrained model for causal discovery that bridges the gap between purely data-driven approaches and rigid prior-based methods. By integrating coarse, uncertain domain knowledge (such as identifying which causal relationships are "impossible" or "plausible") alongside observational data, Kode achieves state-of-the-art performance and demonstrates robust zero-shot generalization on real-world datasets.

What Problem Does This Paper Address?

Causal discovery—the process of identifying directed cause-and-effect relationships (Directed Acyclic Graphs, or DAGs) from observational data—is fundamental to scientific explanation and decision-making. However, existing algorithms typically fall into two problematic extremes:

  1. Purely data-driven paradigms: These rely heavily on strict mathematical assumptions or expensive interventional data, often failing when real-world data mechanisms mismatch their assumptions.
  2. Rigid prior-based methods: These require exact, partial ground-truth graphs as hard constraints, which is rarely feasible in practice.

In reality, human experts usually possess coarse-grained, imperfect domain knowledge. For example, an industrial engineer might confidently know that a downstream process cannot causally affect an upstream process, or that a relationship is plausible but unconfirmed.

Example of coarse expert knowledge vs. ground-truth causal graph

The authors address this gap by proposing a framework that treats weak, incomplete prior knowledge as a flexible, soft guide rather than an absolute constraint.

Methods

The authors introduce Kode, an end-to-end architecture designed to synthesize noisy tabular data with structural prior knowledge.

The overall pipeline and architecture of Kode

Key components of the methodology include:

  • Knowledge Encoding: Expert intuition is formalized into a structural reachability matrix $G_P \in \{-1, 0, 1\}^{N \times N}$, where 1 indicates a relationship may hold (direct or indirect), 0 means it is impossible, and -1 represents unknown relations.
  • Dual-Source Encoder: Tabular observations and the reachability matrix are projected into a shared latent space. The model processes them using an Alternating Attention Mechanism, which switches between capturing dependencies across samples (even-numbered layers) and dependencies across variables (odd-numbered layers).
  • Cross-Attention Integration: A cross-attention block compresses and fuses the data and knowledge representations into a unified embedding space, softly biasing the model toward the prior without overriding strong data-driven signals.
  • Graph Decoder: Valid DAGs are sampled using a Gumbel-Sinkhorn relaxation paired with Hungarian hardening to output discrete permutation matrices, naturally enforcing acyclicity.
  • Curriculum Learning Strategy: To prevent the model from over-relying on dense priors or ignoring sparse ones, the authors implement a staged training scheme. Over successive epochs, the training process smoothly transitions from using complete knowledge to increasingly sparse and challenging prior configurations.

Datasets

The model was pretrained on a massive synthetic corpus and evaluated on both synthetic and real-world benchmarks:

  • Synthetic Pretraining Corpus: 300,000 distinct causal graphs generated using Erdos–Rényi paradigms (densities ranging from ER(1) to ER(3)) across variable scales ($N \in \{20, 30, 40\}$). It includes both linear additive noise models and non-linear multi-layer perceptrons (MLPs) with heteroscedastic noise.
  • Real-World Industrial Benchmarks (CIPCaD-Bench):
  • Ultra-processed Food: A dense, complex food production pipeline dataset containing 17 variables and 83 edges.
  • Tennessee Eastman Process (TEP): A sparse chemical process system dataset consisting of 33 variables and 32 edges.
  • Real-World Biological Benchmark: The Sachs dataset, a widely used benchmark tracking protein-signaling networks (11 variables, 18 edges).

Key Insights and Ideas

  • The Power of "Negative" Knowledge: Simply informing the model about what is impossible (ruling out edges) yields substantial performance boosts. Confirming exact positive edges isn't strictly necessary for the model to improve its causal inference.
  • Size Invariance via Padding: By utilizing a max-variable zero-padding strategy combined with structural knowledge, the model explicitly learns the absence of interactions for non-existent variables. This allows Kode to adapt its causal reasoning dynamically across different graph sizes.
  • Robust Zero-Shot Generalization: Even though the model was trained purely on synthetic data, it successfully generalized to complex, out-of-distribution real-world industrial and biological systems without any fine-tuning.

Key Results

Kode consistently outperformed traditional constraint-based (PC), score-based (GES), and functional (LiNGAM) methods, as well as recent deep-learning meta-learners (AVICI, BCNP).

  • Zero-Prior Performance: Remarkably, even when evaluated with 0% prior knowledge (operating purely data-driven), Kode matched or exceeded the performance of existing data-driven baselines, demonstrating the strength of its underlying encoder-decoder architecture.
  • Performance Across Scales: As shown below, Kode maintains a distinct advantage in F1 score across varying numbers of variables, whereas traditional methods like GES collapse under high density at larger scales.
  • Industrial Application: On the Tennessee Eastman Process benchmark, Kode with topological priors achieved an F1 score of 0.44 and a Structural Hamming Distance (SHD) of 31.26, significantly outperforming the next best baseline, BCNP (F1: 0.31, SHD: 35.58).

Limitations and Future Work

  • Max-Variable Constraint: The model relies on a max-variable padding strategy ($N_{max}$). While effective up to the limit, scaling the model to massive graphs significantly larger than the pretraining threshold could introduce attention allocation challenges.
  • Pairwise Prior Limitations: The reachability matrix format is fundamentally pairwise (variable $i$ to variable $j$). Future iterations could explore incorporating higher-level logic, such as conditional independence priors or continuous confidence scores directly into the embedding space.

Summary updated

BibTeX
@misc{xu2026knowledge,
  author = {Wenbo Xu and Yue He and Yunhai Wang and Xingxuan Zhang and Kun Kuang and Yueguo Chen and Peng Cui},
  title = {{A Knowledge-Informed Pretrained Model for Causal Discovery}},
  year = {2026},
  eprint = {2603.20842},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.20842},
}
Figure