Exploiting Causal Graph Priors with Posterior Sampling for Reinforcement Learning

Mirco Mutti, Riccardo De Santi, Marcello Restelli, Alexander Marx, Giorgia Ramponi

TL;DR

C-PSRL is a novel reinforcement learning algorithm that uses partial causal graphs as prior knowledge to drastically improve sample efficiency. By hierarchically learning both the environment's causal structure and its transition dynamics, it bridges the gap between intuitive expert knowledge and high-performance Bayesian RL.

The Challenge of Sample Inefficiency

Reinforcement Learning (RL) agents typically require a massive amount of trial-and-error to learn effective policies, a challenge known as sample inefficiency. One way to speed this up is through Posterior Sampling for RL (PSRL), which uses prior knowledge to guide exploration. However, traditional PSRL requires experts to specify priors as complex parametric distributions—a task that is mathematically cumbersome and unintuitive for practitioners like doctors or engineers.

In contrast, experts find it much easier to provide causal insights (e.g., "blood pressure depends on age and medication"). While some RL methods use causal graphs, they usually assume the entire graph is known perfectly. This paper tackles a more realistic scenario: how can an RL agent exploit partial causal knowledge to learn faster and more reliably?

Introducing Causal PSRL (C-PSRL)

The authors introduce Causal PSRL (C-PSRL), a hierarchical Bayesian approach designed for Factored Markov Decision Processes (FMDPs). In an FMDP, the environment's state is made of multiple variables, and the transition of each variable only depends on a subset of "parent" variables.

Key features of C-PSRL include:

  • Hierarchical Bayesian Model: It maintains a "hyper-prior" over possible causal graph structures (factorizations) and a "prior" over the transition parameters for each structure.
  • Sampling Strategy: At the start of each episode, the agent samples a causal graph consistent with its partial prior knowledge. It then samples specific transition dynamics for that graph and computes an optimal policy.
  • Joint Learning: As the agent interacts with the world, it simultaneously updates its belief about which causal graph is correct and what the numerical values of the dynamics are.
  • Regret Analysis: The authors provide a theoretical bound on the Bayesian regret, proving that the learning rate improves as the "degree of prior knowledge" (the number of known causal edges) increases.
Figure 1: (Left) An example of a partial causal graph prior. (Right) The set of consistent factorizations that the agent considers during learning.

Key Insights and Ideas

  • Causal Graphs as Intuitive Priors: The paper demonstrates that causal graphs are a "natural language" for human-AI collaboration. Experts can encode what they do know (e.g., "A affects B") while leaving the unknown parts for the algorithm to discover.
  • Structure as a Search Space Reducer: By identifying the causal structure, the agent effectively ignores irrelevant variables. Learning that "Variable X does NOT affect Variable Y" is just as valuable as learning what does affect it, as it drastically reduces the number of parameters to estimate.
  • Quantifying Knowledge: The paper introduces a parameter $\eta$ to represent the degree of prior knowledge. They prove that regret decreases exponentially as $\eta$ increases, providing a formal link between "expert certainty" and "learning speed."
  • Weak Causal Discovery: C-PSRL performs "causal discovery" as a byproduct of maximizing reward. It naturally converges toward a sparse "super-graph" that contains all true causal relationships.

Experimental Results

The algorithm was evaluated in synthetic Random FMDPs and the classic Taxi Domain ($3 \times 3$ and $5 \times 5$ grids), a naturally factored environment where a taxi must navigate to pick up and drop off passengers.

  • Outperforming Baselines: In all tests, C-PSRL significantly outperformed standard PSRL (which uses an uninformative prior). It performed nearly as well as an "Oracle" agent given the full, correct causal graph from the start.
  • Solving Complex Tasks: In the larger $5 \times 5$ Taxi domain, standard PSRL failed to find a good policy within 400 episodes, exhibiting linear regret. In contrast, C-PSRL found an optimal policy almost immediately by exploiting the known structure of the task.
  • Faster Convergence: C-PSRL's model error dropped much faster than standard methods, confirming that causal priors lead to a more accurate understanding of the world with fewer samples.
Figure 2: Regret comparison in the Taxi 5x5 domain. C-PSRL (red) achieves significantly lower regret than standard PSRL (black), which fails to find a good policy within 400 episodes.

Limitations and Future Work

  • Computational Complexity: C-PSRL requires solving an "exact planning" problem for FMDPs in every episode. This is computationally expensive (NP-hard) and may not scale to massive state spaces without using approximate planning techniques.
  • Confounding: The current model assumes no "hidden confounders" (unobserved variables that influence both the agent's actions and the environment's state). Real-world applications often have such hidden factors.
  • Model-Free Extensions: A promising future direction is extending this causal prior framework to "model-free" RL algorithms, which might offer better computational scaling while still benefiting from structural knowledge.

Summary updated

BibTeX
@inproceedings{mutti2024exploiting,
  author = {Mirco Mutti and Riccardo De Santi and Marcello Restelli and Alexander Marx and Giorgia Ramponi},
  title = {{Exploiting Causal Graph Priors with Posterior Sampling for Reinforcement Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=M0xK8nPGvt},
}
Figure