Abstract
Trajectory prediction is a critical task in modeling human behavior,especially in safety-critical domains such as social robotics and autonomousvehicle navigation. Traditional heuristics based on handcrafted rules oftenlack accuracy and generalizability. Although deep learning approaches offerimproved performance, they typically suffer from high computational cost,limited explainability, and, importantly, poor generalization toout-of-distribution (OOD) scenarios. In this paper, we introduce TrajEvo, aframework that leverages Large Language Models (LLMs) to automatically designtrajectory prediction heuristics. TrajEvo employs an evolutionary algorithm togenerate and refine prediction heuristics from past trajectory data. We proposetwo key innovations: Cross-Generation Elite Sampling to encourage populationdiversity, and a Statistics Feedback Loop that enables the LLM to analyze andimprove alternative predictions. Our evaluations demonstrate that TrajEvooutperforms existing heuristic methods across multiple real-world datasets, andnotably surpasses both heuristic and deep learning methods in generalizing toan unseen OOD real-world dataset. TrajEvo marks a promising step toward theautomated design of fast, explainable, and generalizable trajectory predictionheuristics. We release our source code to facilitate future research athttps://github.com/ai4co/trajevo.