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

DEEP SETS FOR GENERALIZATION IN RL

Tristan Karch, Cédric Colas, Laetitia Teodorescu, Clément Moulin-Frier, Pierre-Yves Oudeyer

TL;DR

This paper introduces a modular, object-centered architecture for Reinforcement Learning (RL) that significantly improves an agent's ability to generalize to new goals and complex environments. By combining Deep Sets (for permutation invariance) with gated-attention mechanisms (for language grounding), the authors create agents that can understand natural language instructions and apply learned skills to objects and scene configurations they never encountered during training.

What Problem Does This Paper Address?

Traditional RL agents often struggle with "systematic generalization." If an agent learns to "grasp a red house" and "see a green tree," it should theoretically be able to "grasp a red tree," but standard architectures—which often treat the entire world state as one giant, flat vector—frequently fail at this.

The core challenge is that standard "flat" architectures are sensitive to the specific order and number of objects in a scene. If you train an agent in a room with three objects and then test it in a room with five, it often breaks. This paper tackles how to design reward functions and policies that are object-aware and permutation-invariant, allowing agents to reason about entities and their relationships rather than just raw coordinates.

Methods

The authors propose a Modular-Attention (MA) architecture. The key innovation is moving away from concatenating all object features into one long vector. Instead, they process each object independently and then aggregate the results.

  1. Object-Wise Processing: For a given goal (e.g., "grasp red cat"), the agent's language model generates an attention vector. This vector is used to "gate" (filter) the features of each individual object in the scene.
  2. Deep Sets Integration: Inspired by the "Deep Sets" framework, the architecture ensures permutation invariance. It doesn't matter if the "red cat" is the first or fifth item in the data list; the model treats the input as an unordered set.
  3. Modular Reward Function: The reward function computes a "sub-decision" for every object. A global reward is then triggered via a differentiable logical OR function: if any object satisfies the goal, the whole scene satisfies the goal.
  4. Modular Policy: Similarly, the policy projects object-goal pairs into a high-dimensional latent space, sums them up, and maps that sum to an action. This allows the policy to scale to a varying number of objects.

Datasets

The study uses the Playground environment, a continuous 2D world.

  • Objects: 32 different types (e.g., dog, cactus, sofa) organized into 5 categories (animals, furniture, etc.).
  • Interactions: Agents can navigate, grasp objects, and "grow" living things (by bringing them water/food).
  • Goals: 256 achievable goals generated by a grammar (e.g., "go top left," "grasp any animal," "grow red plant").
  • Splits: The authors specifically held out certain combinations for a testing set ($G^{test}$) to measure five types of out-of-distribution generalization, such as applying a known attribute (red) to a known object (tree) that was never seen in that specific combination during training.

Key Insights and Ideas

  • Modularity equals Generalization: By forcing the network to look at objects one by one, the model learns the meaning of attributes (like "red") and predicates (like "grasp") independently of the specific scene layout.
  • Bottlenecking for Grounding: The gated-attention mechanism acts as a bottleneck that forces the agent to "ground" language into physical properties. The goal "red" learns to specifically look at the color dimensions of the object features.
  • Zero-Shot Scaling: Because the architecture treats objects as a set, an agent trained on scenes with only 3 objects can still perform reasonably well in scenes with 10 objects without any additional training.
  • Relational Reasoning: The authors show this isn't limited to single objects. By feeding the modules pairs of objects, the agent can learn relational goals like "grasp the thing to the left of the dog."

Key Results

  • Superior Performance: The Modular-Attention (MA) architecture significantly outperformed "Flat-Concatenation" and "Flat-Attention" baselines in both training success and generalization to new goals.
  • Robustness to Crowding: While performance does eventually degrade as more objects are added (due to the "sum" operator in the policy becoming noisier), the MA agent maintained a success rate above 60% with 10 objects, despite only being trained on 3.
  • Relational Success: The extended "two-object" architecture achieved an $F_1$-score of 0.97 on testing sets for relational goals, proving that object-centered modularity is a viable path for complex spatial reasoning.

Limitations and Future Work

  • Pre-defined Features: A major limitation is that the model relies on "factorized" representations—meaning a human engineer has already told the agent which bits of data represent "color," "position," and "type." The authors note that future work should combine this with unsupervised object-discovery algorithms (like MONet or IODINE) to learn these features directly from pixels.
  • Attribute Extrapolation: The model still struggled with "Type 2" generalization (extrapolating a color to a completely new category of objects). This is partly because new words create new tokens for the LSTM, which can perturb the entire sentence encoding.
  • Curriculum Learning: The authors suggest that future agents could use "learning progress" to choose how many objects to have in a scene, starting simple and gradually moving to more crowded environments.

Summary updated

BibTeX
@inproceedings{karch2021deep,
  author = {Tristan Karch and Cédric Colas and Laetitia Teodorescu and Clément Moulin-Frier and Pierre-Yves Oudeyer},
  title = {{DEEP SETS FOR GENERALIZATION IN RL}},
  booktitle = {HAL},
  year = {2021},
}
Figure