Discovering the causal structure—understanding who causes what—among a set of variables is a foundational task in empirical science. This paper introduces a novel approach to causal discovery by framing the search for a Directed Acyclic Graph (DAG) as a reinforcement learning (RL) problem. By using an encoder-decoder architecture to generate graphs and a reward function based on traditional scoring metrics plus acyclicity penalties, this method demonstrates a flexible search strategy that outperforms traditional heuristics and recent gradient-based methods, especially in nonlinear scenarios.
The Challenge of Causal Discovery
Traditionally, causal discovery is performed via "score-based" methods that attempt to find a DAG maximizing a predefined score function. However, this is an NP-hard problem because the number of possible graphs grows super-exponentially with the number of variables.
Existing solutions generally fall into two camps, both with notable drawbacks:
- Local Heuristics: Methods like Greedy Equivalence Search (GES) add or remove edges one by one. While fast, they often get stuck in local optima, particularly when working with finite data.
- Continuous Optimization: Recent "differentiable" methods (like NOTEARS) convert the discrete graph search into a continuous optimization problem. While elegant, they require the score function to be a smooth, differentiable loss, which excludes many powerful, non-differentiable scoring metrics.
The authors aim to bridge this gap, combining the global search power of neural networks with the flexibility to use any score function, regardless of its mathematical smoothness.
An RL-Based Search Strategy
To achieve this, the authors propose an RL-based search strategy utilizing an Actor-Critic setup.
- The Actor (Encoder-Decoder): The model takes the observed data as input. A Transformer-based encoder captures the complex relationships between variables. A single-layer decoder then generates a binary adjacency matrix (the graph) by predicting the probability of an edge existing between any two nodes.
- The Reward Function: The reward acts as the "brain" of the RL agent. It is calculated as the negative of a score (like the Bayesian Information Criterion, or BIC) plus two penalty terms that punish the agent for creating cycles. This forces the agent to find graphs that are both high-scoring and acyclic.
- RL as Search: Unlike typical RL where the goal is to learn a perfect generalized policy, here RL is used strictly as a search engine. The authors keep track of every graph generated during training and simply output the one that achieved the highest reward.
- Training: The REINFORCE algorithm is used to update the neural network weights, effectively encouraging the model to generate graphs that resemble the high-reward ones it previously found.
Key Insights
Decoupling Search from Scoring: Because RL only requires a scalar reward, the "score" does not have to be differentiable. This allows the use of Gaussian Processes or Quadratic Regression to calculate the BIC, enabling the discovery of complex nonlinear causal links that linear methods would miss.
The "Best-Ever" Strategy: By treating RL as a search process rather than a policy-learning process, the model can explore widely. Even if the final policy remains "unsure," the agent might have stumbled upon the true DAG during its exploration phase.
Acyclicity via Penalties: The model utilizes a smooth characterization of acyclicity as a soft penalty, combined with a hard indicator penalty. This "curriculum" of penalties helps the agent gradually learn to avoid cycles without being immediately discouraged by the complexity of the constraint.
Results and Performance
The approach was rigorously evaluated on both synthetic and real-world datasets:
- Superior Search Ability: On 12-node linear datasets, the RL-based approach (specifically
RL-BIC2) achieved perfect recovery (0 False Discovery Rate, 1.0 True Positive Rate), significantly outperforming traditional GES and PC algorithms. - Nonlinear Dominance: In quadratic and Gaussian Process experiments, the RL method easily outperformed recent gradient-based competitors like DAG-GNN and GraN-DAG. For instance, on quadratic models, the RL method achieved a Structural Hamming Distance (SHD) of 0.6, while the next best method lagged at 5.2.
- Real-World Success: On the classic Sachs dataset (a protein signaling network based on flow cytometry data), the RL approach identified more correct edges and maintained a lower SHD than most traditional and neural-network-based baselines.
Limitations and Future Work
While powerful, the approach has limitations. Calculating rewards—especially when using Gaussian Processes for nonlinear scoring—is computationally expensive. Training the RL agent requires thousands of iterations, making it slower than simple greedy heuristics. Furthermore, while the authors demonstrated success on graphs of up to 30 nodes, scaling to larger graphs (50-100+ nodes) remains a significant challenge due to the exploding search space.
Finally, the scheduling of the penalty weights ($\lambda_1, \lambda_2$) is highly sensitive. If the penalty for cycles is too high too early, the agent stops exploring; if it's too low, it never learns to produce valid DAGs. Future directions may include developing more efficient score functions and exploring asynchronous RL algorithms (like A3C) to accelerate the discovery process.
Summary updated