HiMemFormer: Hierarchical Memory-Aware Transformer for Multi-Agent Action Anticipation

Zirui Wang, Xinran Zhao, Simon Stepputtis, Woojun Kim, Tongshuang Wu, Katia P. Sycara, Yaqi Xie

TL;DR

HiMemFormer is a novel transformer-based framework designed for online multi-agent action anticipation. By introducing a dual-hierarchical architecture, it effectively integrates global contextual history with agent-specific local memory using a coarse-to-fine decoding strategy, significantly outperforming existing state-of-the-art models in complex multi-agent environments.

What Problem Does This Paper Address?

Anticipating human actions is a foundational challenge in robotics and spatial AI. While predicting what a single individual will do next has seen major progress, real-world environments usually involve multiple agents interacting with each other.

Existing multi-agent forecasting models typically rely on a single, unified global representation to capture temporal and social dynamics across the entire scene. However, this "one-size-fits-all" approach ignores a crucial reality: different agents require information at different scales. For example, an agent involved in a complex, multi-step collaborative task relies heavily on long-term memory, whereas an agent responding to a sudden environmental change relies on short-term memory. Forcing every agent to use the same global context introduces redundant information and noise, leading to prediction latency and inaccuracies.

Methods

To address this, the authors propose the Hierarchical Memory-Aware Transformer (HiMemFormer). The model processes two streams of input: a target agent's First-Person-View (FPV) video and a Third-Person-View (TPV) video capturing the entire scene context.

The architecture consists of two primary components:

  1. Agent-to-Context Encoder: This module follows a specific-to-general paradigm. It compresses the target agent's long-term history ($M_L^{(a)}$) into a latent representation and then uses cross-attention with the global contextual long-term history ($M_L^{(c)}$) to generate an augmented, context-aware long-term memory representation.
  2. Context-to-Agent Decoder: This module employs a coarse-to-fine strategy to predict actions. First, a Coarse Action Decoder combines global short-term memory ($M_S^{(c)}$) with learnable query tokens to map out all possible actions occurring in the scene. Next, a Fine Action Decoder refines this broad prediction by cross-attending it with the specific agent's unique short-term history ($M_S^{(a)}$), narrowing it down to the target agent's precise future action.
The HiMemFormer architecture featuring the Agent-to-Context Encoder and the coarse-to-fine Context-to-Agent Decoder.

Datasets

The model was evaluated on the LEMMA dataset, a public multi-view dataset designed for learning multi-agent, multi-task activities. It contains 862 compositional atomic actions across 324 activities, filmed with 445 egocentric videos. The authors tested their model across four distinct scenarios:

  • Single-agent single-task ($1 \times 1$)
  • Single-agent multi-task ($1 \times 2$)
  • Multi-agent single-task ($2 \times 1$)
  • Multi-agent multi-task ($2 \times 2$)

Key Insights and Ideas

  • Customized Feature Granularity: Instead of treating global context as a monolith, HiMemFormer allows each agent's decoder to selectively extract features at the required granularity, effectively filtering out environmental noise.
  • The Power of Coarse-to-Fine Inductive Bias: Predicting general scene actions before isolating individual agent actions provides a structured approach that mirrors how humans perceive group dynamics.
  • Memory Scaling Limits: Interestingly, the ablation studies reinforced findings from prior work showing that simply increasing memory size (beyond 64 seconds for long-term or 5 seconds for short-term) does not guarantee better performance, highlighting the importance of memory structure over memory volume.

Key Results

Evaluated using per-frame mean Average Precision (mAP) over a 2-second anticipation window, HiMemFormer consistently outperformed strong baselines like LSTR and MAT:

  • In the highly complex multi-agent multi-task ($2 \times 2$) setting, HiMemFormer achieved 70.6% mAP, outperforming LSTR (68.0%) and MAT (67.1%).
  • To ensure a fair comparison with models that look into the future, the authors created HiMemFormer+ (built on top of MAT). This variant achieved the highest accuracy in the multi-agent single-task ($2 \times 1$) scenario at 50.5% mAP.
Table 1: Results of online action anticipation on LEMMA [20] using SlowFast features in up to 2 seconds. In particular, we report accuracy in mAP across 4 scenarios, including single agent scenarios where it perform single or multiple task, and multi-agent scenarios where multiple agents collaborate on single task or carry out separate tasks.

Limitations and Future Work

While HiMemFormer demonstrates the clear value of hierarchical memory, the authors point out several avenues for improvement:

  • Incorporate Structured Knowledge: Integrating explicit scene graphs or knowledge graphs could help the model better interpret complex spatial relationships and object interactions.
  • Leveraging LLMs: Incorporating Large Language Models (LLMs) could enhance the framework's high-level reasoning capabilities and improve interpretability.
  • Adaptive Mechanisms: Future iterations could explore mechanisms that dynamically shift the model's emphasis between global context and local agent history in real-time, based on the volatility of the environment.

Summary updated

BibTeX
@misc{wang2024himemformer,
  author = {Zirui Wang and Xinran Zhao and Simon Stepputtis and Woojun Kim and Tongshuang Wu and Katia P. Sycara and Yaqi Xie},
  title = {{HiMemFormer: Hierarchical Memory-Aware Transformer for Multi-Agent Action Anticipation}},
  year = {2024},
  eprint = {2411.01455},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.01455},
}
Figure