Skip to main content
Back

KAIST's STAIRS-Former Beats Multi-Agent AI Rivals by 48% on Shifting Team Sizes

A new transformer design for offline multi-agent RL fixes flat attention and short history, setting state-of-the-art results on SMAC, SMAC-v2, MPE, and MaMuJoCo.

Pro

  • STAIRS-Former is a new transformer architecture for offline multi-task multi-agent RL from KAIST, achieving state-of-the-art across four benchmarks
  • Prior methods like HiSSD and ODIS produced nearly uniform attention maps, wasting the transformer's relational modeling capacity
  • Three components drive the gains: recursive spatial module, dual-timescale temporal module with two history tokens, and token dropout for varying agent counts
  • On Marine-Hard SMAC, mean win rate jumps from HiSSD's 57.2% to 67.4%; on Stalker-Zealot the gap reaches 48.6% on sub-optimal data
  • Uses one third the parameters of HiSSD (220K vs 679K) and less GPU memory while beating it consistently
  • Code available at github.com/Jiwonjeon9603/Stairs-Former

Training cooperative agents from fixed logs sounds simple until the team size changes. Swap seven drones for five, or add two new enemies, and most offline multi-agent policies fall apart. A new architecture called STAIRS-Former from KAIST rethinks how transformers should handle this problem, and it beats the previous state-of-the-art by wide margins across four standard benchmarks.

The uniform attention problem

Offline multi-task multi-agent reinforcement learning (MT-MARL) means learning a single policy from pre-collected trajectories that must generalize to new team compositions. The dominant approach uses UPDeT, a transformer that tokenizes each observation into three groups: the agent's own state, other allies, and enemies or environment entities, plus one history token. Recent methods like ODIS and HiSSD built on this with hierarchical skill learning.

The KAIST team ran a diagnostic experiment and found something striking. When they inspected the attention maps of HiSSD, the current state-of-the-art, attention was distributed nearly uniformly across tokens in both seen and unseen tasks, failing to capture important entities. The history token, critical under partial observability, was barely used. The transformer was there in name, but its core strength, modeling rich correlations between tokens, was being wasted.

Attention heatmaps showing uniform attention across agents in HiSSD

The authors trace this to two structural issues. First, prior methods use a single-layer transformer that cannot express diverse entity relationships. Second, the history token in UPDeT is updated through a simple RNN-like operation inside the MLP, which cannot preserve long-term dependencies in partially observable environments.

Three ingredients for sharper attention

STAIRS-Former, short for Spatio-Temporal Attention with Interleaved Recursive Structure, adds three components on top of the UPDeT-style tokenization:

  • Spatial Recursive Module. A deep transformer where each layer's weights are applied multiple times with weight sharing. This lets the model do deeper relational reasoning between entities without inflating parameters.
  • Dual-timescale temporal module. Each agent maintains two history tokens: a low-level one updated every step, and a high-level one updated every T_H steps through a GRU. The short one captures reactive context, the long one summarizes the episode.
  • Token dropout. During training, entity tokens are randomly dropped with probability p_drop, forcing the model to work with variable token counts and generalize to unseen team sizes.

A key architectural detail is that entity tokens and history tokens are pushed through two independent feed-forward networks after each attention block. The reasoning is subtle but important: a shared FFN blends spatial and temporal features together, whereas disjoint FFNs let each pathway specialize. Ablations show this Temporal Focus Layer is what drives most of the reduction in dormant neurons, meaning the model actually uses more of its capacity.

How the pieces fit together

The full pipeline works like this. For each agent, observations are split into own, ally, and enemy tokens and linearly embedded. These are concatenated with the two history tokens and fed to the Spatial-Former. Within each layer, the recursive update runs a few times, feeding the layer input back into itself with weight sharing. The output at the low-level history position becomes the new short-term memory, and periodically the GRU consumes it to update long-term memory.

Individual Q-values from each agent are combined through a Qatten mixing network that can adapt to varying agent counts. Training uses a TD3+BC-style objective adapted for discrete action spaces, mixing temporal-difference learning with behavior cloning to keep the offline policy close to the dataset.

The numbers

Experiments cover four benchmarks: SMAC and SMAC-v2 (StarCraft micromanagement), MPE Cooperative Navigation, and Multi-Agent MuJoCo. On the Marine-Hard SMAC task set, aggregating across expert, medium, medium-expert, and medium-replay data qualities:

SettingUPDeT-mODISHiSSDSTAIRS-Former
Seen tasks mean28.647.364.877.9
Unseen tasks mean21.632.354.764.0
Total mean23.537.057.267.4

On the harder heterogeneous Stalker-Zealot maps, which mix stalkers and zealots, STAIRS-Former beats HiSSD by roughly 48.6% on average across sub-optimal datasets. On SMAC-v2 with its randomized team compositions, it improves seen-task win rates by 23.5% over HiSSD and unseen-task rates by 24.5%. On MaMuJoCo HalfCheetah with different joint partitioning schemes, it more than doubles ODIS scores.

Attention dynamics over a SMAC 3m episode showing STAIRS-Former shifting focus adaptively

What the attention visualizations show is more interesting than the raw numbers. In a 3m SMAC episode, agents initially attend to their own tokens, shift to enemy tokens on contact, focus on weakened allies for protection, then use history tokens to decide between retreat and counterattack. HiSSD's attention stays diffuse across the same trajectory.

Where it struggles

STAIRS-Former is not uniformly dominant. On Marine-Easy with the Medium-Replay dataset, it underperforms HiSSD because that specific dataset is small and the deeper architecture overfits. On Marine-Hard Expert data, HiSSD edges it out slightly because expert-only data does not stress the generalization advantages. The method also requires more memory than lightweight baselines, though it uses less than HiSSD (14.4 GB vs 17.5 GB) with roughly one third the parameters (220K vs 679K).

What is now practical

The paper positions this squarely for real-world cooperative systems where team sizes shift. Concrete scenarios include:

  1. Drone swarms where individual units may drop out mid-mission and the remaining team must adapt
  2. Connected vehicle coordination trained from logged driving data without risky online interaction
  3. Any cooperative multi-robot setting where the same policy needs to handle 3-agent and 12-agent variants

Two other findings deserve attention. First, the attention sharpening ablation shows that simply lowering the softmax temperature to force sharper attention does not work. It causes the model to collapse onto the history token at every step, which hurts performance. Adaptive, situation-aware attention is what matters. Second, adding a naive GRU token to baselines does not close the gap, confirming the gains come from the interaction of the three components rather than any single one.

The code is available on GitHub, and the full paper includes extensive attention visualizations across tasks that make the interpretability claims concrete rather than hand-wavy. For anyone working on offline cooperative policies that need to survive changing team compositions, this is worth a close read.