LASER: Script Execution by Autonomous Agents for On-demand Traffic Simulation

Hao Gao, Jingyue Wang, Wenyang Fang, Jingwei Xu, Yunpeng Huang, Taolue Chen, Xiaoxing Ma · DOI

Introduction

Training and validating Autonomous Driving Systems (ADS) requires vast amounts of high-quality data. While real-world driving logs are the standard, they are often inefficient for training safety-critical responses. Most real-world data consists of repetitive, uneventful driving. The "long-tail" events—rare, high-risk scenarios like sudden swerves, emergency vehicle interactions, or near-misses—are seldom captured but are essential for ensuring ADS safety.

Existing simulation methods struggle to bridge this gap. Rule-based simulations are often too rigid and predictable, while learning-based methods that mimic human logs frequently suffer from "causal confusion," where small errors accumulate over time, leading to unrealistic behaviors. Furthermore, these systems are difficult for non-expert users to customize using natural language. To address these challenges, researchers have developed LASER (LLM-based scenArio Script gEnerator and ExecutoR), a framework that treats traffic simulation like a movie production, using Large Language Models (LLMs) to direct complex agent behaviors.

The LASER Framework

LASER operates in two distinct stages: high-level scriptwriting and real-time agent execution. This separation allows the system to maintain logical consistency while ensuring the physical realism of vehicle movements.

1. The Script Writer

Using a hierarchical Chain-of-Thought (CoT) approach, an LLM (specifically GPT-4o) translates a user's natural language requirement into a Master Script. This script is then decomposed into individual Sub-scripts for every actor in the scene. These sub-scripts define "Logic-Chained Behaviors" (LCB), which include specific actions, termination conditions (defining when an action is complete), and the underlying reasoning for the behavior.

2. The LASER-Agent

Each vehicle in the simulation is controlled by an agent consisting of two modules:

  • LLM Decision Module: Every 0.5 seconds, this module evaluates the sub-script against the current environment state to select a high-level action (e.g., "Change to the right lane").
  • Rule-based Planner: A lightweight PID controller translates these high-level decisions into low-level control signals (steering, throttle, and brake) within the simulator.
The LASER framework architecture, illustrating the flow from user input to script generation and agent execution.

By utilizing LLMs for high-level logic and rule-based systems for the physics of driving, LASER avoids the erratic, jittery behavior often seen when LLMs attempt to control vehicle dynamics directly.

Experimental Setup and Validation

The framework was validated using the CARLA simulator (v0.9.15). To test LASER's capabilities, the authors introduced a new benchmark consisting of 17 user requirements representing complex, multi-agent scenarios such as "Accident," "Ambulance," "Sudden Jaywalker," and "Reckless Driving."

To demonstrate LASER's utility as a testing tool, the researchers used it to evaluate InterFuser, a state-of-the-art autonomous driving model that previously ranked #1 in the CARLA Challenge. The goal was to see if LASER could generate scenarios challenging enough to expose vulnerabilities in high-performing ADS models.

Visual examples of various safety-critical traffic scenarios generated and executed by LASER, including accidents, ambulances, and cut-ins.

Key Insights and Results

LASER demonstrates several advantages over traditional simulation methods:

  • Minimal Human Effort: The automated Script Writer is highly efficient. Users only needed to manually provide or correct approximately 3.18% of the characters in the final executable scripts, significantly reducing the manual labor required for scenario creation.
  • High Reliability: LASER achieved an average success rate of 90.48% in executing complex, multi-agent scenarios, proving that the LCB approach is robust across different traffic contexts.
  • Top-Down Execution: Unlike traditional methods that build behavior "bottom-up" by predicting the next coordinate, LASER works "top-down." The agent understands its goal via the script and interprets the environment to fulfill it, which drastically reduces the accumulation of prediction errors over time.
  • Common-Sense Reasoning: By leveraging the inherent knowledge within LLMs regarding social norms and physics (e.g., understanding that vehicles must yield to an ambulance), LASER can coordinate multi-agent interactions that are notoriously difficult to program manually.

Limitations and Future Work

While LASER represents a significant step forward, several areas for improvement remain. Currently, the system requires a human to describe the road layout in text for the LLM; future versions could use image-to-text models to automate this process. Additionally, the latency involved in querying a large LLM every 0.5 seconds is a bottleneck; the authors suggest that smaller, fine-tuned "distilled" models could provide similar logic with much lower overhead. Finally, ensuring that agents can mimic specific regional or cultural driving nuances remains an open research challenge.

Summary updated

BibTeX
@misc{gao2024laser,
  author = {Hao Gao and Jingyue Wang and Wenyang Fang and Jingwei Xu and Yunpeng Huang and Taolue Chen and Xiaoxing Ma},
  title = {{LASER: Script Execution by Autonomous Agents for On-demand Traffic Simulation}},
  year = {2024},
  eprint = {2410.16197},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.16197},
}
Figure