NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

On Covariate Shift of Latent Confounders in Imitation and Reinforcement Learning

Guy Tennenholtz, Assaf Hallak, Gal Dalal, Shie Mannor, Gal Chechik, Uri Shalit

Introduction

This research investigates the challenges of training AI agents using expert demonstrations when the expert has access to hidden information—latent confounders—that undergoes a distribution change (covariate shift) in the deployment environment. While pure imitation learning (IL) can fail catastrophically in these scenarios, the authors demonstrate that an online reward signal, combined with a novel "Corrective Trajectory Sampling" (CTS) method, can safely leverage flawed expert data to achieve optimal performance.

The Problem: Latent Confounders and Covariate Shift

In Imitation and Reinforcement Learning, expert datasets are often used to accelerate training. However, real-world data frequently suffers from two overlapping issues:

  1. Latent Confounders: Experts often make decisions based on unrecorded information (e.g., a doctor's intuition about a patient's demeanor).
  2. Covariate Shift: The distribution of these hidden variables in the training data differs from the deployment environment (e.g., training on elderly patients but deploying for a younger demographic).
Overview of covariate shift and CTS success.

If the AI does not know what the expert saw and the underlying demographics have shifted, the expert data can become misleading or even dangerous to imitate. For example, in assistive robotics, a robot might miss a patient's sleeve if it was trained on a different distribution of patient sizes and tremor levels.

Methodology

The authors model this using a Contextual MDP, where a hidden "context" dictates environment dynamics and rewards. While the agent observes this context during online deployment, it is absent from the offline expert data.

The approach involves two phases:

  • Theoretical Analysis: The authors define an "ambiguity set" of policies that appear statistically identical to the expert in flawed data, making it impossible to identify the correct policy through pure IL.
  • Corrective Trajectory Sampling (CTS): When an online reward is available, CTS treats expert data as a prior. Instead of matching state-action distributions (which fails under context shift), CTS matches distributions at the trajectory level. This allows the agent to implicitly correct for unknown distribution shifts.

Key Insights: The Spectrum of Difficulty

The hardness of learning from confounded data varies based on the environment's structure. The authors prove that if environment transitions are independent of the hidden context but the reward is not, pure imitation is mathematically impossible (Theorem 2). Conversely, if the reward is context-independent, imitation becomes significantly easier.

The spectrum of difficulty for imitation learning.

A critical takeaway is that an online reward signal acts as the ultimate "grounding" mechanism. It breaks the ambiguity of confounded data, allowing the agent to use expert demonstrations for speed without being misled by missing information.

Experimental Results

The methods were evaluated in complex simulated environments:

  • Assistive Gym: In robotic dressing tasks, standard imitation failed as covariate shift increased. The CTS-augmented agent successfully learned the task, outperforming both pure RL and naive imitation.
  • RecSim: In recommender systems with severe shift, pure imitation learned policies that harmed user engagement, whereas CTS maintained high rewards by correcting for the shift.
  • Four-Rooms: A toy environment confirming theoretical claims regarding context-free rewards.

Conclusion and Future Work

The authors prove that CTS is guaranteed to converge to an optimal policy even under arbitrary covariate shift of unobserved confounders. Future work includes developing formal sample efficiency bounds to quantify exactly how much expert data accelerates learning and exploring "context reconstruction" to enable safe imitation without reward signals when shifts are bounded.

Summary updated

BibTeX
@inproceedings{tennenholtz2022covariate,
  author = {Guy Tennenholtz and Assaf Hallak and Gal Dalal and Shie Mannor and Gal Chechik and Uri Shalit},
  title = {{On Covariate Shift of Latent Confounders in Imitation and Reinforcement Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=w01vBAcewNX},
}
Figure