MotionLM: Multi-Agent Motion Forecasting as Language Modeling

Ari Seff, Brian Cera, Dian Chen, Mason Ng, Aurick Zhou, Nigamaa Nayakanti, Khaled S. Refaat, Rami Al-Rfou, Benjamin Sapp · DOI

Abstract

MotionLM re-imagines multi-agent motion forecasting as a language modeling task by discretizing continuous trajectories into "motion tokens." By employing a standard autoregressive transformer to predict these tokens, the model captures complex, temporally causal interactions between road users. This approach achieves state-of-the-art performance on the Waymo Open Motion Dataset (WOMD) Interactive Prediction Challenge without requiring complex heuristics or latent variables.

Introduction

Predicting the future movement of road agents—such as vehicles, cyclists, and pedestrians—is a fundamental challenge in autonomous driving. Effective forecasting requires modeling the joint distribution of agent behaviors to ensure scene-level consistency and maintaining temporal causality to reflect real-world interactions. Traditional marginal models often fail to account for inter-agent dependencies, leading to unrealistic predictions like overlapping trajectories. Furthermore, many joint models lack strict temporal causality, potentially conditioning an agent's current action on future events that have not yet occurred.

Methods

MotionLM addresses these challenges by treating motion forecasting as a sequence generation task, analogous to natural language processing.

Discrete Motion Tokens

The core innovation lies in the discretization of continuous $(x, y)$ coordinates into a finite vocabulary. Specifically, the model discretizes axis-aligned deltas between waypoints into 169 discrete "motion tokens." This transformation allows the use of standard language modeling objectives to maximize the log probability of the next motion token given the history of all agents in the scene.

MotionLM discretizes continuous trajectories into a vocabulary of motion tokens.

Autoregressive Transformer Architecture

The model utilizes a standard autoregressive transformer decoder. During inference, trajectories are generated step-by-step. For each time step $t$, the model predicts the next move for all agents simultaneously, ensuring that Agent A’s state at $t+1$ is conditioned on the states of all agents at time $t$. This ensures that interactions are modeled with strict temporal causality.

The MotionLM architecture features a scene encoder and an autoregressive transformer decoder for sequential token generation.

To enforce this causality during training, a "staircase" attention mask is applied, preventing the model from accessing future information. Diversity in predictions is achieved through categorical sampling of the output distribution—similar to how large language models generate text. The resulting rollouts are aggregated using K-means clustering and Non-Maximum Suppression (NMS) to identify the most probable joint modes required for benchmarking.

Key Results

MotionLM was evaluated on the Waymo Open Motion Dataset (WOMD) Interactive Prediction Challenge. At the time of publication, it ranked first on the leaderboard, demonstrating significant improvements over previous state-of-the-art methods.

Key quantitative results include:

  • A 6% relative improvement in joint mean Average Precision (mAP).
  • A 3% reduction in miss rate.
  • The lowest "prediction overlap rate" among tested models, indicating superior physical realism and inter-agent consistency.

Qualitatively, the model's reliance on categorical sampling provides a natural mechanism for multi-modality without the need for complex anchor-based or latent-variable-based optimization. Furthermore, the discretization process appears to mitigate small precision errors that often compound during long-term autoregressive rollouts.

Conclusion

MotionLM demonstrates that the simplicity of language modeling can be effectively adapted to the domain of multi-agent motion forecasting. By prioritizing temporal causality and joint distributions through discretization and autoregressive decoding, the model achieves high accuracy and consistency. While the autoregressive nature of the model presents challenges for real-time inference, future work involving model distillation and integration into model-based planning frameworks holds promise for onboard deployment in autonomous vehicles.

Summary updated

BibTeX
@inproceedings{seff2023motionlm,
  author = {Ari Seff and Brian Cera and Dian Chen and Mason Ng and Aurick Zhou and Nigamaa Nayakanti and Khaled S. Refaat and Rami Al-Rfou and Benjamin Sapp},
  title = {{MotionLM: Multi-Agent Motion Forecasting as Language Modeling}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
  doi = {10.1109/iccv51070.2023.00788},
}
Figure