Efficient Prompt Learning for Traffic Forecasting

Qianru Zhang, Xinyi Gao, Alexander Zhou, Reynold Cheng, Siu-Ming Yiu, Hongzhi YinarXiv 2026

TL;DR

SimpleST is a lightweight, model-agnostic prompt-tuning framework that allows pre-trained spatio-temporal graph neural networks (GNNs) to seamlessly adapt to unexpected traffic distribution shifts. By keeping the core model frozen and tuning less than 2% of the parameters via a novel "residual data editor," SimpleST improves forecasting accuracy by 3–6% while delivering up to a 46× speedup over traditional fine-tuning methods.

What Problem Does This Paper Address?

Spatio-temporal Graph Neural Networks (ST-GNNs) are the gold standard for traffic forecasting, helping cities optimize routing, allocate resources, and manage congestion. However, real-world urban environments are notoriously non-stationary. Traffic patterns shift constantly due to changing population behaviors, seasonal variations, holidays, or sensor malfunctions—phenomena known as spatio-temporal distribution shifts.

When a well-trained ST-GNN encounters these out-of-distribution (OOD) shifts, its performance typically degrades. Traditional solutions rely on full model fine-tuning or complex data-adaptive modules. Unfortunately, updating millions of parameters is computationally expensive, slow, and prone to overfitting when data is scarce. This makes rapid, real-time adaptation on resource-constrained edge devices (like traffic management sensors or micro-controllers) virtually impossible.

Fig. 1: Data distribution shift in the training and test set of PeMS-Bay. PT denotes the prompt tuning method. Red over- lay marks the diverging traffic patterns at Node 105 across datasets. The close alignment between our predictions (solid line) and ground truth (with the green color) validates the model’s generalization capability. As shown in red, Node 105 exhibits significant traffic pattern shifts from training to test conditions. Our approach maintains prediction pre- cision despite these distributional changes, outperforming the method without the prompt network, which verifies the effectiveness of the prompt network on capturing the data distribution shift from the train dataset to the test dataset.

Methods

To bridge the gap between heavy GNN architectures and the need for nimble adaptation, the authors introduce SimpleST, a model-agnostic prompt learning paradigm.

Instead of modifying the internal weights of a pre-trained ST-GNN backbone, SimpleST leaves the backbone completely frozen. It introduces a lightweight Temporal Prompt Network positioned right before the backbone. This prompt network acts as a residual data editor: it learns to capture the contextual and distributional shifts in the new data and applies a minimal correction ($\tilde{X} = X + UZ$) to the input space.

The framework operates in three distinct phases:

  1. Pre-training Phase: The base ST-GNN is trained normally on historical source data to master general spatial and temporal dependencies.
  2. Adaptation Phase: When deployed to a new domain or time period, the ST-GNN is frozen. Only the tiny prompt network is optimized using a small amount of local target data.
  3. Prediction Phase: The prompt network adjusts incoming streaming data on the fly, projecting it into a representation space that the frozen GNN already understands.

The prompt network itself is elegantly simple, consisting of a 2-layer Temporal Convolutional Network (TCN) to capture local temporal drifts and a 2-layer Multi-Layer Perceptron (MLP) for non-linear feature mapping.

Fig. 3: SimpleST system architecture overview. The proposed framework consists of four main components: (1) Input spatio-temporal traffic data, (2) A lightweight prompt network that adapts the input data through learnable transformations, (3) A frozen pre-trained GNNs backbone that processes the adapted data, and (4) Final traffic predictions. The system operates in three phases: pre-training the GNNs on source data firstly, then adapting only the prompt network parameters to new domains while keeping the GNNs frozen, and inference on target data.

Datasets

The authors rigorously evaluated SimpleST across five real-world, open-source highway traffic benchmarks from California:

  • PeMSD03, PeMSD04, PeMSD07, PeMSD08: Standard traffic flow and speed datasets collected at 5-minute intervals.
  • PeMS-Bay: A large-scale traffic speed dataset spanning a broader time range to simulate severe distribution shifts.

To test extreme generalization, they also conducted a cross-city transfer study using a Tokyo Metro dataset (characterized by dense, irregular transit patterns vastly different from California highways) and event-driven traffic surges simulated via the SUMO (Simulation of Urban MObility) environment in the Shibuya district.

Key Insights and Ideas

  • Prompting as a Data Projector: Rather than changing the model to fit the data, SimpleST changes the data to fit the model. It mathematically projects OOD traffic patterns back into the pre-trained model's comfort zone.
  • Graph-Size Independence: Crucially, the prompt network's computational complexity depends entirely on the temporal dimension and hidden feature size—not the number of nodes or edges in the urban graph. This gives it vertical scalability that traditional GNN fine-tuning lacks.
  • Constrained Solution Space: By restricting optimization to less than 2% of total parameters, the model avoids "catastrophic forgetting" of its pre-trained knowledge and converges significantly faster during training.

Key Results

SimpleST was plugged into four state-of-the-art ST-GNN backbones (ASTGNN, AGCRN, MTGNN, and STG-NCDE) and compared against standard fine-tuning and specialized OOD frameworks (like CauSTG and IRM).

  • Accuracy Gains: SimpleST consistently achieved the lowest Mean Absolute Error (MAE) across all datasets, yielding an average accuracy improvement of 3–6%.
  • Massive Speedups: The adaptation phase was 2× to 46× faster than full fine-tuning. For example, on the complex STG-NCDE backbone, training time plummeted from hundreds of minutes to just a fraction of that.
  • Ultra-Low Footprint: The prompt network introduces a mere 8.2 KB memory overhead. This tiny footprint enables real-time, on-device inference on low-power hardware like a Raspberry Pi.
  • Cross-City Robustness: In the California-to-Tokyo transfer test, SimpleST outperformed traditional fine-tuning by delivering up to 4.8% lower MAE and an immediate 3.5× reduction in adaptation time.

Limitations and Future Work

While the 2-layer TCN and 2-layer MLP architecture proved to be a "sweet spot" for efficiency and expressiveness, the authors note that this configuration was hand-designed. For highly volatile or entirely unique spatial environments, a manual design might not be optimal.

As a next step, the authors propose exploring an automated, systematic prompt architecture search (using differentiable or reinforcement learning techniques) to dynamically tailor the prompt network's structure to specific city layouts without human intervention.

Summary updated

BibTeX
@misc{zhang2026efficient,
  author = {Qianru Zhang and Xinyi Gao and Alexander Zhou and Reynold Cheng and Siu-Ming Yiu and Hongzhi Yin},
  title = {{Efficient Prompt Learning for Traffic Forecasting}},
  year = {2026},
  eprint = {2605.08273},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.08273},
}
Figure