Manuscript Offprint

arXiv:2610.25140

Spectral Adaptive Graph Transformer for Efficient and Scalable Traffic Forecasting

Amirhossein Ghaffari, Susanna Pirttikangas, Ekaterina Gilman

Amirhossein Ghaffari, Member, IEEE, Susanna Pirttikangas, Senior Member, IEEE, and Ekaterina Gilman, Member, IEEE

Abstract—Traffic forecasting models based on spectral graph convolution offer an interpretable account of how information is mixed between sensors, but they rely on an eigendecomposition of the graph Laplacian. It costs cubic time, is fixed by the road network, and provides a symmetric operator that cannot represent the directed propagation of traffic congestion. Attention-based spatio-temporal transformers remove these limitations but generate a dense sensor-by-sensor attention map at each layer and time step, so memory, rather than accuracy, becomes the binding constraint on large networks. We introduce the spectral adaptive graph transformer, whose spatial operator is learned rather than derived from the Laplacian, directed rather than symmetric, and conditioned on the current traffic state rather than a static state, at a cost linear in the number of sensors. A sparse road graph diffusion branch provides the strictly local propagation that a low-rank operator cannot express, and a zero-initialized gate learns the balance between the two. Before spatial mixing, a unit-mean-gain frequency-bin attention module reweights each sensor's short-term periodicities according to its identity and current context. Across six public benchmarks spanning 170 to 1843 sensors, evaluated over three random seeds, the proposed model attains the lowest error of any single end-to-end model on one benchmark and remains competitive with the strongest current attention models on the others, while using about a quarter of their memory and training about twice as fast.

Index Terms—artificial intelligence, data-based approaches (learning, deep learning, reinforcement learning), graph neural networks, road transportation, spatio-temporal forecasting, traffic networks.

I. INTRODUCTION

TRAFFIC forecasting underpins congestion management, adaptive signal control, and route guidance. The problem is difficult because the signal is jointly structured in time and space: a reading evolves according to its own history, the conditions propagating along the road network, and strong daily and weekly periodicity. Over the past decade, the field has converged on two broad architectural strategies, each of which trades one difficulty for another.

The first approach models spatial dependence with graph convolution. Building on spectral graph theory [1]–[3], methods such as DCRNN [4], STGCN [5] and Graph WaveNet [6] propagate information along a predefined or learned adjacency. StemGNN [7] takes the spectral view furthest, performing inter-series mixing entirely in the graph-Fourier domain. This is appealing; filtering in the spectral domain has a clean interpretation as selectively attenuating spatial modes, but it inherits three constraints of the classical construction. The graph-Fourier basis is the eigenbasis of the Laplacian, so obtaining it costs O(N3)\mathcal{O}(N^{3}) for N sensors; the basis is fixed by the graph and cannot adapt to the data; and because an orthogonal basis is applied symmetrically, the resulting operator is symmetric and cannot represent directed influence, even though congestion demonstrably propagates upstream-to-downstream along one-way roads.

The second strategy replaces the graph operator with attention. Following the Transformer [8], models such as GMAN [9], PDFformer [10], STAEformer [11], and TES-TAM [12] enable every sensor to attend to every other sensor, learning the interaction structure directly from data. STAEformer showed that a vanilla Transformer, paired with a learned spatio-temporal adaptive embedding, is sufficient to achieve state-of-the-art accuracy, indicating that much of the benefit comes from flexible representation rather than elaborate graph machinery [11]. The cost, however, is quadratic: an N×NN \times N attention map is materialized at every layer and time step. On the benchmarks that dominate the literature, typically 200 to 900 sensors, this is tolerable. On networks approaching a few thousand sensors, it becomes the binding constraint, and accuracy ceases to be the quantity that determines whether a model can be used at all.

This tension motivates our work. We investigate whether the interpretability and structure of spectral mixing can be retained while removing both the eigendecomposition of the spectral approach and the quadratic cost of the attention approach. We propose the Spectral Adaptive Graph Transformer (SAGT) model as a solution. Comparing the proposed model with the classical spectral form makes three clear distinctions: 1) the fixed eigenbasis becomes a learned, truncated basis, thereby removing the eigendecomposition; 2) the static filter becomes input-conditioned; and 3) the symmetric sandwich becomes a directed pair, allowing upstream and downstream influences to differ. As the operator is never materialized, the computation passes through a lower-dimensional bottleneck; therefore, its cost is linear rather than quadratic in the number of nodes.

Two further observations shaped the design of SAGT. First, low-rank global mixing cannot, by construction, express strictly local propagation along an individual road segment. Therefore, we pair it with an inexpensive sparse diffusion branch on the road graph and let a zero-initialized gate learn

