Learning Contextual Causal Dynamics for Robust Exploration in Reinforcement Learning

Jiaming Pu, Yibo Zhang, Xu Dong, Tielin Zhang, Dengpeng XingNeurIPS 2026

TL;DR

Reinforcement learning agents often get distracted by background noise when exploring environments with scarce rewards, largely because they assume everything in the world influences everything else. This paper introduces CIM, a framework that teaches agents to map out how cause-and-effect actually changes across different situations—like a robot arm moving through empty space versus grasping a block. By ignoring what they can't control and rewarding themselves for meaningful physical interactions, these agents learn faster and shrug off unexpected changes in their environment.

What Problem Does This Paper Address?

Imagine learning to assemble a watch in the dark, receiving a "good job" only when the watch finally ticks. In reinforcement learning (RL), this is the sparse-reward problem. To keep agents from wandering aimlessly, researchers give them "intrinsic motivation"—essentially, a curiosity bonus for discovering novel states or encountering things their internal world-models can't yet predict.

Here’s the catch: standard world-models use dense neural networks that entangle all variables together. Because they don't understand underlying cause-and-effect, agents fall victim to the infamous "Noisy-TV" problem—getting endlessly fascinated by unpredictable, task-irrelevant distractions (like changing colors or random background noise) rather than learning actual skills.

Recent methods tried fixing this by teaching agents a single, global causal graph of their environment. But reality isn't static. Think of a robotic arm: before it touches an object, its motors only affect the arm's position. The moment it grasps a block, its motors suddenly control the block's position, too. Existing exploration strategies miss this context-dependent causality, leaving agents vulnerable to distractions and fragile when the environment shifts.

Figure 1: Left: Under different interaction scenarios, the full state variables influence one another through distinct causal mechanisms. Here, SR denotes the task-relevant state variables that can be influenced by actions, including agent-related dynamic features and the target object-related dynamic features. In contrast, SI denotes the task-irrelevant state variables that cannot be influenced by actions under any context, such as object color, noise, and immovable objects. Right: The multiple causal graphs represent the corresponding local causal structures under different contexts, each associated with an interaction scenario shown on the left.

Methods

The authors propose CIM (contextual Causal dynamics model-based Intrinsic Motivation), built atop standard Soft Actor-Critic (SAC) and Hindsight Experience Replay (HER) backbones. Its novelty lies in two main stages:

  1. Contextual Causal Dynamics Model (CCDM): Instead of assuming one global rulebook, CIM uses a Vector Quantized-Variational Autoencoder (VQ-VAE) to group state-action pairs into discrete "contexts" (like pre-contact vs. grasping) stored in a learnable codebook. Each codebook entry decodes into a sparse, local causal graph—a binary mask showing which state and action variables directly cause the next state's variables. An Adaptive Codebook Fusion step automatically merges redundant contexts so you don't have to guess the exact number of interaction phases beforehand.
  2. State Filtering & Dual Intrinsic Rewards: Looking across all learned local graphs, any state variable that is never influenced by the agent's actions (e.g., object color, immovable obstacles) is flagged as task-irrelevant ($S_I$) and filtered out of both the policy input and reward calculations. Operating strictly on the remaining task-relevant variables ($S_R$), CIM drives exploration using two signals:
  3. Curiosity (ICM): Rewards prediction error on $S_R$ to encourage broad, early exploration.
  4. Causal Action Influence (CAI): Uses conditional mutual information to measure how much control the agent's actions exert over $S_R$ right now, nudging the agent toward states where it can actually manipulate things.

Datasets

Because this is online RL, the authors evaluate on interactive robotic simulation benchmarks rather than static datasets:

  • OpenAI Gym Fetch: Standard sparse-reward Push and PickAndPlace tasks, plus a newly modified RotTable environment featuring a rotatable table.
  • Meta-World: pick-place and pick-place-wall, adapted to sparse-reward settings.
  • Augmented Distractor Suites: To test robustness and out-of-distribution (OOD) generalization, the authors augment all five environments with nuisance variables—immovable objects, shifting colors, and background noise—that shift either periodically during training or progressively at test time.

