Generating Traffic Scenarios via In-Context Learning to Learn Better Motion Planner
Aizierjiang Aiersilan
TL;DR
This work tackles the scarcity and cost of collecting diverse safety-critical traffic scenarios for autonomous-vehicle motion planning. It introduces AutoSceneGen, a universal, cost-efficient framework that uses in-context learning with large language models to convert user-described scenarios into executable simulator configurations (e.g., CARLA) without training new models. The approach includes a robust pipeline with input filtering, exemplar-driven ICL, and a validator to ensure simulator compatibility, enabling automated generation of rich, rare, and open-world scenarios. Empirical results show that motion planners trained on AutoSceneGen data—alone or in combination with real datasets—achieve lower displacement errors (ADE/FDE) in trajectory prediction, demonstrating the practical value of synthetic, diverse training data for safety-critical evaluation. Overall, AutoSceneGen offers scalable, end-to-end capabilities for rapid scenario generation and safety testing of AVs in open-world environments, with broad implications for reliability and accident reconstruction.
Abstract
Motion planning is a crucial component in autonomous driving. State-of-the-art motion planners are trained on meticulously curated datasets, which are not only expensive to annotate but also insufficient in capturing rarely seen critical scenarios. Failing to account for such scenarios poses a significant risk to motion planners and may lead to incidents during testing. An intuitive solution is to manually compose such scenarios by programming and executing a simulator (e.g., CARLA). However, this approach incurs substantial human costs. Motivated by this, we propose an inexpensive method for generating diverse critical traffic scenarios to train more robust motion planners. First, we represent traffic scenarios as scripts, which are then used by the simulator to generate traffic scenarios. Next, we develop a method that accepts user-specified text descriptions, which a Large Language Model translates into scripts using in-context learning. The output scripts are sent to the simulator that produces the corresponding traffic scenarios. As our method can generate abundant safety-critical traffic scenarios, we use them as synthetic training data for motion planners. To demonstrate the value of generated scenarios, we train existing motion planners on our synthetic data, real-world datasets, and a combination of both. Our experiments show that motion planners trained with our data significantly outperform those trained solely on real-world data, showing the usefulness of our synthetic data and the effectiveness of our data generation method. Our source code is available at https://ezharjan.github.io/AutoSceneGen.
