Introduction
Standard Reinforcement Learning (RL) agents are notoriously "brittle," often failing when encountering environments that differ slightly from their training data. This failure typically stems from deep learning models capturing statistical correlations rather than underlying causal mechanisms. For example, an agent might inadvertently learn that a specific background element correlates with a reward, leading to a performance collapse if that element changes. This paper introduces Causal Model-Based Policy Optimization (C-MBPO), a framework designed to learn the environment's causal structure to generate robust "counterfactual" data for training.
The Causal Model-Based Approach
C-MBPO integrates causal discovery into the standard Model-Based RL (MBRL) pipeline. Instead of relying on a black-box world model, it formalizes the environment as a Causal Markov Decision Process (C-MDP), which augments a standard MDP with a Causal Bayesian Network.
The framework operates through four key stages:
- Structure Learning: The agent infers the causal graph online from gathered trajectories using conditional independence testing (e.g., the PC algorithm). This identifies which variables actually influence the next state and the reward.
- Structural Causal Model (SCM) Learning: Once the graph structure is known, the agent trains an ensemble of probabilistic neural networks to learn the functional relationships between parent and child nodes.
- Counterfactual Rollouts: During policy optimization, the agent uses its learned SCM to simulate "imaginary" trajectories. Crucially, it can perform interventions ($do$-calculus), asking "What would happen if I took this action, regardless of current spurious correlations?"
- Policy Update: This counterfactual data is used to update the policy using a Dyna-Q style approach, ensuring the agent learns to rely only on true causal drivers of success.
Experimental Evaluation
The authors evaluated C-MBPO using a simulated task where an agent pulls a lever to open a door. The environment includes a "spurious" variable $Z_t$—a light that turns on when the door is open. While $Z_t$ is correlated with the reward, it does not cause it. The experiment tested three scenarios:
- In-Distribution (ID): The environment remains as it was during training.
- Near Out-of-Distribution (OOD): The light bulb is "broken" ($Z_t$ remains off).
- Far OOD: The relationship between the door and the light is inverted.
Key Results and Robustness
C-MBPO demonstrated significant robustness compared to standard Soft Actor-Critic (SAC) and non-causal MBPO baselines.
As shown in the results, while all methods perform well in-distribution, standard MBPO's performance collapses in the Far OOD scenario, dropping to a reward of 1.30. In contrast, C-MBPO maintains peak performance (~19.07). By correctly identifying $Z_t$ as a "sink" variable (a descendant of the state with no effect on reward), C-MBPO learns a policy that is immune to changes in non-causal environment elements.
Conclusion and Future Work
C-MBPO offers a promising framework for creating explainable and robust RL agents. By distinguishing between correlation and causation, it avoids the pitfalls of distributional shift. Future research will focus on scaling causal structure learning to high-dimensional spaces and managing uncertainty in the inferred causal graphs through belief states.
Summary updated