๐Ÿšฆ LLM-Assisted Light (LA-Light)

July 10, 2025 ยท View on GitHub

arXiv License Python 3.10+ Version

Official implementation of LLM-Assisted Light: Augmenting Traffic Signal Control with Large Language Model in Complex Urban Scenarios.

๐Ÿ“ข Latest News

  • [July 2025] Introducing VLMLight: Our next-generation framework featuring image-based traffic signal control using Vision-Language Models (VLMs) for enhanced scene understanding and real-time decision-making.
  • [August 2023] We have migrated the simulation platform used in this project from Aiolos to TransSimHub (TSHub). We would like to express our sincere gratitude to our colleagues at SenseTime, @KanYuheng (้˜šๅฎ‡่กก), @MaZian (้ฉฌๅญๅฎ‰), and @XuChengcheng (ๅพๆ‰ฟๆˆ) (in alphabetical order) for their valuable contributions. The development of TransSimHub (TSHub) is a continuation of the work done on Aiolos.

๐Ÿงฉ Core Framework

Five-stage hybrid decision-making for human-AI collaborative traffic control:

  1. Task Planning: LLM defines traffic management role
  2. Tool Selection: Dynamically invokes perception & decision tools
  3. Environment Interaction: Real-time traffic data collection
  4. Data Analysis: Decision unit generates control strategies
  5. Execution Feedback: Implements decisions with explainable justifications

๐Ÿงช Quick Validation

๐Ÿ› ๏ธ Installation

Install TransSimHub:

git clone https://github.com/Traffic-Alpha/TransSimHub.git
cd TransSimHub
pip install -e ".[all]"

๐Ÿค– RL Model Training & Evaluation

For training and evaluating the RL model, refer to TSCRL. You can use the following command to start training:

python train_rl_agent.py

The RL Result directory contains the trained models and training results. Use the following command to evaluate the performance of the model:

python eval_rl_agent.py

๐Ÿง  Pure LLM Inference

To directly use LLM for inference without invoking any tools, run the following script:

python llm.py --env_name '3way' --phase_num 3 --detector_break 'E0--s'

๐Ÿ”€ LA-Light Joint Decision-Making

To test LA-Light, run the following script. In this case, we will randomly generate congestion on E1 and the sensor on the E2--s direction will fail.

python llm_rl.py --env_name '4way' --phase_num 4 --edge_block 'E1' --detector_break 'E2--s'

The effect of running the above test is shown in the following video. Each decision made by LA-Light involves multiple tool invocations and subsequent decisions based on the tool's return results, culminating in a final decision and explanation.

LLM_for_TSC_README.webm

Due to the video length limit, we only captured part of the first decision-making process, including:

  • Action 1: Obtaining the intersection layout, the number of lanes, and lane functions (turn left, go straight, or turn right) for each edge.
  • Action 3: Obtaining the occupancy of each edge. The -E3 straight line has a higher occupancy rate, corresponding to the simulation. At this point, LA-Light can use tools to obtain real-time road network information.
  • Final Decision and Explanation: Based on a series of results, LA-Light provides the final decision and explanation.

๐ŸŽฅ Scenario Demos

Scenario_1

Examples of LA-Lights Utilizing Tools to Control Traffic Signals (Normal Scenario)

Scenario_2

Examples of LA-Lights Utilizing Tools to Control Traffic Signals (Emergency Vehicle (EMV) Scenario)

๐Ÿ“œ Citation

If you find this work useful, please cite our papers:

@article{wang2024llm,
  title={LLM-Assisted Light: Leveraging Large Language Model Capabilities for Human-Mimetic Traffic Signal Control in Complex Urban Environments},
  author={Wang, Maonan and Pang, Aoyu and Kan, Yuheng and Pun, Man-On and Chen, Chung Shue and Huang, Bo},
  journal={arXiv preprint arXiv:2403.08337},
  year={2024}
}

๐Ÿค Open-Source Foundations

This project stands on the shoulders of these open-source giants:

๐Ÿ“ฎ Contact

If you have any questions, please report issues on GitHub.