Towards Reliable and Interpretable Traffic Crash Pattern Prediction and Safety Interventions Using Customized Large Language Models

Yang Zhao, Pu Wang, Yibo Zhao, Hongru Du, Hao Frank YangarXiv 2025 · OpenReview

Abstract

Predicting crash events is crucial for understanding crash distributions and their contributing factors, thereby enabling the design of proactive traffic safety policy interventions. However, existing methods struggle to interpret the complex interplay among various sources of traffic crash data, including numeric characteristics, textual reports, crash imagery, environmental conditions, and driver behavior records. As a result, they often fail to capture the rich semantic information and intricate interrelationships embedded in these diverse data sources, limiting their ability to identify critical crash risk factors. In this research, we propose TrafficSafe, a framework that adapts LLMs to reframe crash prediction and feature attribution as text-based reasoning. A multi-modal crash dataset including 58,903 real-world reports together with belonged infrastructure, environmental, driver, and vehicle information is collected and textualized into TrafficSafe Event Dataset. By customizing and fine-tuning LLMs on this dataset, the TrafficSafe LLM achieves a 42% average improvement in F1-score over baselines. To interpret these predictions and uncover contributing factors, we introduce TrafficSafe Attribution, a sentence-level feature attribution framework enabling conditional risk analysis. Findings show that alcohol-impaired driving is the leading factor in severe crashes, with aggressive and impairment-related behaviors having nearly twice the contribution for severe crashes compared to other driver behaviors. Furthermore, TrafficSafe Attribution highlights pivotal features during model training, guiding strategic crash data collection for iterative performance improvements. The proposed TrafficSafe offers a transformative leap in traffic safety research, providing a blueprint for translating advanced AI technologies into responsible, actionable, and life-saving outcomes.

Introduction

Traffic safety analysis has historically been bifurcated into macroscopic statistical trends and microscopic event-level predictions. While traditional machine learning models like Random Forests or XGBoost are common for microscopic tasks, they often struggle with the "heterogeneous" nature of crash data. A single crash report contains numeric speeds, categorical road types, textual police narratives, and even satellite imagery.

Traditional models often collapse this rich context into simplified embeddings, losing the semantic nuance that explains why a crash happened. Furthermore, these models are often "black boxes," making it difficult for policymakers to perform "what-if" analyses—such as determining how much a specific work zone configuration contributes to fatal outcomes compared to driver impairment. To address this, we propose TrafficSafe, a framework that reframes traffic crash prediction as a natural language reasoning task.

The TrafficSafe framework addresses rising crash risks by analyzing heterogeneous factors to provide actionable safety policy improvements.

Methodology

The TrafficSafe framework is built upon three primary pillars designed to integrate multi-modal data and provide interpretable results:

  1. TrafficSafe Event Dataset: We transformed raw data into a "story" for each crash. Using an "AI-expert cooperative" approach, GPT-4o was used to synthesize numeric data and satellite image descriptions into coherent textual prompts. The resulting dataset includes 58,903 real-world crash reports totaling 12.74 million words.
  2. TrafficSafe LLM: We fine-tuned Llama 3.1 (8B and 70B versions) using Low-Rank Adaptation (LoRA). Instead of standard text generation, specialized tokens (e.g., <FATAL>, <REAR-END>) were added to the model’s vocabulary, allowing it to act as a high-precision classifier that "reasons" through the text.
  3. TrafficSafe Attribution: To solve the interpretability problem, we adapted Shapley values to the sentence level. This allows the model to quantify the "contribution" of specific narrative elements (e.g., "The driver was operating recklessly") to the final risk prediction.
The TrafficSafe pipeline illustrates the transition from multi-modal crash data to LLM-based prediction and subsequent feature attribution for risk analysis.

Key Results and Insights

TrafficSafe achieves a 42% average improvement in F1-score over state-of-the-art baselines like XGBoost and CatBoost. Beyond raw performance, the framework offers several critical insights for traffic safety:

  • Crash Prediction as Linguistics: Traffic crashes are better understood as interconnected narratives. LLMs excel here because they capture the "interplay" between factors—like how rain affects a driver differently in a construction zone versus an open highway.
  • Non-Additive Risk: Research highlights that risk factors are synergistic. For example, combining a work zone with alcohol consumption spikes the risk level far beyond the sum of the two individual factors.
  • Interpretability for Policy: TrafficSafe Attribution successfully identified alcohol-impaired driving as the leading factor in severe crashes, with aggressive behaviors contributing nearly twice as much to severity as other driver errors.
  • Robust Generalization: Even when tested on unseen data from Maine or North Carolina, the model maintained high F1-scores (0.52–0.54), proving it learned universal safety patterns rather than state-specific quirks.

Discussion and Future Work

While TrafficSafe offers a significant advancement, computational costs for fine-tuning 70B parameter models remain high. Future work will explore moving toward "native" multi-modal foundation models that process imagery directly rather than through intermediate textualization. Additionally, we aim to implement "lifelong learning" strategies to improve performance in rare crash scenarios where data is currently sparse. Ultimately, TrafficSafe provides a blueprint for translating advanced AI into responsible, life-saving traffic safety interventions.

Summary updated

BibTeX
@misc{zhao2025towards,
  author = {Yang Zhao and Pu Wang and Yibo Zhao and Hongru Du and Hao Frank Yang},
  title = {{Towards Reliable and Interpretable Traffic Crash Pattern Prediction and Safety Interventions Using Customized Large Language Models}},
  year = {2025},
  eprint = {2505.12545},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.12545},
}
Figure