Programmable Agents

Misha Denil, Sergio Gomez Colmenarejo, Serkan Cabi, David Saxton, Nando de FreitasarXiv 2017

Abstract

Standard reinforcement learning (RL) agents are often "brittle," struggling to generalize to novel combinations of known properties—a challenge known as compositional generalization. This paper introduces a novel framework for building Programmable Agents that learn to execute declarative programs. By grounding formal language into disentangled visual representations through a differentiable logic bottleneck, these agents demonstrate near-perfect zero-shot generalization to tasks and objects never encountered during training.

Introduction: The Challenge of Compositionality

Deep RL agents typically learn a direct mapping from raw pixels to actions. While effective for specific tasks, this approach lacks an understanding of environmental semantics. For instance, an agent trained to pick up a red cube and a blue sphere might fail when asked to pick up a red sphere. This failure stems from a lack of modularity; the agent does not recognize "red" as a property independent of "cube."

To address this, researchers propose that agents must ground language into abstract, modular concepts. The goal is to enable agents to understand that properties like color and shape are independent and can be combined in novel ways.

The Programmable Network Architecture

The core of this approach is the Programmable Network, which forces the agent to process information through a structured bottleneck.

The Programmable Network architecture: grounding object features into a property matrix and applying differentiable logic.

The architecture consists of several key components:

  1. Grounding via Detectors: The agent receives raw object features ($\Omega$). A set of small neural networks, or detectors, maps these features into a property matrix ($\Phi$). In this matrix, each row represents a specific property (e.g., "RED", "CUBE") and each column represents an object in the scene.
  2. Differentiable Logic: To maintain end-to-end trainability via backpropagation, the system employs "soft" Boolean logic. For example, the AND operation is implemented as a product ($x \cdot y$), and NOT as $1 - x$. This allows the agent to evaluate complex logical programs like NEAR(HAND, AND(RED, CUBE)).
  3. The Relevant Objects Vector: The output of the logical program is a vector ($p$) that identifies which objects are relevant to the current command.
  4. Relational Reasoning: A message-passing scheme allows objects to interact. Crucially, the vector $p$ gates this communication, ensuring the agent focuses its reasoning only on task-relevant objects.

Experimental Evaluation

The agents were evaluated in a Programmable Reaching Environment built using the MuJoCo physics engine.

The Programmable Reaching Environment featuring a robot arm and various objects.

In this setup, a robot arm must reach for specific blocks identified by logical programs. The researchers tested the agents on 2x2 and 3x3 property configurations (e.g., three colors and three shapes). To test generalization, certain property combinations were held out during training. For example, the agent might never see a "blue cube" during training but would be asked to find one during testing.

Key Results and Insights

The Programmable Agents demonstrated significant advantages over traditional RL methods:

  • Zero-Shot Generalization: While standard architectures (like DDPG) achieved 0% success on held-out combinations, Programmable Agents achieved near-perfect performance.
  • Disentanglement: By forcing the population of the $\Phi$ matrix, the architecture naturally separates "what" an object is from "where" it is. This disentanglement is the primary driver of its generalization capabilities.
  • Learning by Exclusion: The agents exhibited an emergent ability to identify novel objects. When asked to find an object that was NOT any of the known colors, the agent could successfully identify a brand-new color (e.g., magenta) through the principle of exclusion.
  • Stability: Shared grounding across tasks prevented catastrophic forgetting. Performance on earlier tasks remained stable even as the agent learned increasingly complex logical queries.

Limitations and Future Directions

While promising, the current framework has limitations. It assumes the environment provides pre-segmented object boundaries rather than learning them from raw pixels. Additionally, the vocabulary of properties is fixed by the number of detectors, preventing the agent from discovering new property categories autonomously. Future work will explore extending this architecture to more complex sequential manipulation tasks, such as "Put the red cube inside the blue box."

This summary is based on "Programmable Agents" published at NIPS 2017.

Summary updated

BibTeX
@misc{denil2017programmable,
  author = {Misha Denil and Sergio Gomez Colmenarejo and Serkan Cabi and David Saxton and Nando de Freitas},
  title = {{Programmable Agents}},
  year = {2017},
  eprint = {1706.06383},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1706.06383},
}
Figure