Key Insights and Ideas

  • Exploration and skill-acquisition have a natural handoff: Early in training, prediction-error curiosity ($r_{\text{ICM}}$) dominates, pushing the agent to map out the room. Once the causal model gets accurate, curiosity naturally subsides and Causal Action Influence ($r_{\text{CAI}}$) takes over—focusing the agent on high-leverage physical interactions like pushing and grasping.
  • Action-reachability is a great noise filter: Defining "task-relevant" simply as anything an action can eventually influence in at least one context cleanly separates manipulable physics from visual or statistical fluff.
  • Causal discovery buys speed; state filtering buys robustness: In a neat ablation study, replacing the causal model with a standard dense network plus a hand-crafted noise mask still achieved great OOD generalization (~91.8%), whereas keeping the causal model without filtering the policy's state input caused OOD performance to plummet to 41.2%. Thus, CCDM's superpower is automatically discovering that filter from scratch while speeding up early learning.

Key Results

Across all five manipulation benchmarks, CIM learns faster and with lower variance than standard curiosity and causal baselines (HER, Ensemble-Dis, DuRND, and CID).

  • Hard Exploration: On the toughest base task (pick-place-wall), Ensemble-Dis and HER fail completely (0% success), while CIM reliably learns the task.
  • Training Under Shifting Noise: When distractor distributions shift periodically mid-training, novelty-seeking baselines suffer sharp performance crashes at every shift, whereas CIM converges smoothly to near-optimal success rates.
  • OOD Generalization: Under severe test-time distribution shifts (OOD-2), baselines collapse while CIM holds strong:
  • On GymFetch/RotTable, CIM achieves 89% success vs. 26% for the next best baseline (CID) and 0% for HER/Ensemble-Dis.
  • On Meta-World/pick-place-wall (OOD-2), every single baseline scores 0.00, while CIM maintains a 52% success rate.

Limitations and Future Work

CIM currently operates on low-dimensional, pre-extracted state vectors (like joint angles and object coordinates) and relies on learning an accurate causal graph over them. Because raw pixels suffer from partial observability and entangled representations—where a single pixel doesn't cleanly map to a physical variable—CIM cannot yet be dropped directly into image-based RL environments. Future work aims to bridge this gap by pairing CIM with visual representation learning, such as object-centric encoders, masked reconstruction, or contrastive pretraining, to extract compact causal variables straight from video.

Summary updated

Abstract

Efficient exploration in sparse-reward environments, where informative extrinsic feedback is scarce, remains a significant challenge in reinforcement learning. A key limitation of existing exploration strategies is that they often assume that all state variables strongly influence one another, overlooking the underlying causal mechanisms of the environment, particularly the fact that causal relationships may vary across contexts. To address this issue, we propose contextual Causal dynamics model-based Intrinsic Motivation (CIM), a causality-aware exploration framework that explicitly captures context-dependent sparse causal structures and derives intrinsic motivation signals, specifically causal action influence and prediction-error-based curiosity. These intrinsic rewards encourage interventions on causally relevant state factors rather than merely promoting observation novelty-seeking behavior, thereby facilitating robust exploration and active skill acquisition. Moreover, by learning contextual causal mechanisms, CIM identifies and filters out task-irrelevant state variables, improving generalization under distribution shifts. Empirical results demonstrate that our method achieves superior sample efficiency, training robustness, and out-of-distribution generalization performance across multiple robotic manipulation tasks.
BibTeX
@inproceedings{pu2026learning,
  author = {Jiaming Pu and Yibo Zhang and Xu Dong and Tielin Zhang and Dengpeng Xing},
  title = {{Learning Contextual Causal Dynamics for Robust Exploration in Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=A0hdW8sljf},
}
Figure