TL;DR
RAG-TP introduces Retrieval-Augmented Generation (RAG) to vehicle trajectory prediction, shifting the reliance from uncertain real-time online perception to a large-scale, structured offline knowledge base. By decoupling general reasoning from static model parameters, it achieves state-of-the-art performance in both map-based and map-free settings while delivering exceptional zero-shot cross-domain generalization.
What Problem Does This Paper Address?
Predicting where a vehicle will drive next is a cornerstone of safe autonomous driving. Currently, models fall into two camps: map-based methods, which rely heavily on high-definition (HD) maps, and map-free methods, which try to implicitly learn traffic rules from real-time agent interactions.
Both paradigms suffer from a shared bottleneck: a strict dependence on online-only inputs and real-time perception. Statically embedding this knowledge into model parameters makes them brittle. When a vehicle encounters an out-of-distribution (OOD) scenario—like a new city or an unusual intersection layout—performance drops sharply, risking dangerous "hallucinations." Furthermore, HD maps are expensive to maintain and vary wildly across regions. The authors tackle this by asking: Can we decouple a model's reasoning capabilities from its spatial-temporal knowledge using an external database?
Methods
The authors propose RAG-TP (Retrieval-Augmented Generation for Trajectory Prediction), which reframes trajectory forecasting as a retrieval task from a structured offline knowledge base.
The framework operates in three main stages:
- Offline Knowledge Base Construction:
- Self-Supervised Feature Extraction: The authors pre-train independent autoencoders to learn decoupled representations for three modalities: history trajectories, scene context, and future trajectories.
- Behavioral Clustering: To capture distinct driving patterns (e.g., left turns, lane changes), they apply K-Means clustering to the combined history and scene embeddings. Representative samples from these clusters form a structured Key-Value database, indexed using FAISS for sub-linear approximate nearest neighbor search.
- Dynamic Retrieval: During online inference, a frozen query encoder converts the agent's current history into a query vector to find the top-$N$ most relevant historical experiences from the database. A separate, fully trainable task encoder preserves predictive capacity for downstream decoding.
- Retrieval-Driven Mixture-of-Experts (MoE) Fusion: Instead of using a conventional parametric MoE with static branches, RAG-TP dynamically treats the retrieved historical experiences as "experts." A cross-attention gating network weights these experts to generate an augmented context embedding ($e_{RAG}$).
Finally, a two-stage proposal-refinement decoder uses this rich context to output the final multi-modal trajectories.
Datasets
The framework was validated across three major trajectory prediction benchmarks:
- Argoverse 1: Used primarily for evaluating the map-free configuration (2s history $\rightarrow$ 3s future task).
- Argoverse 2: Used for map-based evaluations (5s history $\rightarrow$ 6s future task).
- Waymo Open Motion Dataset (WOMD): Combined with Argoverse 2 under a standardized protocol (4s history $\rightarrow$ 5s future) to rigorously test cross-domain and zero-shot generalization.
Key Insights and Ideas
- Decoupling Knowledge from Parameters: By storing driving behaviors in an external database rather than forcing the neural network weights to memorize every scenario, the model avoids OOD performance degradation.
- Intentionally Omitting Load-Balancing Losses: Standard MoE architectures use a load-balancing loss to ensure all experts are utilized equally. RAG-TP deliberately discards this constraint. Because retrieved experts are already rank-ordered by cosine similarity, forcing a uniform distribution would destroy this natural semantic hierarchy.
- Plug-and-Play Versatility: The RAG module isn't locked into a single architecture; integrating it into existing state-of-the-art models like MTR and Forecast-MAE yielded consistent performance gains.
Key Results
- State-of-the-Art Accuracy: In the map-based setting on Argoverse 2, RAG-TP achieved a $\text{minADE}_6$ of 0.60, outperforming top-tier models like QCNet (0.67) and MTR (0.82). In map-free settings on Argoverse 1, it achieved a competitive $\text{minADE}_6$ of 0.72.
- Zero-Shot Adaptation: When a model trained on Argoverse 2 was tested on the Waymo dataset, its performance normally degraded. However, by simply swapping the retrieval database to Waymo's knowledge base without retraining the model, the $\text{minADE}_6$ improved from 1.32 to 1.05.
- Real-Time Efficiency: Benchmarked on a single NVIDIA RTX 4090 GPU, RAG-TP demonstrated an end-to-end latency of 35.9 ms (23.6 ms base model + 12.3 ms RAG overhead), making it fully viable for real-time autonomous driving applications.
Limitations and Future Work
While RAG-TP shows remarkable robustness, the authors note that the knowledge base is currently static after construction. They point out that future work should explore online knowledge updates to enable continual learning as the autonomous vehicle encounters new environments in real-time. Additionally, further research is needed to improve system robustness when querying entirely novel scenarios that have no close matches in the database.
Summary updated