Introduction: The Trajectory Prediction Trilemma
Predicting the future movement of pedestrians and vehicles is fundamental to autonomous navigation. However, current methodologies face a "trilemma" between interpretability, accuracy, and robustness. Manual heuristics, such as Social Force models, are explainable and computationally efficient but often lack the precision required for complex scenarios. Conversely, Deep Learning (DL) models offer high accuracy but operate as "black boxes" that are computationally expensive and prone to failure when encountering out-of-distribution (OOD) data.
TrajEvo bridges this gap by automating the design of trajectory prediction heuristics. By leveraging Large Language Models (LLMs) within an evolutionary framework, TrajEvo generates human-readable Python code that matches the performance of DL models while maintaining the speed and explainability of traditional heuristics.
Methodology: LLM-driven Evolutionary Framework
TrajEvo treats the design of prediction logic as an iterative evolutionary process where an LLM (e.g., Gemini 2.0 Flash) serves as the genetic operator. Unlike traditional Genetic Programming that relies on random code mutations, TrajEvo utilizes the LLM's reasoning capabilities to perform targeted refinements based on textual feedback.
The framework consists of several key components:
- Initialization: The LLM is seeded with a basic "Constant Velocity" model and generates a diverse initial population of Python functions.
- Evaluation and Statistics Feedback Loop (SFL): Heuristics are evaluated against real-world data. Instead of providing a simple numerical score, the system generates "verbal gradients"—statistical summaries of specific failure cases (e.g., "fails on sharp turns")—allowing the LLM to debug and refine the logic effectively.
- Cross-Generation Elite Sampling (CGES): To avoid local optima, TrajEvo maintains a "Hall of Fame" of high-performing heuristics from all previous generations, ensuring that successful strategies are preserved and recombined.
- Crossover and Mutation: The LLM acts as a reasoning optimizer, combining successful code snippets or mutating elite individuals to produce the next generation.
The final output is a standalone Python function, requiring no LLM or GPU for inference.
Experimental Results
The authors evaluated TrajEvo on the ETH-UCY benchmark and tested its robustness using the Stanford Drone Dataset (SDD) as an OOD test set.
Generalization and Robustness
TrajEvo demonstrated superior generalization capabilities. When tested on the OOD SDD dataset without further tuning, it achieved a 20%+ improvement over state-of-the-art DL models like MoFlow. This robustness stems from evolving logic rather than weights; a heuristic for collision avoidance remains valid across different environments.
Efficiency and Explainability
TrajEvo offers extreme computational efficiency. The generated heuristics run in approximately 0.65ms on a single CPU core—2400x faster than optimized DL models on a GPU. Furthermore, the development process is highly cost-effective, with a full evolution run costing roughly $0.05 in API fees. The resulting code is fully transparent and human-readable, allowing experts to verify and understand the underlying prediction strategies.
Conclusion and Future Work
TrajEvo presents a paradigm shift in trajectory prediction by automating the discovery of explainable, efficient, and robust heuristics. While it currently trails the most specialized neural networks in purely in-distribution accuracy, its OOD performance and efficiency make it highly suitable for real-world deployment. Future work aims to incorporate semantic map data and visual information to handle more complex navigation tasks.
Summary updated