Skip to main content
QUICK REVIEW

[Paper Review] Spatial-Temporal Large Language Model for Traffic Prediction

Chenxi Liu, Sun Yang|arXiv (Cornell University)|Jan 18, 2024
Traffic Prediction and Management TechniquesEngineering10 citations
TL;DR

ST-LLM defines location timesteps as tokens, applies spatial-temporal embeddings, and uses a partially frozen attention LLM to predict traffic, achieving strong performance in regular, few-shot, and zero-shot scenarios.

ABSTRACT

Traffic prediction, an essential component for intelligent transportation systems, endeavours to use historical data to foresee future traffic features at specific locations. Although existing traffic prediction models often emphasize developing complex neural network structures, their accuracy has not improved. Recently, large language models have shown outstanding capabilities in time series analysis. Differing from existing models, LLMs progress mainly through parameter expansion and extensive pretraining while maintaining their fundamental structures. Motivated by these developments, we propose a Spatial-Temporal Large Language Model (ST-LLM) for traffic prediction. In the ST-LLM, we define timesteps at each location as tokens and design a spatial-temporal embedding to learn the spatial location and global temporal patterns of these tokens. Additionally, we integrate these embeddings by a fusion convolution to each token for a unified spatial-temporal representation. Furthermore, we innovate a partially frozen attention strategy to adapt the LLM to capture global spatial-temporal dependencies for traffic prediction. Comprehensive experiments on real traffic datasets offer evidence that ST-LLM is a powerful spatial-temporal learner that outperforms state-of-the-art models. Notably, the ST-LLM also exhibits robust performance in both few-shot and zero-shot prediction scenarios. The code is publicly available at https://github.com/ChenxiLiu-HNU/ST-LLM.

Motivation & Objective

  • Motivate improved traffic prediction by leveraging large language models to capture global spatial-temporal dependencies.
  • Introduce a spatial-temporal embedding and tokenization scheme that reformulates timesteps at each location as tokens.
  • Develop a partially frozen attention (PFA) strategy to adapt LLMs to traffic data while retaining pre-trained knowledge.
  • Demonstrate ST-LLM's superior accuracy over state-of-the-art models and its robustness in few-shot and zero-shot scenarios.

Proposed method

  • Define traffic data as a tensor X in R^{T x N x C}.
  • Encode P historical timesteps into token embeddings via a spatial-temporal embedding layer (PConv-based token embedding, hour/day/week positional encodings, adaptive spatial embedding).
  • Fuse embeddings with a fusion convolution to form E_F in R^{N x 3D}.
  • Process embeddings with a partially frozen attention LLM where the first F layers are frozen and the last U multi-head attention layers are unfrozen, producing H^L in R^{N x 3D}.
  • Use a regression convolution to predict the next S timesteps: Ŷ_S = RConv(H^{F+U}).
  • Train with a loss L = ||Ŷ_S - Y_S|| + λ L_reg.

Experimental results

Research questions

  • RQ1Can ST-LLM effectively model spatial-temporal dependencies in traffic data by treating location-time as tokens?
  • RQ2Does partially freezing attention layers improve LLM adaptation to traffic forecasting compared to fully frozen or fully tunable setups?
  • RQ3How does ST-LLM perform in few-shot and zero-shot transfer across different traffic datasets?
  • RQ4What is the impact of spatial-temporal embeddings and their fusion on predictive accuracy?
  • RQ5How does ST-LLM compare to state-of-the-art GNN/attention-based models on real-world datasets?

Key findings

  • ST-LLM outperforms state-of-the-art models across multiple traffic prediction scenarios on NYC taxi and CHBike datasets.
  • ST-LLM achieves lower MAE/MAPE/RMSE/WAPE than baselines including DCRNN, STGCN, ASTGCN, GMAN, GATGPT, GCNGPT, and LLAMA2.
  • Partially frozen attention (PFA) yields superior performance over frozen, fully tuned, and other baselines.
  • ST-LLM demonstrates robustness in few-shot and zero-shot prediction, showing strong cross-domain transfer capabilities.
  • Ablation studies show significant performance drops when removing the LLM or the spatial-temporal embeddings, underscoring their importance.
  • Inference-time analysis indicates ST-LLM provides favorable speed versus accuracy balance compared to several LLM baselines.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.