Exchangeable Input Representations for Reinforcement Learning

John Mern, Dorsa Sadigh, Mykel J. Kochenderfer

Abstract

Standard reinforcement learning (RL) agents often struggle with environments containing multiple similar objects because they treat the input order as significant. This leads to a combinatorial explosion in the state space, requiring millions of samples to learn simple symmetries. We present an attention-based neural network architecture that creates permutation-invariant representations, effectively reducing the searchable input space by a factor of $m!$. Our approach demonstrates significant improvements in sample efficiency and scalability across various tasks, including complex convoy protection simulations with variable object counts.

The Problem of Object Ordering in Deep RL

Deep reinforcement learning is notoriously data-hungry, partly due to how state representations are constructed. In multi-object environments—such as a robot sorting parts or a vehicle navigating traffic—data for each object is typically concatenated into a single long vector.

However, if these objects are "exchangeable" (meaning the optimal action is independent of their listed order), standard architectures force the neural network to learn this symmetry from scratch. This results in a "combinatorial explosion" where the agent must explore $m!$ permutations of the same state. Furthermore, fixed-size input requirements make it difficult to handle dynamic scenarios where the number of objects changes without resorting to inefficient workarounds like zero-padding.

Permutation Invariant Attention Mechanism

To address these challenges, we propose a two-pronged attention-based architecture designed to project multi-object inputs into a permutation-invariant feature space.

Architecture of the Permutation Invariant Attention Mechanism.

As shown in the figure above, the mechanism consists of two primary components:

  1. Abstraction Network ($\pi_{abstraction}$): This network projects each individual object's state into a new invariant feature space ($Z_i$).
  2. Filter Network ($\pi_{filter}$): This component assigns an importance weight to each object, which is then normalized via a Softmax layer to produce $w_i$.

The final representation is achieved by multiplying the abstracted features by their weights and summing the results across the object dimension. Because summation is a commutative operation, the resulting output vector $s_i^*$ is mathematically guaranteed to remain identical regardless of the input order of objects. This architecture naturally handles variable input sizes, as the summation always produces a fixed-size vector for the downstream policy network.

For environments with distinct categories of entities (e.g., "Food" vs. "Poison"), we employ Multi-Class Attention. By using parallel attention mechanisms for each class and concatenating the results, the agent preserves exchangeability within each class while maintaining the ability to distinguish between different types of objects.

Experimental Evaluation

The proposed method was evaluated on three distinct reinforcement learning environments:

  • Scavenger Task 1: A single-class task where an agent must collect food particles.
  • Scavenger Task 2: A multi-class task requiring the agent to collect food while avoiding poison.
  • Convoy Protection: A high-fidelity simulation where a defender must protect a moving convoy from attackers spawned at random intervals, testing the model's ability to handle a variable number of active entities.

Key Results and Discussion

The invariant representation provides a massive theoretical advantage: for 10 objects, the state space exploration requirement is reduced by a factor of over 3.6 million ($10!$). Empirical results confirm this advantage across all tested tasks.

Agent training curves comparing the abstracted approach against baseline and optimal performance.

In the Scavenger tasks, standard Proximal Policy Optimization (PPO) failed to converge when more than two targets were present. In contrast, the attention-based agent scaled effortlessly to 10 objects. In the complex Convoy Protection task, the baseline agent failed to learn a successful policy even after 20 million steps. The invariant agent reached near-optimal performance in just 6 million steps, demonstrating superior sample efficiency.

Limitations and Future Work

While highly effective, the approach has some limitations. There is a minor initial learning overhead as the agent must first learn the parameters of the attention sub-graph. Additionally, the current model processes objects in isolation; it does not explicitly model complex inter-object interactions (e.g., one object blocking another). Future work may integrate self-attention or Transformer-style layers to capture these relationships and explore applying similar exchangeability principles to the action space.

Summary updated

BibTeX
@inproceedings{mern2020exchangeable,
  author = {John Mern and Dorsa Sadigh and Mykel J. Kochenderfer},
  title = {{Exchangeable Input Representations for Reinforcement Learning}},
  booktitle = {ACC},
  year = {2020},
  doi = {10.23919/acc45564.2020.9147901},
}
Figure