On the Use and Misuse of Absorbing States in Multi-agent Reinforcement Learning

Andrew Cohen, Ervin Teng, Vincent-Pierre Berges, Ruo-Ping Dong, Hunter Henry, Marwan Mattar, Alexander Zook, Sujoy GangulyarXiv 2021

Introduction

In cooperative multi-agent reinforcement learning (MARL), agents often operate in dynamic environments where the team composition changes over time. Agents may "spawn" into the environment late or "terminate" early due to mission completion, failure, or strategic sacrifice. A significant challenge in these scenarios is Posthumous Credit Assignment (PCA): the ability to reward an agent for actions that contribute to team success even if that success is realized after the agent has left the environment.

The Pitfalls of Absorbing States

The conventional approach to handling variable agent counts in MARL involves absorbing states. When an agent terminates, its state is replaced by a dummy "absorbing" vector (typically zeros), and its presence is maintained in the system until the entire episode concludes. This allows fixed-size neural network architectures, such as fully connected (FC) layers, to process the input.

However, this practice introduces significant sample inefficiency. As the number of inactive agents increases, the network must learn to ignore an increasing amount of "junk" data. Furthermore, absorbing states do not inherently solve the PCA problem; they merely provide a structural bridge that often fails to propagate value effectively back to the terminated agent's final actions.

Comparison of learning efficiency between attention-based and fully-connected (absorbing state) architectures on a toy task.

As shown in the toy task of calculating the average of a variable number of floats, architectures relying on absorbing states (FC) suffer from significantly higher error and slower convergence compared to attention-based models as the number of inputs varies. The attention mechanism's inherent permutation invariance allows it to focus on relevant data without being distracted by zero-padded "ghost" agents.

MA-POCA: A Dynamic Architecture

To address these limitations, researchers at Unity Technologies proposed MA-POCA (Multi-Agent POsthumous Credit Assignment). MA-POCA moves away from fixed-size centralized critics in favor of a Residual Self-Attention (RSA) mechanism.

Key Innovations:

  1. Dynamic Input Handling: By utilizing set-based attention, the centralized critic processes only the observations of currently active agents. This eliminates the need for padding or absorbing states, focusing the model's capacity on relevant information.
  2. Counterfactual Baselines via Attention: Building on the COMA (Counterfactual Multi-Agent Policy Gradients) framework, MA-POCA uses attention to compute a baseline that estimates the team's value if a specific agent had acted differently. This allows for precise credit assignment even in large, fluctuating teams.
  3. Value Propagation: The centralized value function naturally propagates rewards earned by survivors back to the agents that enabled those rewards, regardless of whether those agents are still active in the environment.

Experimental Evaluation

MA-POCA was evaluated against standard algorithms like PPO and COMA across several benchmarks, including traditional tasks (Simple Spread, Collaborative Push Block) and novel dynamic environments:

  • Baton Pass: Requires agents to spawn new teammates to continue a task chain.
  • Dungeon Escape: A complex coordination task where one agent must sacrifice itself to a dragon to retrieve a key, enabling its teammates to escape.

Results and Discussion

MA-POCA demonstrated superior performance in all dynamic tasks. In Dungeon Escape, it was the only algorithm capable of consistently learning the sacrificial strategy required for team success. Standard algorithms failed because they could not effectively attribute the final escape reward to the agent that died early in the episode.

Learning curves for the Dungeon Escape environment, demonstrating MA-POCA's ability to solve tasks requiring posthumous credit assignment.

Beyond dynamic tasks, MA-POCA showed lower variance and faster convergence in static environments, proving that the attention-based critic is a more robust and efficient architecture for multi-agent coordination. The permutation invariance of the attention mechanism allows the model to generalize across agent identities more effectively than fixed-slot architectures.

Conclusion

MA-POCA represents a significant step forward in MARL for dynamic environments. By replacing the "misuse" of absorbing states with a flexible attention-based critic, we enable agents to learn complex, sacrificial behaviors and coordinate effectively in ever-changing team compositions. Future work will explore extending this architecture to environments with an unknown or unbounded number of agents.

Summary updated

BibTeX
@misc{cohen2021use,
  author = {Andrew Cohen and Ervin Teng and Vincent-Pierre Berges and Ruo-Ping Dong and Hunter Henry and Marwan Mattar and Alexander Zook and Sujoy Ganguly},
  title = {{On the Use and Misuse of Absorbing States in Multi-agent Reinforcement Learning}},
  year = {2021},
  eprint = {2111.05992},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2111.05992},
}
Figure