SPformer: A Transformer Based DRL Decision Making Method for Connected Automated Vehicles

Han Ye, Lijun Zhang, Dejian Meng, Xingyu Hu, Yixia Lu · DOI

Abstract

In mixed autonomy traffic environment, every decision made by an autonomous-driving car may have a great impact on the transportation system. Because of the complex interaction between vehicles, it is challenging to make decisions that can ensure both high traffic efficiency and safety now and futher. Connected automated vehicles (CAVs) have great potential to improve the quality of decision-making in this continuous, highly dynamic and interactive environment because of their stronger sensing and communicating ability. For multi-vehicle collaborative decision-making algorithms based on deep reinforcement learning (DRL), we need to represent the interactions between vehicles to obtain interactive features. The representation in this aspect directly affects the learning efficiency and the quality of the learned policy. To this end, we propose a CAV decision-making architecture based on transformer and reinforcement learning algorithms. A learnable policy token is used as the learning medium of the multi-vehicle joint policy, the states of all vehicles in the area of interest can be adaptively noticed in order to extract interactive features among agents. We also design an intuitive physical positional encodings, the redundant location information of which optimizes the performance of the network. Simulations show that our model can make good use of all the state information of vehicles in traffic scenario, so as to obtain high-quality driving decisions that meet efficiency and safety objectives. The comparison shows that our method significantly improves existing DRL-based multi-vehicle cooperative decision-making algorithms.

Introduction

As we move toward a future of mixed-autonomy traffic, the challenge isn't just making one car drive safely—it's making a group of Connected Automated Vehicles (CAVs) work together. In environments like highway ramps, a single vehicle's decision can ripple through the entire system, causing congestion or accidents. Existing Deep Reinforcement Learning (DRL) methods often struggle to represent the complex, dynamic interactions between multiple vehicles. Convolutional Neural Networks (CNNs) are effective for image processing but do not naturally handle the varying number of agents or their long-range spatial relationships. Graph Neural Networks (GNNs) are better at modeling relationships but can be slow at disseminating information across long distances in a traffic network. SPformer aims to bridge this gap by applying the Transformer architecture to the world of multi-agent driving.

Methodology

The core of the proposed architecture is SPformer, a decision-making framework that treats the states of all vehicles in a scene as a sequence of tokens.

Overview of the SPformer framework, showing how vehicle states and positional encodings are processed through Transformer blocks to generate a joint policy.

Key innovations include:

  • Learnable Policy Token: Inspired by the [CLS] token in models like BERT, a "policy token" acts as a global aggregator, attending to the states of all vehicles in the area to produce a multi-vehicle joint driving policy.
  • Physical Positional Encoding (PPE): Standard Transformers use positional encodings for sequence order. In driving, physical distance is paramount. PPE encodes discretized coordinates of vehicles, ensuring the network is sensitive to exact spatial positioning.
  • Multi-Modal State Representation: Each vehicle's state combines its position, a Gaussian "velocity field" (representing speed and influence), and driving intention (e.g., exiting at a ramp).

The model is trained using a Multi-Agent Deep Q-Network (MADQN) approach, maximizing a global reward function that balances speed, safety, and successful navigation. By using the Transformer's self-attention mechanism, every vehicle can "notice" every other vehicle regardless of distance, allowing for more nuanced collaborative behaviors than local-sensing methods.

Experimental Setup

The method was evaluated using Flow, connecting Deep RL libraries with the SUMO (Simulation of Urban MObility) traffic simulator. The scenario involved a one-way, three-lane highway section (250m long) with an exit ramp. The agents consisted of a mix of 2 CAVs (controlled by SPformer) and 4 Human Driving Vehicles (HDVs, controlled by the Intelligent Driver Model).

Results

SPformer was compared against CNN-DQN and GNN-DQN baselines. The results demonstrate significant improvements across all metrics:

  • Efficiency: SPformer achieved an Average Traffic Score (ATS) of 18.142, significantly higher than GNN (13.265) and CNN (9.134).
  • Safety: SPformer reduced the average number of collisions per episode to 0.242, compared to 1.548 for GNN and nearly 3 for CNN.
  • Success Rate: The success rate for vehicles reaching their target ramp was 97.4% for SPformer, while the baselines hovered around 63%.
The training curve shows SPformer (green) reaching a stable, high traffic score much faster and more consistently than CNN or GNN methods.

Ablation studies showed that without Physical Positional Encoding (PPE), SPformer's performance dropped to levels similar to GNNs, highlighting that for spatial tasks like driving, "where" is just as important as "what."

Conclusion

SPformer introduces a robust Transformer-based framework for multi-vehicle coordination in mixed-autonomy traffic. While currently limited to simple on-ramp/off-ramp scenarios, it demonstrates the power of global attention and physical positional encodings in achieving high safety and efficiency. Future work will focus on scaling to large-scale urban grids and accounting for real-world constraints like communication delays and sensor noise.

Summary updated

BibTeX
@misc{ye2024spformer,
  author = {Han Ye and Lijun Zhang and Dejian Meng and Xingyu Hu and Yixia Lu},
  title = {{SPformer: A Transformer Based DRL Decision Making Method for Connected Automated Vehicles}},
  year = {2024},
  eprint = {2409.15105},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.15105},
}
Figure