LinguaSim: Interactive Multi-Vehicle Testing Scenario Generation via Natural Language Instruction Based on Large Language Models

Qingyuan Shi, Qingwen Meng, Hao Cheng, Qing Xu, Jianqiang WangarXiv 2025 · DOI

Abstract

The generation of testing and training scenarios for autonomous vehicles has drawn significant attention. While Large Language Models (LLMs) have enabled new scenario generation methods, current methods struggle to balance command adherence accuracy with the realism of real-world driving environments. To reduce scenario description complexity, these methods often compromise realism by limiting scenarios to 2D or open-loop simulations where background vehicles follow predefined, non-interactive behaviors. We propose LinguaSim, an LLM-based framework that converts natural language into realistic, interactive 3D scenarios, ensuring both dynamic vehicle interactions and faithful alignment between the input descriptions and the generated scenarios. A feedback calibration module further refines the generation precision, improving fidelity to user intent. By bridging the gap between natural language and closed-loop, interactive simulations, LinguaSim constrains adversarial vehicle behaviors using both the scenario description and the autonomous driving model guiding them. Experiments show LinguaSim can generate scenarios with varying criticality aligned with different natural language descriptions, and its refinement module effectively reduces excessive aggressiveness, lowering the crash rate from 46.9% to 6.3%.

Introduction

Testing autonomous vehicles (AVs) in real-world environments is inherently slow, expensive, and fraught with safety risks. Consequently, high-fidelity simulation has become a cornerstone of AV development. Recent advancements have explored using Large Language Models (LLMs) to generate these testing scenarios from simple natural language prompts, such as "a truck cuts in aggressively."

However, existing methodologies face a significant trade-off. They typically produce either simplistic, open-loop scenarios where background vehicles follow rigid, non-reactive paths, or they utilize fully autonomous adversarial vehicles that act realistically but often ignore the specific constraints of the user's text prompt. LinguaSim addresses this gap by generating 3D, closed-loop scenarios where background vehicles are both intelligent—reacting dynamically to the environment and the ego vehicle—and obedient to natural language instructions.

The LinguaSim Framework

LinguaSim is a multi-agent LLM framework integrated with the CARLA simulator. The pipeline operates through a layered generation process that decomposes complex instructions into manageable sub-tasks handled by specialized agents.

The LinguaSim multi-agent architecture for layered scenario generation and refinement.

As illustrated in the system architecture (Figure 4), the process begins with an Interpreter Agent that breaks the user's prompt into four distinct layers: General Environment (weather and map), Ego Vehicle (spawn points), Adversarial Vehicles (the primary actors), and Background Traffic (random noise vehicles). Specialized agents, such as the Ego Locator and Adv Locator, then search the simulation map for valid spawn points that satisfy the spatial requirements of the description.

Bridging Language and Control: Behavior Topology Web

To ensure background vehicles are interactive yet controllable, LinguaSim introduces the Behavior Topology Web. Instead of requiring the LLM to generate low-level control code, the framework utilizes an Action Generator Agent that selects from a database of "Atomic Behaviors"—such as auto-cruise control or imitation-learning-based planners—and configures them into execution plans.

The Behavior Topology Web facilitates real-time interaction between adversarial vehicles and the ego vehicle.

This topology (Figure 5) allows for real-time interaction between multiple adversarial vehicles and the ego vehicle. By wrapping existing autonomous driving agents into modular blocks, the LLM acts as a high-level director, ensuring the resulting simulation is physically realistic while remaining faithful to the user's semantic intent.

Feedback Calibration and Refinement

A core challenge in LLM-based generation is the models' limited grasp of 3D spatial-temporal physics. For instance, a prompt requesting a car that "almost hits" the ego vehicle often results in an immediate collision in initial generations. LinguaSim solves this through a Feedback Calibration module. The system simulates the generated scenario, evaluates it using safety metrics like Anticipated Collision Time (ACT) and Collision Records, and feeds these results to a Refiner Agent. This agent iteratively tweaks scenario parameters until the physical outcome aligns with the user's description.

Experimental Results

Experiments conducted in the CARLA environment demonstrate LinguaSim's ability to align scenario criticality with natural language descriptions. For prompts labeled "Dangerous," "Moderate," and "Safe," the framework achieved ACT values of 0.072s, 0.938s, and 3.532s, respectively. Lower ACT values indicate higher criticality, confirming that the generated scenarios matched the requested danger levels.

The refinement module proved particularly effective. Initial zero-shot generations for "near miss" scenarios resulted in a 46.9% crash rate. After up to five refinement episodes, the crash rate plummeted to 6.3%, while maintaining a critical ACT of 0.214s. This demonstrates that the feedback loop successfully captures the nuance of "almost hitting" without breaking the simulation's safety constraints.

Conclusion

LinguaSim represents a significant step toward intuitive, high-fidelity scenario generation for AV testing. By combining layered LLM orchestration with a closed-loop refinement system, it bridges the gap between natural language intent and complex 3D physical interactions. Future work will focus on expanding the framework to diverse simulation environments and validating the utility of these generated scenarios for training robust autonomous driving models.

Summary updated

BibTeX
@misc{shi2025linguasim,
  author = {Qingyuan Shi and Qingwen Meng and Hao Cheng and Qing Xu and Jianqiang Wang},
  title = {{LinguaSim: Interactive Multi-Vehicle Testing Scenario Generation via Natural Language Instruction Based on Large Language Models}},
  year = {2025},
  eprint = {2510.08046},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.08046},
  howpublished = {arXiv},
}
Figure