This work was supported by the Emerging Projects program, Infotech Oulu; the CO2CREATION Strategic Research Council project (grant 372355), by the EC through the HEU NEUROCLIMA project (GA 101137711) and the HEU ARGENTIC project (GA 101298599), the Interreg Aurora ResilientEdge project (Grant Number: 20373282), the ERDF (project numbers A81568, A91867), and by the Finnish Innovation Fund Sitra through the Physical-AI project (agreement 640102).

Amirhossein Ghaffari, Susanna Pirttikangas and Ekaterina Gilman are with the Future Computing Group, University of Oulu, 90570 Oulu, Finland (e-mail: amirhossein.ghaffari@oulu.fi, susanna.pirttikangas@oulu.fi, ekaterina.gilman@oulu.fi).

how much of each to use. Second, sensors differ in how informative their within-window variation is: e.g., on a busy corridor, the movement over the last hour is largely signal, whereas on a lightly traveled ramp, much of it is measurement noise. We therefore introduce a per-sensor attention mechanism over the discrete Fourier bins of the input window that amplifies or suppresses individual oscillation rates before any spatial mixing occurs. Longer rhythms, such as the daily and weekly cycles, are outside this window and are carried by the calendar embeddings instead. Unlike frequency-domain forecasters such as FEDformer [13] and Autoformer [14], which operate on the series as a whole, the proposed mechanism is conditioned jointly on sensor identity and current context, and its attention weights are directly inspectable.

Our contributions are as follows:

• We introduce a spatial operator that is simultaneously learned (requiring no eigendecomposition), directed (asymmetric, with sign-unconstrained filter coefficients), and input-conditioned (recomputed per time step), at a cost linear in the number of nodes rather than quadratic.

• We propose unit-mean gain frequency-bin attention, a per-sensor reweighting of the input window’s discrete Fourier bins. We argue that applying the softmax weights directly is a poor parameterization rather than a poor design: at initialization, it attenuates the reconstructed measurement channel by a factor equal to the number of bins relative to the other components of the token, so the mechanism must first undo its own attenuation before it can help. Rescaling so that uniform attention is the exact identity removes the problem.

• We evaluate eight baselines and one composite method across six datasets, spanning 170 to 1843 sensors, using a single shared data pipeline, and report every entry as the mean and standard deviation over three seeds. Relative to the dense-attention models that define the accuracy frontier on these benchmarks, SAGT is the most accurate on PEMS08 and within 0.13 MAE of the leader on three of the remaining five benchmarks, while using roughly a quarter of the memory at equal batch size, and remains trainable at scales where they exhaust GPU memory.

The remainder of this paper is organized as follows. Section II reviews the related work and situates the work, Section III presents the model, Section IV reports the experiments and provides discussions, and Section V concludes the work.

References (32)

  • The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains
  • Convolutional neural networks on graphs with fast localized spectral filtering
  • Semi-Supervised Classification with Graph Convolutional Networks
  • Diffusion convolutional recurrent neural network: Data-driven traffic forecasting (opens arXiv in a new tab)
  • Spatio-temporal graph convolutional networks: A deep learning framework for traffic forecasting (opens arXiv in a new tab)
  • Graph WaveNet for Deep Spatial-Temporal Graph Modeling
  • Spectral temporal graph neural network for multivariate time-series forecasting
  • Attention is all you need
  • Gman: A graph multi-attention network for traffic prediction
  • Pdformer: Propagation delay-aware dynamic long-range transformer for traffic flow prediction
  • Spatio-temporal adaptive embedding makes vanilla transformer sota for traffic forecasting
  • Testam: A time-enhanced spatio-temporal attention model with mixture of experts
  • Fedformer: Frequency enhanced decomposed transformer for long-term series forecasting
  • Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting
  • T-gcn: A temporal graph convolutional network for traffic prediction
  • Adaptive graph convolutional recurrent network for traffic forecasting
  • Attention based spatial-temporal graph convolutional networks for traffic flow forecasting
  • Spatial-temporal synchronous graph convolutional networks: A new framework for spatial-temporal network data forecasting
  • Dynamic graph convolutional recurrent network for traffic prediction: Benchmark and solution
  • Dstagnn: Dynamic spatial-temporal aware graph neural network for traffic flow forecasting
  • Multivariate time series forecasting with dynamic graph neural odes
  • Spatio-temporal meta-graph learning for traffic forecasting
  • Do transformers really perform badly for graph representation?
  • Graph-conditioned mixture of graph neural network experts for traffic forecasting
  • Linformer: Self-attention with linear complexity (opens arXiv in a new tab)
  • Rethinking Attention with Performers
  • Informer: Beyond efficient transformer for long sequence time-series forecasting
  • When spatio-temporal meet wavelets: Disentangled traffic forecasting via efficient spectral graph attention networks
  • Libcity: An open library for traffic prediction
  • Exploring progress in multivariate time series forecasting: Comprehensive benchmarking and heterogeneity analysis
  • Stm-graph: A python framework for spatio-temporal mapping and graph neural network predictions
  • Adam: A Method for Stochastic Optimization