Towards Explainable Traffic Flow Prediction with Large Language Models

Xusen Guo,Qiming Zhang,Junyue Jiang,Mingxing Peng,Meixin Zhu,Yang
2024-09-03
Abstract:Traffic forecasting is crucial for intelligent transportation systems. It has experienced significant advancements thanks to the power of deep learning in capturing latent patterns of traffic data. However, recent deep-learning architectures require intricate model designs and lack an intuitive understanding of the mapping from input data to predicted results. Achieving both accuracy and explainability in traffic prediction models remains a challenge due to the complexity of traffic data and the inherent opacity of deep learning models. To tackle these challenges, we propose a Traffic flow Prediction model based on Large Language Models (LLMs) to generate explainable traffic predictions, named xTP-LLM. By transferring multi-modal traffic data into natural language descriptions, xTP-LLM captures complex time-series patterns and external factors from comprehensive traffic data. The LLM framework is fine-tuned using language-based instructions to align with spatial-temporal traffic flow data. Empirically, xTP-LLM shows competitive accuracy compared with deep learning baselines, while providing an intuitive and reliable explanation for predictions. This paper contributes to advancing explainable traffic prediction models and lays a foundation for future exploration of LLM applications in transportation. To the best of our knowledge, this is the first study to use LLM for explainable prediction of traffic flows.
Machine Learning,Artificial Intelligence
What problem does this paper attempt to address?
The paper attempts to address two main issues in traffic flow prediction: 1. **Balancing Accuracy and Interpretability**: Existing deep learning models, while excellent at capturing underlying patterns in traffic data, often require complex model designs and lack intuitive understanding of the mapping from input data to prediction results. Therefore, how to improve the interpretability of the model while ensuring prediction accuracy is a challenge. 2. **Handling Complex Traffic Data**: Traffic data has spatiotemporal complexity and dynamic changes, including the influence of external factors such as weather and holidays. Existing methods face difficulties in handling these multimodal data, making it hard to comprehensively capture and utilize this information. To address these issues, the authors propose a traffic flow prediction framework based on large language models (LLMs) — xTP-LLM. This framework converts multimodal traffic data into natural language descriptions, leveraging LLMs to capture complex time series patterns and external factors, thereby generating interpretable traffic prediction results. Specifically, xTP-LLM achieves this through the following methods: - **Structured Text Prompts**: Converting multimodal traffic data (such as historical flow, weather, date, holidays, etc.) into structured text prompts, enabling LLMs to better understand and capture traffic patterns. - **Fine-Tuning Techniques**: Using supervised fine-tuning techniques to fine-tune pre-trained LLMs, improving their performance on specific tasks. Particularly, using LoRA technology to efficiently adapt to new tasks through low-rank updates. - **Generating Explanations**: By including explanation requirements in the input prompts, the model can not only generate prediction results but also provide corresponding explanations, enhancing the model's interpretability. In summary, this paper aims to improve the accuracy and interpretability of traffic flow prediction by leveraging the advantages of large language models, providing strong support for the management and planning of intelligent transportation systems.