Abstract
Model-based methods have recently shown promising for offline reinforcement learning (RL), aiming to learn good policies from historical data without interacting with the environment. Previous model-based offline RL methods learn fully connected nets as world-models that map the states and actions to the next-step states. However, it is sensible that a world-model should adhere to the underlying causal effect such that it will support learning an effective policy generalizing well in unseen states. In this paper, We first provide theoretical results that causal world-models can outperform plain world-models for offline RL by incorporating the causal structure into the generalization error bound. We then propose a practical algorithm, oFfline mOdel-based reinforcement learning with CaUsal Structure (FOCUS), to illustrate the feasibility of learning and leveraging causal structure in offline RL. Experimental results on two benchmarks show that FOCUS reconstructs the underlying causal structure accurately and robustly. Consequently, it performs better than the plain model-based offline RL algorithms and other causal model-based RL algorithms.
Introduction
In Offline Reinforcement Learning (RL), agents are tasked with learning optimal behaviors from a fixed dataset without the ability to interact with the environment. A common strategy involves building a "world model"—a neural network designed to predict the next state based on the current state and action. However, standard neural networks are often "causally blind," excelling at identifying correlations but failing to distinguish between true causes and coincidental relationships.
For instance, a model trained on rainy-day driving data might incorrectly learn that activating windshield wipers causes a vehicle to slow down. Such spurious correlations lead to poor decision-making when the agent encounters out-of-distribution scenarios, such as a sunny day. The FOCUS (oFfline mOdel-based reinforcement learning with CaUsal Structure) framework addresses this by identifying the underlying causal relationships in historical data to build models that generalize more effectively.
The FOCUS Framework
FOCUS integrates causal discovery directly into the model-building process through a two-stage pipeline: Causal Structure Learning and RL Algorithm Learning.
1. Causal Structure Learning
The algorithm employs the PC algorithm, adapted for RL with a temporal constraint: the future cannot cause the past. This constraint significantly narrows the search space for potential causal links. To handle the complex, non-linear relationships typical of continuous RL data, FOCUS utilizes Kernel-based Conditional Independence (KCI) testing. This allows the system to determine if a variable truly influences another or if they are merely related through a third variable.
2. Offline RL with Causal Masking
Once the causal graph is identified, the world model is "masked." Instead of a dense, fully connected network, each state-dimension predictor only receives inputs from its identified "causal parents." This structured model is then integrated into Model-based Offline Policy Optimization (MOPO), which penalizes the agent for entering regions where the model's uncertainty is high.
Key Insights and Theoretical Results
The authors propose the "Spurious Theorem," providing mathematical proof that including non-causal variables in a world model increases the generalization error bound. By forcing the network to ignore these variables, FOCUS acts as a structural regularizer, preventing the model from overfitting to coincidences in the offline dataset.
A significant advantage of this approach is its robustness to data bias. Causal models are less dependent on data diversity; even with highly biased training data (e.g., driving in only one direction), a causal model can infer the underlying physics correctly, whereas a standard model would likely fail.
Experimental Evaluation
FOCUS was evaluated on two primary benchmarks:
- Toy Car Driving: A 2D environment designed to test spurious correlations (e.g., velocity vs. position). FOCUS achieved a causal reconstruction accuracy of 0.993, compared to 0.52 for the baseline LNCM. In "Random" data scenarios, FOCUS scored 68.1, while the standard MOPO baseline failed with a score of -30.3.
- MuJoCo (Inverted Pendulum): A physics benchmark where the sparsity of the causal graph allows for significant benefits from causal modeling.
Limitations and Future Work
While FOCUS shows great promise, its effectiveness may diminish in systems with "dense" causal graphs where variables are highly interconnected (the "butterfly effect"). Additionally, KCI testing is computationally expensive, which may limit scalability. Future research will focus on quantifying the uncertainty of the learned causal graphs themselves, as the current framework assumes the discovered structure is entirely accurate.
Summary updated