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

TL;DR

Expert demonstrations are often "confounded"—the expert makes decisions based on information the learning agent cannot see. This paper proves that when the distribution of this hidden information shifts between the expert's data and the agent's environment, standard imitation learning can fail catastrophically. To solve this, the authors introduce Corrective Trajectory Sampling (CTS), a method that allows Reinforcement Learning (RL) agents to safely leverage confounded expert data even under unknown distribution shifts.

What Problem Does This Paper Address?

Imitation Learning (IL) typically assumes an agent can perfectly observe the environment just as the expert did. However, in real-world scenarios, we frequently encounter latent confounders: features the expert used to make a decision that were not recorded in the dataset. For example, a human caregiver might decide how to dress a patient based on the patient's specific tremor levels or personal preferences—details that might be missing from a robot's training logs due to privacy or sensor limitations.

Covariate shift in assistive tasks

The problem is severely exacerbated by covariate shift. This occurs when the distribution of those hidden features in the expert's data differs from the distribution the agent faces online. For instance, if the expert mostly dressed elderly patients, but the robot needs to dress younger ones, the underlying context distribution has shifted. The authors show that if the agent tries to blindly mimic the expert without accounting for this shift, it can lead to "catastrophic imitation," where the agent performs significantly worse than if it had no expert data at all.

Methods

The paper approaches the problem through both theoretical proofs and algorithmic design, modeling the environment as a contextual Markov Decision Process (MDP) where the context is unobserved.

Causal graph of the contextual MDP
  1. Ambiguity Sets: The authors define a set of policies that "look" like the expert in the data but might behave differently in the real world. They show that without a reward signal, it is often impossible to distinguish the optimal policy from a catastrophic one.
  2. Impossibility/Possibility Theorems: They prove that if transitions are independent of the hidden context, imitation is doomed under covariate shift. Conversely, if the reward is independent of the context, the problem becomes solvable.
  3. Corrective Trajectory Sampling (CTS): For the RL setting (where a reward signal is available), the authors propose a new optimization objective. Instead of matching the expert's distribution directly, they minimize a divergence measure that is weighted to account for the unknown distribution of the hidden context.
  4. Practical Implementation: They provide a practical implementation using Online Gradient Descent that avoids explicit density estimation of state-action frequencies, making it compatible with modern deep RL architectures like PPO.

Key Insights and Ideas

  • The "Spectrum of Difficulty": The paper provides a theoretical framework showing how hard imitation is based on what the hidden context affects. If the context only affects transitions, imitation is "impossible." If it only affects rewards, it's "easy."
  • The Danger of Marginal Matching: Most imitation algorithms try to match the "marginal" distribution of the expert. This paper highlights that when there's a shift in hidden variables, matching the marginals is exactly what leads to catastrophic errors.
  • Reward as a Tie-Breaker: The authors argue that while expert data is "confounded," the online reward signal acts as a ground truth. This allows the agent to "de-confound" the expert's behavior and figure out which parts of the demonstration are actually relevant to the current environment.

Datasets and Key Results

The authors evaluate their approach on several challenging simulation environments, including Assistive-Gym (a physics-based simulator for robotic caregiving tasks like feeding and dressing), RecSim (a recommender system simulator), and a classic Four-Rooms grid-world.

  • Catastrophic Failure of Baselines: In the RecSim environment, as the covariate shift increased, standard imitation performance plummeted to near-zero, even though the agent "believed" it was matching the expert perfectly.
  • CTS Success: In all four Assistive-Gym tasks, the proposed CTS method significantly outperformed standard RL and expert-aided RL that failed to account for the shift.
  • Robustness: The method proved robust across different types of distribution shifts, such as shifting the mean age or gender balance of the patient population.

Limitations and Future Work

  • Expert Optimality: The theoretical framework assumes the expert data comes from an optimal policy. It remains unclear how the method handles "noisy" or sub-optimal human demonstrations.
  • Efficiency vs. Optimality: While the paper proves the algorithm converges to an optimal policy, it does not theoretically quantify how much faster the agent learns compared to standard RL, leaving the formal proof of "sample efficiency gain" for future work.
  • State-Action Frequency Estimation: The practical algorithm avoids explicit estimation, but performance still depends heavily on the quality of the neural network used to represent the bonus reward.

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