Causal Reasoning from Meta-reinforcement Learning

Ishita Dasgupta, Jane X. Wang, Silvia Chiappa, Jovana Mitrovic, Pedro A. Ortega, David Raposo, Edward Hughes, Peter W. Battaglia, Matthew M. Botvinick, Zeb Kurth-NelsonarXiv 2019

Abstract

Discovering and exploiting the causal structure in the environment is a crucial challenge for intelligent agents. This paper explores whether causal reasoning can emerge via meta-reinforcement learning. By training a recurrent network with model-free reinforcement learning on a range of problems containing causal structure, we find that the resulting agent can perform causal reasoning in novel situations. The agent demonstrates the ability to select informative interventions, draw causal inferences from observational data, and make counterfactual predictions. This work suggests that causal reasoning in complex settings may benefit from end-to-end learning-based approaches and offers new strategies for structured exploration in reinforcement learning.

Introduction: Beyond Correlation

Most contemporary machine learning models are essentially "correlation machines." While they excel at identifying patterns in high-dimensional data, they often fail to distinguish between mere association and true causation. To navigate complex, dynamic environments effectively, an agent must move beyond "what usually happens" (observations) to understand "what happens if I act" (interventions) and "what would have happened" (counterfactuals).

Traditionally, these capabilities are engineered using formal frameworks like Judea Pearl’s do-calculus. However, these methods typically require a pre-defined model of the world. This research investigates whether an artificial agent can learn to perform these complex causal inferences end-to-end, simply by being rewarded for making correct predictions within structured environments.

Methodology: Meta-Reinforcement Learning for Causality

The researchers employed a Meta-Reinforcement Learning (Meta-RL) architecture, utilizing a Long Short-Term Memory (LSTM) network trained via Asynchronous Advantage Actor-Critic (A3C). The learning process operates on two scales:

  1. Outer Loop: The network's weights are updated across a vast distribution of different causal tasks to optimize general performance.
  2. Inner Loop: During a specific episode, the weights are frozen. The agent must use its internal hidden state (memory) to identify the specific causal structure of the current environment.

Each task is divided into an Information Phase, where the agent observes or intervenes in a Causal Bayesian Network (CBN), and a Quiz Phase, where it must predict the outcome of a random intervention to receive a reward.

Comparison between observational (a) and interventional (b) causal graphs. In (b), the intervention on node E removes incoming edges, a key concept in do-calculus.

The study primarily used synthetic datasets of CBNs with $N=5$ nodes. To ensure the agent learned general reasoning rather than memorizing specific graphs, it was evaluated on a held-out test set of 408 unique graphs.

Key Insights: Emergent Reasoning

The Meta-RL agent demonstrated several sophisticated reasoning capabilities that emerged naturally from the training process:

  • Emergent Do-Calculus: In observational settings, the agent learned to ignore "backdoor paths" (confounders), effectively reinventing aspects of formal do-calculus to distinguish causation from correlation.
  • Active Experimentation: When allowed to intervene, the agent adopted an "experimental design" strategy, targeting nodes that would yield the most information about the underlying causal links.
  • Counterfactual Abduction: In counterfactual tasks, the agent performed "abduction"—using factual observations to infer hidden noise variables, then applying those variables to predict outcomes in a hypothetical counterfactual scenario.

Results and Performance

The Meta-RL agent significantly outperformed standard associative baselines. In observational tasks, it earned higher rewards by correctly resolving confounding variables that misled purely associative models.

Average reward comparison across different agent types. The Active-Cond. agent, capable of causal reasoning, achieves the highest average reward.

As shown in the performance metrics, the "Active-Cond." agent—which can perform interventions—outperforms the "Optimal-Assoc." baseline. This indicates that the agent is not just learning correlations but is actively using its ability to intervene to resolve ambiguity in the causal structure. Furthermore, the agent successfully identified causal links even in the presence of unobserved confounders, a task that is theoretically impossible for purely observational models.

Discussion and Future Directions

This work demonstrates that model-free reinforcement learning can give rise to complex causal reasoning. By learning both the model and the inference process simultaneously, the Meta-RL agent finds internal representations optimized for the task at hand.

However, challenges remain regarding scalability. While the agent handled up to $N=6$ nodes, real-world systems involve thousands of variables. Future research should also explore whether these agents can extract causal structures from raw, high-dimensional inputs like video. Ultimately, this approach paves the way for RL agents capable of "structured exploration," where they perform targeted experiments to rapidly understand and master new environments.

Summary updated

BibTeX
@misc{dasgupta2019causal,
  author = {Ishita Dasgupta and Jane X. Wang and Silvia Chiappa and Jovana Mitrovic and Pedro A. Ortega and David Raposo and Edward Hughes and Peter W. Battaglia and Matthew M. Botvinick and Zeb Kurth-Nelson},
  title = {{Causal Reasoning from Meta-reinforcement Learning}},
  year = {2019},
  eprint = {1901.08162},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1901.08162},
}
Figure