TrafficGPT: Towards Multi-Scale Traffic Analysis and Generation with Spatial-Temporal Agent Framework

Jinhui Ouyang, Yijie Zhu, Xiang Yuan, Di Wu

TL;DR

TrafficGPT is a novel multi-agent framework that bridges the gap between complex spatial-temporal traffic models and human users. By combining Large Language Models (LLMs) with a specialized "Dynamic Fusion Multi-scale Transformer," it allows users to interact with traffic data through natural language to get short-term, long-term, and even "unseen" road traffic predictions alongside actionable visualizations.

What Problem Does This Paper Address?

Traffic forecasting is essential for urban planning and daily commuting, but it faces three major hurdles:

  1. Complexity and Accessibility: Most state-of-the-art models are "black boxes." They require deep technical expertise to operate and interpret, making them inaccessible to the average road administrator or commuter.
  2. Data Scarcity for New Roads: Deep learning models typically rely on years of historical data. When a new road is built (an "unseen" road), these models often fail because they have no history to learn from.
  3. Multi-Scale Dependencies: Traffic isn't just about what happened five minutes ago; it’s influenced by daily cycles, weekly patterns, and the physical structure of the road network. Existing models often struggle to balance these different temporal scales effectively.

Methods

The authors propose TrafficGPT, a system composed of three specialized AI agents:

  • Text-to-Demand Agent: This uses an LLM (like GPT-3 or GPT-4) as a sophisticated interface. It takes natural language prompts (e.g., "Tell me about the traffic on Road 53 in ten minutes") and extracts structured tasks for the prediction engine.
  • Traffic Prediction Agent: This is the "brain" of the system, featuring a novel Dynamic Fusion Multi-scale Transformer (DMFT).
  • It uses Multi-Graph Convolutions to understand road connectivity (physical layout) and correlation (how distant roads might behave similarly).
  • It employs a Co-semantic Extraction method for unseen roads, mapping the spatial features of a new road to similar existing roads to estimate traffic without historical data.
  • Suggestion and Visualization Agent: This agent translates raw numbers into human-centric outputs, such as heat maps, optimal route planning (using Dijkstra’s algorithm), and congestion alerts.

Datasets

The framework was rigorously tested on five real-world datasets:

  • Aliyun: Travel time data from Guizhou, China.
  • PeMS-bay, PeMS04, and PeMS08: Traffic speed and flow data from California’s Performance Measurement System.
  • TAXIBJ: A large-scale taxi flow dataset from Beijing, used specifically to test the system's scalability and its ability to estimate traffic on "unseen" road segments.

Key Insights and Ideas

  • LLMs as Orchestrators, Not Calculators: The paper smartly uses LLMs for what they do best—parsing intent and providing feedback—while leaving the heavy numerical "spatial-temporal" lifting to a specialized transformer model.
  • Semantic Road Similarity: A key "aha moment" is the realization that roads with similar "semantic" structures (e.g., similar upstream/downstream connections and distances) exhibit similar traffic patterns. This allows the model to perform "zero-shot" style estimation for new roads by borrowing knowledge from "look-alike" roads in the network.
  • Balancing Trends and Cycles: The DMFT model doesn't just look at a linear sequence; it treats recent trends, daily periodicity, and weekly periodicity as distinct features that are dynamically fused, leading to more stable long-term predictions.

Key Results

  • SOTA Performance: TrafficGPT achieved state-of-the-art or highly competitive results across all datasets. For instance, on the Aliyun dataset, it maintained high accuracy even as the prediction horizon increased.
  • Scalability: In tests on the TAXIBJ dataset (over 1,000 nodes), the system demonstrated near-linear growth in training time, proving it can handle city-scale traffic networks.
  • Unseen Road Success: The co-semantic model proved remarkably effective. With as little as 10% to 20% of existing node data for fine-tuning, TrafficGPT could predict traffic on new road segments with precision comparable to models trained on full historical data.

Limitations and Future Work

While TrafficGPT is a significant step forward, the authors note a few areas for growth:

  • Interaction Depth: Future work will look into "more dimensional interactions," likely allowing for more complex reasoning or multi-turn dialogues about traffic strategy.
  • Algorithmic Integration: The current suggestion agent relies on standard algorithms like Dijkstra for pathfinding; future iterations might integrate more advanced generative reasoning to provide even more nuanced travel advice.
  • Refining Unseen Estimation: While the co-semantic mapping is strong, further refining how the model handles radical changes in urban structure (like a major new highway) remains a challenge.

Summary updated

Abstract

The precise prediction of multi-scale traffic is a ubiquitous challenge in the urbanization process for car owners, road administrators, and governments. In the case of complex road networks, current and past traffic information from both upstream and downstream roads are crucial since various road networks have different semantic information about traffic. Rationalizing the utilization of semantic information can realize short-term, long-term, and unseen road traffic prediction. As the demands of multi-scale traffic analysis increase, on-demand interactions and visualizations are expected to be available for transportation participants. We have designed a multi-scale traffic generation system, namely TrafficGPT, using three AI agents to process multi-scale traffic data, conduct multi-scale traffic analysis, and present multi-scale visualization results. TrafficGPT consists of three essential AI agents: 1) a text-to-demand agent that is employed with Question & Answer AI to interact with users and extract prediction tasks through texts; 2) a traffic prediction agent that leverages multi-scale traffic data to generate temporal features and similarity, and fuse them with limited spatial features and similarity, to achieve accurate prediction of three tasks; and 3) a suggestion and visualization agent that uses the prediction results to generate suggestions and visualizations, providing users with a comprehensive understanding of traffic conditions. Our TrafficGPT system focuses on addressing concerns about traffic prediction from transportation participants, and conducted extensive experiments on five real-world road datasets to demonstrate its superior predictive and interactive performance
BibTeX
@misc{ouyang2024trafficgpt,
  author = {Jinhui Ouyang and Yijie Zhu and Xiang Yuan and Di Wu},
  title = {{TrafficGPT: Towards Multi-Scale Traffic Analysis and Generation with Spatial-Temporal Agent Framework}},
  year = {2024},
  eprint = {2405.05985},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.05985},
}
Figure