Unsupervised Object Interaction Learning with Counterfactual Dynamics Models

Jongwook Choi, Sungtae Lee, Xinyu Wang, Sungryull Sohn, Honglak Lee

TL;DR

The researchers introduce COIL (Counterfactual Object Interaction Learning), a framework that allows reinforcement learning agents to discover how to interact with objects—like stacking boxes or connecting magnets—without any human-provided rewards. By asking "how would the future of object A change if I moved object B?", the agent generates its own "counterfactual" intrinsic reward, effectively teaching itself complex manipulation skills from scratch.

The Challenge of Multi-Object Interaction

In the field of Unsupervised Reinforcement Learning (RL), agents are typically designed as "curious" explorers. Without a specific goal or external reward signal, they tend to learn simple movements like locomotion or focus on the most easily manipulated entities, such as their own limbs.

A significant gap remains in multi-object interaction. In a kitchen, an agent needs to understand that a knife affects a vegetable; in a factory, that a bolt secures a plate. These interactions are "sparse" and difficult to discover by chance—randomly waving a robotic arm rarely results in a perfectly stacked set of blocks. Existing exploration methods, such as those seeking "novelty" or "surprise," often fail in these scenarios because they do not distinguish between an agent moving its own hand and the much more significant event of one object physically affecting another.

Methods: Counterfactual Reasoning as Reward

The authors propose a novel intrinsic reward based on counterfactual reasoning. The core logic is that an interaction between Object A and Object B occurs if and only if the future state of A is dependent on the state of B.

Overview of the COIL framework and counterfactual reward calculation.

To calculate this reward, the agent uses a learned dynamics model to perform a mental experiment: "What would happen to Object A if I randomly changed the position of Object B?" 1. Prediction: The agent predicts the future of Object A based on the current state. 2. Intervention: It then generates a counterfactual state where Object B is moved to a different location. 3. Comparison: If the prediction for A remains the same despite the change in B, no interaction occurred (Reward = 0). If the prediction for A changes significantly, the objects must be interacting, yielding a high intrinsic reward.

The researchers developed two versions of this framework:

  • COIL-Forward: Uses a standard forward dynamics model to predict the immediate next state. This is effective for "instant" interactions, such as snapping pieces together.
  • COIL-SF (Successor Features): This version uses Successor Features to summarize the long-term discounted future of an object. This helps the agent recognize interactions where the physical effect is delayed or subtle, capturing the influence one object has over another's entire future trajectory.

To handle varying numbers of objects, the architecture utilizes an attention-based (Transformer-like) network. This ensures the agent treats all objects of the same type equally (permutation invariance) and can scale to more complex environments.

Experimental Setup

The researchers evaluated COIL on two continuous control environments designed to test multi-entity interaction:

  • StackingBox: A 2.5-D environment where a cursor agent must learn to grab boxes and stack them. Stacking is considered an "instant" event.
  • Magnetic Blocks: A more challenging environment where blocks only connect if they are aligned and rotated correctly to trigger a magnetic force. This requires precise manipulation and extended interaction.

Key Results and Insights

COIL demonstrated a significant ability to identify and master "bottleneck states"—rare events that are difficult to reach but essential for complex tasks. By incentivizing these interactions, the agent builds a library of useful "macro-actions" derived purely from the consistency of the world's physics.

Experimental environments and performance comparison against baselines.
  • Superiority over Baselines: In the Magnetic Blocks environment, standard exploration methods like RND (Random Network Distillation) or Forward Curiosity almost never learned to connect the blocks, typically only learning to move a single block. In contrast, COIL-SF achieved a success rate near 100%.
  • Zero-Shot Generalization: Due to the entity-centric attention mechanism, an agent trained on 4 objects could be transferred to an environment with 6 objects and still perform effectively, demonstrating robust generalization.
  • Emergent Behavior: In the StackingBox task, the agent did not just stack boxes once; it learned to repeatedly stack and unstack them to maximize its interaction reward, effectively practicing and refining the skill autonomously.

Limitations and Future Work

While COIL represents a leap forward in unsupervised interaction, several challenges remain. The current model assumes access to "factorized" states (exact coordinates of every object). Future iterations could combine COIL with entity-centric representation learning, such as Slot Attention, to work directly from raw pixels. Additionally, while the current reward focuses on pairwise interactions, future work may explore higher-order interactions involving three or more objects simultaneously, as well as distinguishing between different modes of interaction, such as pushing versus pulling.

Summary updated

BibTeX
@inproceedings{choi2024unsupervised,
  author = {Jongwook Choi and Sungtae Lee and Xinyu Wang and Sungryull Sohn and Honglak Lee},
  title = {{Unsupervised Object Interaction Learning with Counterfactual Dynamics Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i10.29039},
}
Figure