REX: Explainable Causal Discovery
- REX is a causal-discovery method that leverages machine learning models and Shapley value explainability to infer directed acyclic graphs from observational data.
- It integrates supervised regression, bootstrapped parent selection, and additive noise-model tests to determine causal relationships with high precision.
- Empirical evaluations show that REX outperforms traditional methods with superior F1 scores and minimal false positives in continuous data settings.
Rex, in contemporary machine-learning research, commonly denotes REX, a causal-discovery method that leverages machine-learning models and Shapley-value explainability to infer directed acyclic graphs (DAGs) from purely observational data. It was introduced to address the claim that no causal discovery methods currently incorporate explainability into their models to derive causal graphs, and it is designed to identify and interpret significant causal relationships among continuous variables while minimizing false positive predictions. In this formulation, REX bridges predictive modeling and causal inference by coupling supervised regressors with explainability and additive-noise-based edge orientation (Renero et al., 22 Jan 2025).
1. Scope and problem formulation
REX addresses observational causal discovery: given i.i.d. samples of continuous variables drawn from an unknown joint distribution, infer the underlying causal DAG , where each directed edge indicates a direct causal influence. The framework is explicitly positioned against classical methods such as PC, GES, LiNGAM, CAM, and NOTEARS, which are described as relying on strong parametric assumptions, struggling with high-dimensional nonlinearity, or producing “black-box” structures difficult to interpret (Renero et al., 22 Jan 2025).
The central idea is to use predictive models not merely as function approximators, but as instruments for causal-structure recovery. For each target variable , REX trains regressors on the remaining variables and then uses Shapley-value explainability to isolate features that are consistently influential. These candidate parent sets are aggregated through bootstrapping into a graph skeleton, after which edge directions are inferred through Additive Noise Model (ANM) tests. The resulting pipeline is intended to recover true causal structure while maintaining a strong bias against spurious edge inclusion.
REX is formulated for continuous tabular data and is evaluated in both synthetic structural-equation settings and a real biological signaling dataset. Its public implementation is available at https://github.com/renero/causalgraph, together with synthetic dataset generators, Sachs preprocessing, the full implementation, and notebooks reproducing the experiments.
2. Formal basis: DAGs, SEMs, and Shapley values
The framework assumes the standard language of causal graphical models. A DAG consists of nodes and edges , with no directed cycles. Under the Causal Markov Condition, the joint distribution factorizes as
REX also adopts Faithfulness, namely that all and only the conditional independencies entailed by appear in 0. The data-generating process is described through a Structural Equation Model (SEM) of the form
1
with independent noise terms (Renero et al., 22 Jan 2025).
Its distinctive component is the use of Shapley values from cooperative game theory as a proxy for conditional dependence structure. For a target 2 and feature set 3, the Shapley value for 4 is
5
The marginal term 6 is linked to conditional independence through the statement that 7 if and only if 8. Aggregating over coalitions yields
9
so that 0 is proportional to both the strength and the Shapley-weighted probability of conditional dependence. In effect, REX uses feature attribution not simply as post-hoc interpretability, but as a mechanism for narrowing the causal search to variables that repeatedly contribute predictive information.
3. Algorithmic pipeline
REX proceeds in three phases. The first is model training. For each variable 1, it trains two regressors 2: a Deep Feed-forward Network (DFN) with additive uniform noise input 3, and Gradient-Boosting Trees (GBT, XGBoost). Hyperparameters are tuned via a Tree-structured Parzen Estimator (TPE) on an 80/20 split, optimizing mean squared error.
The second phase is bootstrapped parent selection. For 4, typically 5, REX samples a bootstrap subset 6. For each target 7, it computes interventional SHAP values 8, using GradientExplainer for DFN and TreeExplainer for GBT. It then clusters the SHAP values with DBSCAN to separate influential features from non-influential ones. The parent-selection routine dynamically reduces 9 until DBSCAN yields more than one cluster, and returns the cluster with highest average 0 as 1. Each selected parent increments an adjacency matrix 2; after 3 iterations, 4 is normalized by 5 and thresholded by a frequency cutoff 6 to produce an undirected skeleton (Renero et al., 22 Jan 2025).
The third phase is edge orientation and cycle removal. For each undirected edge 7 in the skeleton, REX fits two regressions under an ANM, for example with a Gaussian Process or GAM,
8
and tests residual–predictor independence with HSIC. The accepted direction is the one whose residuals are independent. The DFN-based and GBT-based DAGs are then unioned to capture any edge detected by either model. If cycles or bidirectional edges remain, REX computes a SHAP discrepancy
9
and iteratively reverses or drops the edge with highest 0 until acyclicity is achieved. This cycle-resolution procedure is one of the framework’s interpretability-driven design choices: edge retention is tied to the agreement between observed target variation and the attributed explanatory pattern.
4. Empirical evaluation
The synthetic evaluation uses five families of generative SEMs—linear, polynomial, sigmoid-additive, Gaussian-additive, and Gaussian-mixed—following the cited prior work. For each family, 10 random DAGs are generated with 1 nodes and 2 samples, giving 200 datasets in total. The real-data evaluation uses the Sachs single-cell protein-signaling dataset with 3 and 4, together with known tiered prior constraints. Baselines are PC, FCI, GES, LiNGAM, NOTEARS, and CAM, with default settings except that the NOTEARS threshold is tuned. The reported metrics are true and false positives and negatives with orientation, precision, recall, 5, Structural Hamming Distance (SHD), and Structural Intervention Distance (SID). The implementation is reported on an Apple M2 Pro, 32 GB RAM, no parallelization (Renero et al., 22 Jan 2025).
On synthetic benchmarks with 6–25, REX achieves median 7 for 8 and outperforms all compared methods in 9 and precision. SHD and SID remain low and are often the lowest median. Computational time grows roughly quadratically in 0, with SHAP identified as the dominant cost.
On the Sachs dataset, REX reports Precision = 0.952, Recall = 0.471, 1, with SHD = 9 and SID = 39. It is stated to recover almost no false edges and to correctly orient key signaling relationships with no incorrect edges. The same evaluation reports that it outperforms PC (2), FCI (0.516), GES (0.273), LiNGAM (0.134), NOTEARS (0.270), and CAM (0.353). The emphasis of these results is not merely higher aggregate score, but a particular operating point characterized by very high precision and limited false-positive structure.
5. Interpretability, robustness, and operational constraints
The principal stated advantages of REX are high precision, interpretability, model-agnosticism, and robustness. High precision is attributed to the combination of robust Shapley-driven parent selection and bootstrapping. Interpretability arises because every edge is backed by quantitative feature-attribution evidence 3 and discrepancy measures. Model-agnosticism follows from the claim that any regressor with SHAP support can be plugged in. Robustness is associated with combining DFN and GBT so that complementary nonlinearities can be captured (Renero et al., 22 Jan 2025).
The limitations are equally explicit. First, the computational cost of SHAP grows exponentially in feature count, which is mitigated by sampling and interventional explainers but remains heavy for 4. Second, recall can be moderate in very dense graphs, described as a trade-off for high precision. Third, multicollinearity may blur Shapley contributions; this is addressed partially via interventional explainers but remains an open challenge.
Practical guidance is given in complexity and hyperparameter form. The overall complexity is described as roughly
5
In practice, 6 bootstraps and interventional SHAP strike a balance between accuracy and speed. Additional stated settings include bootstrap sample fraction 7 with 8, DBSCAN minimum cluster size 9, dynamically reduced 0 until at least two clusters, adjacency threshold 1 filtering edges appearing in fewer than 20–30% of iterations, DFN architectures with 3–5 hidden layers and ReLU, noise input 2, and GBT with XGBoost default learning rate 3 and max depth 4.
The future-work directions listed for REX are approximate SHAP for scalability, incorporation of Lasso- or CatBoost-based regressors, extension to out-of-distribution settings, refinement of parent selection beyond DBSCAN, and acceleration through GPU or distributed computing. A plausible implication is that the present framework is best understood as a high-precision, interpretation-oriented causal-discovery system rather than a general-purpose large-scale graph learner.
6. Disambiguation and related uses of the name
The term Rex, REX, or REx is strongly overloaded across arXiv and adjacent research domains. In machine learning alone, “Out-of-Distribution Generalization via Risk Extrapolation (REx)” defines REx as a robust-optimization principle that reduces variance of risk across training domains (Krueger et al., 2020), whereas “REX: Rapid Exploration and eXploitation for AI Agents” uses REX for an LLM-agent framework based on UCB-style exploration and external reward bookkeeping (Murthy et al., 2023). In explainable medical imaging, “3D ReX: Causal Explanations in 3D Neuroimaging Classification” denotes a post-hoc actual-causality method for responsibility maps in stroke detection (Navaratnarajah et al., 14 Feb 2025), and “ReX-MLE: The Autonomous Agent Benchmark for Medical Imaging Challenges” denotes a benchmark for autonomous coding agents on medical-imaging competitions (Kenia et al., 19 Dec 2025). In vision-language modeling, “Rex-Thinker: Grounded Object Referring via Chain-of-Thought Reasoning” refers to a referring-expression model trained with CoT supervision and GRPO (Jiang et al., 4 Jun 2025).
Outside that cluster, the same label appears in knowledge-graph search, rule extraction, astronomy, and combinatorial game theory. “REX: Explaining Relationships between Entity Pairs” introduces a knowledge-base system for enumerating and ranking minimal relationship explanations (Fang et al., 2011). “REx: An Efficient Rule Generator” names an ANN rule-extraction algorithm (Kamruzzaman, 2010). In astrophysics, REX is a catalogue of Radio-Emitting X-ray sources and Te-REX is a TeV-emitting candidate sample derived from it (Balmaverde et al., 2019), while T-ReX abbreviates “The Tarantula -- Revealed by X-rays” (Townsley et al., 2024). In game theory, Rex denotes reverse Hex, and Rex+ is its multi-stone-turn variant (Keras, 1 Jun 2026).
This suggests that the meaning of “Rex” is domain-dependent and that technical discussion requires immediate disambiguation. In current causal-discovery literature, however, the term most specifically denotes the explainability-driven DAG-learning framework introduced in 2025 (Renero et al., 22 Jan 2025).