Chat2SPaT: A Large Language Model Based Tool for Automating Traffic Signal Control Plan Management

Yue Wang, Miao Zhou, Guijing Huang, Rui Zhuo, Chao Yi, Zhenliang MaarXiv 2025 · DOI

Introduction

Managing urban traffic flow relies heavily on "fixed-time" signal control plans due to their reliability and cost-effectiveness. However, the manual configuration of Signal Phase and Timing (SPaT) parameters is a labor-intensive process, requiring traffic engineers to input complex data for various time-of-day scenarios into specialized software. Chat2SPaT introduces a novel approach by leveraging Large Language Models (LLMs) to automate this process through natural language interaction, achieving over 94% accuracy in converting human descriptions into executable signal plans.

The Challenge of Manual Signal Management

Traditional signal plan management is a manual nightmare. Engineers must navigate domain-specific logic to map movements at an intersection to specific phases. While LLMs like ChatGPT excel at language processing, they often struggle with the precise mathematical reasoning and safety constraints required for traffic engineering. A purely LLM-based approach frequently results in "hallucinations," such as generating conflicting green lights that would be physically dangerous in a real-world setting.

Standard intersection layout with movement and phase labeling (e.g., SBL, SBT, SBR).

Methodology: A Hybrid LLM-Script Approach

To bridge the gap between linguistic flexibility and engineering precision, Chat2SPaT employs a two-step iterative workflow that separates semantic reasoning from numerical calculation:

  1. Semantic Extraction: The system uses an LLM to parse user descriptions (e.g., "Give me a 4-stage plan with a 120s cycle") into a structured JSON object. This object captures high-level intent, such as phase sequences and specific attributes like permissive left turns.
  2. Plan Assembly: A suite of Python scripts performs the technical "heavy lifting." These scripts handle data cleansing, derive exact timing splits using standard formulas, and automatically merge adjacent stages to ensure continuous green lights. Crucially, a safety validation step checks the final plan against a conflict matrix to prevent simultaneous green lights for intersecting paths.
Comparison of different signal control styles supported by Chat2SPaT: (a) Ring, (b) Stage, (c) Ring-in-stage, and (d) Stage-in-ring.

This hybrid architecture allows users to refine plans iteratively. For example, an engineer can simply chat, "Increase the green time for the northbound left turn by 5 seconds," and the system will re-calculate the entire timing sequence while maintaining safety constraints.

Key Results and Insights

The system was evaluated using the new Chat2SPaT Dataset, which contains 306 plan descriptions in both English and Chinese. Key findings include:

  • High Accuracy: Using ChatGPT-4o, the system achieved an overall accuracy of 91.83%. When matched with native languages (e.g., Qwen for Chinese), accuracy rose to 94.55%.
  • Functional Separation: The most critical insight was restricting the LLM to semantic parsing. By offloading math to rule-based scripts, the researchers bypassed common LLM errors in deriving redundant mathematical results.
  • Versatility: The tool successfully automated complex scenarios, including two-stage pedestrian crossings and exclusive pedestrian "scramble" phases, which are traditionally difficult to configure.

Limitations and Future Work

While highly effective for standard four-legged intersections, current limitations include the need for more complex movement mapping for irregular geometries. Additionally, the tool currently focuses on fixed-time plans and does not yet support parameters for sensor-based "actuated" controls. Future development aims to integrate Chat2SPaT directly into industry-standard simulation software like VISSIM and expand support for multi-modal transport, including transit-priority buses and bicycles.

Source code and datasets are available at https://github.com/yuewangits/Chat2SPaT.

Summary updated

BibTeX
@misc{wang2025chat,
  author = {Yue Wang and Miao Zhou and Guijing Huang and Rui Zhuo and Chao Yi and Zhenliang Ma},
  title = {{Chat2SPaT: A Large Language Model Based Tool for Automating Traffic Signal Control Plan Management}},
  year = {2025},
  eprint = {2507.05283},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.05283},
}
Figure