TL;DR
TrafficAlign is an automated framework that extracts realistic traffic scenarios from real-world driving videos, validates them using a symbolic domain-specific language, and uses them to fine-tune Large Language Models (LLMs). By aligning LLMs with actual regional traffic distributions, it generates highly effective, location-specific simulation scenarios that reveal up to 10.8% more autonomous vehicle collisions than state-of-the-art baselines.
What Problem Does This Paper Address?
Testing autonomous vehicles (AVs) in virtual simulations is a cost-effective and scalable alternative to dangerous real-world road tests. However, creating realistic, diverse, and safety-critical traffic scenarios remains a major bottleneck.
While recent approaches leverage the generative power of LLMs to automate this process, pretrained LLMs are "generalists." They lack fine-grained, domain-specific traffic knowledge and tend to generate highly homogeneous scenarios. Crucially, they fail to capture regional traffic variations—a scenario generated for downtown New York City looks virtually identical to one generated for a rural mountain pass in Switzerland. This distribution shift makes simulation-based testing less effective at preparing AVs for localized real-world complexities.
Methods
TrafficAlign introduces a closed-loop pipeline that moves from raw video data to an aligned, distribution-aware LLM.
The framework operates in three core phases:
- Data Synthesis: TrafficAlign samples frames from real-world driving videos. A multimodal LLM (GPT-4.1 nano) uses structured prompting (including chain-of-thought and role-playing) to extract detailed natural language descriptions of the road network, environmental conditions, and actor behaviors (ego vehicle, NPCs, pedestrians).
- Data Validation via DSL Proxy: Because natural language is unstructured and prone to ambiguity or hallucination, TrafficAlign translates these descriptions into a formal, symbolic Domain-Specific Language (DSL) using GPT-5. A syntactic and semantic checker verifies that all essential attributes (like weather, time, and actor trajectories) are present. If a scenario is incomplete, a self-refinement loop feeds error messages back to the synthesizer for correction.
- LLM Alignment: The validated natural language descriptions are used to fine-tune a generator LLM (Llama-3.2-3B-Instruct) via Parameter-Efficient Fine-Tuning (LoRA).
Finally, the aligned LLM generates text descriptions that are automatically compiled into executable Scenic scripts for 3D simulation within the CARLA environment.
Datasets
To evaluate geographic generalizability, the authors curated six distinct synthetic datasets derived from 261 first-person perspective driving videos sourced from YouTube. The datasets span diverse environments:
- Metropolitan Areas: Los Angeles and New York City.
- National Parks: Yosemite and Yellowstone.
- Rural/Small Town: A small town in Pennsylvania, USA.
- Country-Scale: A diverse dataset covering various driving environments across Switzerland.
Key Insights and Ideas
- The Power of a Symbolic Proxy: Directly validating unstructured natural language text for factual correctness is notoriously difficult. Translating the text into a context-free grammar (DSL) allows for deterministic, rigorous rule-checking before the data is used for fine-tuning.
- Fixing the LLM "Homogeneity" Bias: Unaligned LLMs default to generic traffic behaviors. By grounding the fine-tuning process in localized video frames, TrafficAlign successfully forces the model to mimic the unique density, actor distributions, and environmental profiles of specific target regions.
Key Results
The authors evaluated TrafficAlign against state-of-the-art baselines (including ChatScene and unaligned frontier models like GPT-4o and Claude) using the SafeBench platform across three reinforcement learning-based driving models (PPO, SAC, and TD3).
- Challenging Test Generation: Scenarios generated by TrafficAlign proved significantly more rigorous, exposing up to 10.8% more collisions on average than the strongest baseline.
- Safety Improvements: Fine-tuning the autonomous driving models on TrafficAlign-generated scenarios led to a massive 36.1% reduction in collision rates when tested on a held-out evaluation set.
- Distribution Alignment: High-dimensional embeddings of the generated scenarios were projected into a 2D space using UMAP. As shown below, TrafficAlign’s scenarios (orange) tightly overlap with real-world data (green), whereas unaligned baseline LLMs form entirely separate, displaced clusters.
Limitations and Future Work
While highly effective, TrafficAlign currently possesses two main limitations:
- Uniform Frame Sampling: Sampling video frames at fixed intervals (e.g., every 15 seconds) keeps the dataset representative of normal driving but can easily miss rare, safety-critical, or "long-tail" traffic events. Future iterations could benefit from event-triggered or anomaly-aware video sampling.
- Lack of Temporal Cues: The scenario extractor processes single, static frames. This prevents the model from capturing complex temporal dynamics, such as sudden lane cuts or varying acceleration patterns. The authors suggest integrating short video clips and specialized computer vision models in future work to preserve these vital temporal cues.
Summary updated