Abstract
In the presence of confounding, naively using off-the-shelf offline reinforcement learning (RL) algorithms leads to sub-optimal behaviour. In this work, we propose a safe method to exploit confounded offline data in model-based RL, which improves the sample-efficiency of an interactive agent that also collects online, unconfounded data. First, we import ideas from the well-established framework of $do$-calculus to express model-based RL as a causal inference problem, thus bridging the gap between the fields of RL and causality. Then, we propose a generic method for learning a causal transition model from offline and online data, which captures and corrects the confounding effect using a hidden latent variable. We prove that our method is correct and efficient, in the sense that it attains better generalization guarantees thanks to the confounded offline data (in the asymptotic case), regardless of the confounding effect (the offline expert's behaviour). We showcase our method on a series of synthetic experiments, which demonstrate that a) using confounded offline data naively degrades the sample-efficiency of an RL agent; b) using confounded offline data correctly improves sample-efficiency.
Introduction: The Challenge of Confounded Data
In real-world applications, reinforcement learning agents often have access to vast amounts of "offline" data, such as medical records or human driving logs. However, this data is frequently confounded: the original actors (e.g., doctors or drivers) often had access to "privileged" information that is not recorded in the dataset.
If an agent naively learns from this data, it might pick up spurious correlations. For instance, if a human driver brakes because they see a pedestrian that the robot's sensors cannot detect, a naive model might conclude that "braking causes pedestrians to appear." In RL terms, this leads to biased transition models and sub-optimal policies. While an agent can learn the "truth" through online interaction, such data is expensive. The goal of this work is to leverage "cheap" but biased offline data to accelerate learning without being misled by its inherent biases.
Methodology: Bridging RL and Causality
We bridge the gap between RL and causality by framing model-based RL as a causal inference problem using the do-calculus framework. Our approach centers on an augmented model structure and latent variable inference.
The Augmented POMDP
We introduce a "regime indicator" variable ($I$) to distinguish between data sources. When $I=0$, the data is observational and potentially confounded (offline data). When $I=1$, the data is interventional, representing the agent's own unconfounded online actions.
Latent Variable Modeling and Causal Planning
Instead of learning a direct mapping from observations to actions, we learn a latent model that captures the hidden state. This latent state serves as a proxy for the "privileged information" that influenced the expert's decisions in the offline data. The model is trained to maximize the joint likelihood of both offline ($I=0$) and online ($I=1$) datasets.
To plan actions, the agent uses the learned model to answer causal queries: "What happens if I do action $A$?" By applying do-calculus to the augmented model, we can mathematically disentangle the confounding effects learned from the offline data, yielding a clean, interventional transition model for decision-making. Furthermore, we extend "Manski bounds" from econometrics to prove that even non-identifiable observational data acts as a strong regularizer on the causal model.
Experimental Evaluation
We evaluated our method on three synthetic environments designed to test various confounding scenarios: Tiger (a classic POMDP), Hidden Treasures (a gridworld with hidden goals), and Sloppy Dark Room (a navigation task with partial observability).
Key Results and Insights
- Sample Efficiency: In all environments, the augmented method reached optimal performance significantly faster than baselines that ignored offline data.
- The Danger of Naivety: A "naive" agent that treats offline data as unconfounded often performs worse than an agent that ignores the offline data entirely. Correctly handling confounding is essential.
- Robustness: The method remains effective regardless of the expert's quality, correctly extracting environmental dynamics without inheriting expert biases.
Conclusion
This work provides a theoretically grounded approach to utilizing confounded offline data in model-based RL. By treating RL as a causal inference problem, we demonstrate that even biased observational data can significantly improve sample efficiency. Future work will focus on scaling these latent-based models to high-dimensional observation spaces and complex real-world tasks.
Summary updated