Traffic Signal Control Using Lightweight Transformers: An Offline-to-Online RL Approach

Xingshuai Huang, Di Wu, Benoit BouletarXiv 2023 · DOI

Introduction

Traffic Signal Control (TSC) is a fundamental optimization problem in urban planning, directly impacting fuel consumption, carbon emissions, and commuter stress. While Reinforcement Learning (RL) has emerged as a powerful tool for dynamic signal timing, its practical application is often hindered by two primary challenges: sample inefficiency and computational overhead. Traditional online RL agents require millions of interactions to learn effective policies, a process that would cause catastrophic gridlock if attempted in a real-world environment. Furthermore, high-performance models like Transformers are typically too resource-intensive for the low-power edge devices found in standard traffic cabinets.

To address these hurdles, researchers have developed DTLight, a lightweight framework that reframes traffic control as a sequence modeling problem. By leveraging the Decision Transformer (DT) architecture and an offline-to-online learning paradigm, DTLight achieves state-of-the-art performance while remaining efficient enough for on-device deployment and rapid adaptation.

Methodology: The DTLight Framework

DTLight operates through a three-stage pipeline designed to transition from large-scale offline learning to efficient online execution.

1. Offline Pre-training (The Teacher)

The process begins by training a large "Teacher" Decision Transformer on historical traffic datasets. Unlike standard RL, which predicts state-action values, the DT treats the task as a conditional sequence modeling problem. It predicts actions based on a sequence of states and a "Return-to-Go" (RTG) target, effectively learning to map specific traffic conditions and desired outcomes to optimal signal timings.

2. Knowledge Distillation (The Student)

To make the model suitable for edge deployment, the expertise of the large teacher model is transferred to a significantly smaller "Student" model via knowledge distillation. This process reduces the parameter count by over 90% (from 19.44M to 1.84M parameters) without sacrificing substantial performance, ensuring the model can run on constrained hardware.

3. Online Fine-tuning with Adapters

Real-world traffic patterns are dynamic and subject to shifts. DTLight incorporates COMPACTER++ adapter modules to handle this. Instead of retraining the entire Transformer—which is computationally prohibitive—only these tiny adapter layers are updated during online deployment. These modules utilize hypercomplex multiplication to represent weights efficiently, allowing the model to adapt its behavior by updating only 0.008% of its total parameters.

The DTLight architecture overview, illustrating the base model, the internal Transformer blocks, and the specific structure of the Adapter Module used for efficient fine-tuning.

Experimental Setup and Datasets

The authors introduced the DTRL (Datasets for Traffic Signal Control with Offline RL) benchmark to evaluate the framework. This benchmark includes 16 offline datasets across eight distinct scenarios:

  • Synthetic Intersections: 2-lane and 3-lane configurations with varying traffic densities.
  • Real-World Data: Scenarios based on actual traffic flows from Cologne and Ingolstadt, Germany.
  • Complex Networks: Multi-intersection environments including a 4x4 grid and the "Avenues" scenario.

Data was generated using two behavior policies: a rule-based Max Pressure controller (EMP) and a standard RL agent (IDQN), providing a diverse mix of expert and sub-expert trajectories for the model to learn from.

Key Results and Insights

DTLight demonstrates significant improvements over existing baselines in both efficiency and performance. The online fine-tuned version, DTLight-o, consistently outperformed state-of-the-art online RL methods such as MPLight and IPPO. In certain synthetic scenarios, DTLight achieved performance gains of up to 42.6% over the best online RL baselines.

Performance comparison showing average delay across different Evaluation RTG scale factors for DTLight-s (student) and DTLight-o (online fine-tuned) variants.

Key insights from the study include:

  • Temporal Dependencies: By treating traffic as a "language," the Transformer architecture captures long-term temporal dependencies (such as building queues) that traditional RL often overlooks.
  • Rapid Adaptation: The adapter-based fine-tuning takes approximately 35 seconds on a standard GPU. This speed allows for near-instantaneous adaptation to changing road conditions, a feat impossible for traditional RL agents that require hours of retraining.
  • Exploration via Stochasticity: Unlike the original deterministic Decision Transformer, DTLight employs a stochastic policy. This is vital for the online phase, as it enables the agent to explore subtle variations in timing to find local optimizations in real-time.

Conclusion and Future Work

DTLight represents a significant step toward practical, AI-driven traffic management. By combining the sequence-modeling strengths of Transformers with the safety of offline pre-training and the efficiency of adapter-based fine-tuning, it overcomes the primary barriers to real-world RL deployment. While the current decentralized approach excels in many scenarios, future research will focus on enhancing explicit multi-agent coordination to better manage complex, non-grid urban layouts and high-density traffic flows.

Summary updated

BibTeX
@misc{huang2023traffic,
  author = {Xingshuai Huang and Di Wu and Benoit Boulet},
  title = {{Traffic Signal Control Using Lightweight Transformers: An Offline-to-Online RL Approach}},
  year = {2023},
  eprint = {2312.07795},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.07795},
}
Figure