Abstract
Accurate and efficient motion prediction is a cornerstone of autonomous vehicle safety. While generative models have shown promise in capturing the multi-modal nature of future trajectories, they often suffer from high computational costs and poor calibration. This paper presents TrajFlow, a framework that leverages Flow Matching to generate multiple plausible future trajectories in a single inference pass. By integrating a multi-shot decoder with a Plackett-Luce ranking loss, TrajFlow achieves state-of-the-art performance on the Waymo Open Motion Dataset (WOMD) while maintaining the efficiency required for real-time deployment.
Introduction
Predicting the future movement of dynamic agents—vehicles, pedestrians, and cyclists—is inherently uncertain. A single historical context can lead to multiple valid futures, such as a vehicle choosing to turn left or continue straight. Capturing this multi-modality is essential for safe planning.
Recent advances in generative modeling, particularly Diffusion Models (DMs), have improved the diversity of trajectory predictions. However, DMs are typically iterative and require multiple sampling passes to generate a set of diverse outcomes, making them computationally expensive for on-board systems. Furthermore, these models often struggle with calibration, where the assigned probability of a trajectory does not correlate well with its actual likelihood. TrajFlow addresses these challenges by shifting from Diffusion to Flow Matching (FM) and introducing a multi-shot architecture optimized for both speed and accuracy.
Methodology
TrajFlow is built upon the principles of Flow Matching, a class of generative models that learns to solve Ordinary Differential Equations (ODEs) to transform a simple probability distribution (noise) into a complex data distribution (trajectories).
Multi-shot Flow Matching
Standard generative models often produce one sample at a time. To generate a diverse set of $K$ trajectories, they must be run $K$ times. TrajFlow circumvents this by using a multi-shot decoder. The decoder employs $N_q$ (e.g., 64) learnable query tokens to predict multiple trajectories and their associated confidence scores simultaneously. This joint prediction ensures coherence across the generated modes and significantly reduces the computational overhead compared to independent sampling.
Plackett-Luce Ranking Loss
Calibration remains a significant hurdle in motion prediction. Traditional classification losses, such as Cross-Entropy, often fail to provide a meaningful gradient for "near-miss" trajectories. TrajFlow adopts a Plackett-Luce ranking loss, treating the selection of the best trajectory as a ranking problem. By penalizing the model when it fails to rank trajectories closer to the ground truth higher than others, the model learns a more nuanced and better-calibrated scoring mechanism.
Self-Conditioning and Architecture
The model utilizes a Transformer-based encoder-decoder architecture. The encoder processes map polylines and agent history, while the decoder generates multi-modal outputs. To improve generalization and prevent the model from "copying" inputs during low-noise training phases, a self-conditioning strategy is employed. This involves re-feeding intermediate predictions back into the model, forcing it to learn more robust features.
Experimental Results
The framework was evaluated on the Waymo Open Motion Dataset (WOMD), a large-scale benchmark featuring over 500,000 real-world scenarios.
Performance and Efficiency
TrajFlow established a new state-of-the-art for models not utilizing LIDAR data or ensembles. It achieved a mean Average Precision (mAP) of 0.4604, surpassing previous benchmarks like EDA (0.4487) and MTR++ (0.4329).
Crucially, TrajFlow maintains high efficiency. Despite its generative nature, it processes an agent in approximately 16.44ms. This is faster than the popular MTR baseline (19.96ms) and uses fewer parameters (53.3M vs 65.8M). The authors found that a single-step ODE solver was sufficient to achieve these results, making the inference time comparable to non-generative, deterministic models.
Interactive Prediction
In addition to single-agent prediction, TrajFlow was tested on joint motion prediction tasks involving interacting agents. It demonstrated superior performance in both mAP and Soft mAP, indicating its ability to capture complex social dynamics.
Discussion and Limitations
While TrajFlow represents a significant step forward, certain challenges remain. The model occasionally struggles with "edge cases"—rare or illegal behaviors like sudden U-turns. Additionally, while the ranking loss improves calibration, there are still instances where highly accurate trajectories are assigned low confidence scores. Future research may focus on incorporating explicit social physics or leveraging larger datasets to better handle complex interaction scenarios.
Conclusion
TrajFlow demonstrates that Flow Matching, combined with a multi-shot decoder and ranking-based loss, provides a powerful and efficient solution for multi-modal motion prediction. By balancing the expressive power of generative models with the speed of single-pass architectures, TrajFlow offers a viable path for real-time deployment in autonomous driving systems.
Summary updated