GameFormer: Game-theoretic Modeling and Learning of Transformer-based Interactive Prediction and Planning for Autonomous Driving

Zhiyu Huang, Haochen Liu, Chen Lv · DOI

Abstract

Autonomous vehicles operating in complex real-world environments require accurate predictions of interactive behaviors between traffic participants. This paper tackles the interaction prediction problem by formulating it with hierarchical game theory and proposing the GameFormer model for its implementation. The model incorporates a Transformer encoder, which effectively models the relationships between scene elements, alongside a novel hierarchical Transformer decoder structure. At each decoding level, the decoder utilizes the prediction outcomes from the previous level, in addition to the shared environmental context, to iteratively refine the interaction process. Moreover, we propose a learning process that regulates an agent's behavior at the current level to respond to other agents' behaviors from the preceding level. Through comprehensive experiments on large-scale real-world driving datasets, we demonstrate the state-of-the-art accuracy of our model on the Waymo interaction prediction task. Additionally, we validate the model's capacity to jointly reason about the motion plan of the ego agent and the behaviors of multiple agents in both open-loop and closed-loop planning tests, outperforming various baseline methods. Furthermore, we evaluate the efficacy of our model on the nuPlan planning benchmark, where it achieves leading performance.

Introduction

Driving is inherently a social and interactive task. When navigating complex environments like highway merges or busy intersections, human drivers do not simply react to static obstacles; they predict how others will react to their own presence and actions. This "mutual influence" is a critical component of safe and efficient driving.

Traditional autonomous vehicle (AV) stacks often struggle with this dynamic. Many models are either passive, predicting paths without considering the AV's future actions, or one-way, using conditional prediction to ask "how will they react if I do X?". These approaches fail to capture the recursive "negotiation" that characterizes real-world traffic. GameFormer addresses this by explicitly modeling the recursive reasoning process—where agents respond to the predicted responses of others—using game theory.

Methodology: Level-$k$ Game Theory and Hierarchical Transformers

The core innovation of GameFormer is the integration of Level-$k$ Game Theory into a Transformer architecture. Level-$k$ reasoning is a cognitive science concept suggesting a hierarchy of strategic thinking: a "level-0" agent acts independently, a "level-1" agent responds to level-0 behaviors, and a "level-$k$" agent responds to level-($k-1$) behaviors.

Overview of the GameFormer framework showing the hierarchical Level-k reasoning process across stacked decoder layers.

Hierarchical Transformer Decoder

Instead of a standard single-pass decoder, GameFormer utilizes $K$ stacked layers to implement this reasoning:

  • Level-0 Decoder: Predicts initial trajectories based solely on the scene context (vectorized maps and agent histories) provided by a standard Transformer encoder.
  • Level-$k$ Decoders ($k > 0$): These layers iteratively refine predictions. Each level takes the trajectories from the previous layer as input, using self-attention to model interactions between predicted futures and cross-attention to refine them against the original scene context.

Interaction Loss

To ensure safety and social compatibility, the model is trained with a novel loss function based on a repulsive potential field. This function penalizes the model if an agent's predicted path conflicts with the predicted paths of others from the previous reasoning level, effectively teaching the model to avoid collisions through iterative refinement.

Experimental Evaluation

GameFormer was evaluated on two industry-standard benchmarks: the Waymo Open Motion Dataset (WOMD) for interaction prediction and nuPlan for large-scale planning.

Key Results

  • Interaction Prediction: On the Waymo benchmark, GameFormer achieved a minFDE (Minimum Final Displacement Error) of 1.9373m, outperforming established models like MTR and SceneTransformer.
  • Planning Performance: In open-loop tests, GameFormer reduced the collision rate to 1.98%, a significant improvement over the 2.33% achieved by the DIPP baseline. On the nuPlan benchmark, the GameFormer Planner achieved a leading score of 0.8288, demonstrating robust performance in complex, reactive scenarios.
Qualitative results of GameFormer in various interactive scenarios, including roadside parking, merging, and intersections.

Discussion and Conclusion

GameFormer demonstrates that interaction is best modeled as a refinement process rather than a single calculation. By stacking decoder layers, the model effectively "negotiates" a scene-consistent future. Interestingly, performance peaks around 4 to 6 levels of reasoning, mirroring human cognitive limits.

While the model achieves state-of-the-art accuracy, challenges remain regarding computational overhead for real-time deployment and the need for secondary non-linear optimizers in closed-loop settings to ensure perfect adherence to road boundaries. Future work will focus on optimizing inference and integrating hard constraints directly into the neural architecture.

Summary updated

BibTeX
@inproceedings{huang2023gameformer,
  author = {Zhiyu Huang and Haochen Liu and Chen Lv},
  title = {{GameFormer: Game-theoretic Modeling and Learning of Transformer-based Interactive Prediction and Planning for Autonomous Driving}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
  doi = {10.1109/iccv51070.2023.00361},
}
Figure