LLM-based Human-like Traffic Simulation for Self-driving Tests

Wendi Li, Hao Wu, Han Gao, Bing Mao, Fengyuan Xu, Sheng ZhongarXiv 2025 · DOI

Abstract

HDSim is a novel simulation framework that leverages Large Language Models (LLMs) to inject realistic, diverse human driving styles—such as aggressiveness, fatigue, or distraction—into background traffic. By subtly biasing a vehicle's perception rather than just its actions, HDSim uncovers up to 68% more safety-critical failures in autonomous driving (AD) systems compared to standard testing environments. This approach offers a scalable and interpretable solution for generating diverse human-like behaviors without the need for massive labeled datasets.

What Problem Does This Paper Address?

Testing self-driving cars in simulation is only as effective as the background traffic they encounter. Most current simulators rely on "robotic" agents that follow rigid rules or replay recorded logs, lacking the unpredictability and variety of real human drivers. These agents fail to represent drivers who might be aggressive, exhausted, or distracted.

Comparison of AD testing in idealized vs. realistic human-centric traffic.

Existing "data-driven" attempts to model human behavior often require vast amounts of labeled data for every specific style, which is difficult to scale and lacks interpretability. Furthermore, these models often result in homogeneous behavior where every agent acts identically. HDSim aims to create a simulator that is scalable, interpretable, and capable of generating diverse human-like behaviors.

Methods

The core innovation of HDSim lies in two primary components: a hierarchical driver style model and a perception-mediated behavior influence mechanism.

The HDSim framework architecture integrating LLMs for style modeling.

Hierarchical Driver Style Model

Inspired by cognitive science, HDSim organizes driving behavior into three "stackable" layers:

  • L1 (Personality): Persistent traits like aggressiveness or cautiousness.
  • L2 (Physiological): Temporary states like fatigue or intoxication.
  • L3 (Attentional): Transient fluctuations like sudden distractions.

Perception-Mediated Behavior Influence (PMBI)

Rather than forcing an agent to take a specific action, HDSim uses an LLM to manipulate the agent's subjective perception. For example, to simulate an aggressive driver, the LLM generates a script that modifies the agent's Bird’s Eye View (BEV) input, making the car in front appear further away than it actually is. The agent then naturally "speeds up" based on its own internal driving logic. This "illusion gap" allows for complex behaviors like tailgating while keeping the underlying driving logic intact.

The system utilizes a hybrid LLM setup, employing LLaMA 3.1 for low-latency validation and GPT-4o-mini for high-level reasoning and generating perception-modifying API scripts.

Key Results

HDSim was evaluated in the CARLA (Town05) simulation environment against state-of-the-art AD models like InterFuser and TFPP. Key findings include:

  • Enhanced Failure Detection: HDSim revealed significantly more weaknesses, uncovering up to 68% more safety-critical failures compared to standard "normal" traffic.
  • High Realism: Trajectories generated by HDSim were identified as the correct "style" with up to a 98.1% F1-score, outperforming baselines like ProSim.
  • Computational Efficiency: The framework scales to 70+ agents with minimal overhead because the LLM is used primarily to generate the "style policy" once, which is then executed via lightweight API calls.

Validation against the INTERACTION Dataset and NHTSA Accident Reports further confirmed that HDSim’s simulated styles and failure cases align with real-world human behavior and crash patterns.

Limitations and Future Work

Currently, HDSim relies on agents that process information in a Bird’s Eye View (BEV) format. Adapting this to raw camera-pixel or LiDAR-point-cloud perception remains a challenge. Additionally, the paper does not deeply explore complex multi-agent social negotiations, such as two aggressive drivers competing for the same space.

Future research directions include extending the framework to incorporate more granular cognitive factors and exploring how these stylized simulations can be used to train more robust autonomous models, moving beyond just testing.

Summary updated

BibTeX
@misc{li2025llm,
  author = {Wendi Li and Hao Wu and Han Gao and Bing Mao and Fengyuan Xu and Sheng Zhong},
  title = {{LLM-based Human-like Traffic Simulation for Self-driving Tests}},
  year = {2025},
  eprint = {2508.16962},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.16962},
}
Figure