Learning dynamics on a graph: how STGCN forecasts many coupled time series at once
arXivPDFIJCAI proceedingsCodePyTorch port
Many real signals are measured at points that are linked to each other: sensors on roads, stations in a city, electrodes on a scalp. The right object is then a graph whose every node carries a time series. In our IJCAI 2018 paper, we introduced the Spatio-Temporal Graph Convolutional Network (STGCN) for forecasting these coupled time series. To our knowledge, it was the first model for this problem built entirely from convolutions over the graph and over time. We tested it on road sensors. Its sandwich block became a standard building block of graph neural networks for time series[7], and the paper is among the most cited in that field.
The figures below build the idea one piece at a time. Colour means the same thing in all of them:
Labels followed by a small dot • and terms with a dotted underline carry a note. Hover over them, or tap. Bars and nodes without a dot carry notes as well.
1. A network of time series
What is forecast, and why draw it as a graph?
Each sensor reports a speed every five minutes, and nearby sensors move together. We treat the readings at one moment as a signal on a graph. Stacking these signals in time lets us forecast the next few frames (Fig. 1).
The map. Traffic flows along the roads, and each sensor (a node) turns the cars passing it into one number, the average speed in km/h. The twelve readings at time t form the vector vt.
Edges by distance. Sensors close to each other are joined by an edge whose weight falls with distance, and pairs whose weight would drop below a threshold get none. The weights form the matrix W.
One frame every 5 minutes. The graph stays fixed while the readings change, so the history is a stack of frames along a time axis. The model reads the last M = 12 frames, one hour.
The frames to predict. The task is to fill the next frames, here H = 3, a 15-minute forecast, for every sensor at once. The paper also predicts 6 and 9 steps ahead.
2. Where earlier models fall short
What do per-series models, grid CNNs and RNNs miss?
Before this paper, forecasters either ignored the network, forced it onto a grid, or read time with recurrent chains. STGCN keeps the graph as it is and reads time with convolutions instead, building on spectral graph convolution[1][2] and convolutional sequence models[3] (Fig. 2).
One series at a time. Classical forecasters such as ARIMA and the historical average extend each sensor's own past and never look at its neighbours.
Grids, not graphs. A standard convolution slides a square kernel over a regular grid. Road sensors do not sit on one, so most of them fall between the cells.
Chains are slow. Recurrent models such as FC-LSTM and graph-convolutional GRUs[4] pass a state through the steps one by one, so training is sequential and errors build up step by step.
What STGCN keeps. The graph as it is, and a convolution along time, so both directions are read in parallel. Fig. 3 opens the graph side and Fig. 4 the time side.
3. Convolution over the graph
How does a sensor read its neighbours?
A graph has no left and right, so we define our filter through the graph Laplacian and approximate it with polynomials, after Defferrard et al.[1] and Kipf and Welling[2]. In practice a node mixes its own value with those of nodes a few edges away (Fig. 3).
A kernel on a graph. The output at the ringed node is a weighted sum of Chebyshev polynomials Tk of the rescaled Laplacian, each with its own learned weight θk (Eq. 3).
Hops k = 0, 1, 2. The term of order k reaches nodes k edges away. With K = 3 the kernel sees two hops; the three nodes outside stay unread.
The one-hop shortcut. The first-order form keeps one weight and the self-loop graph W̃ (Eq. 5), so one layer reaches one hop. Stacking a second layer reaches two, like a wider kernel.
Every frame, every channel. The same kernel runs on all M frames in parallel, and maps Ci input channels to Co output channels per node (Eq. 6).
4. Convolution over time, with a gate
How is the time axis read without recurrence?
Along the time axis, we use a plain one-dimensional convolution with a gate, the gated linear unit of Gehring et al.[3]. Every output depends only on a short window of the past, so all positions are computed at once (Fig. 4).
A causal window. A window of width Kt = 3 slides along one sensor's 12 readings and writes one output for each position it fits, with no padding. Two positions are lost.
Two halves. The convolution produces twice the channels it needs, 2Co, and splits them into two halves, P and Q.
The gate. A sigmoid turns Q into gates between 0 and 1, and each gate scales its P: the output is P ⊙ σ(Q) (Eq. 7).
All nodes, all at once. The same kernel runs on every sensor, and every position is computed together, not one after another. A residual connection carries the input past the layer.
5. The sandwich block and the full network
How do the two convolutions fit together?
The ST-Conv block puts one graph convolution between two temporal ones, and the model stacks two such blocks before an output layer. Each temporal layer shortens the stack of frames by two, so twelve frames come out as one forecast (Fig. 5).
Input: 12 frames. One card per 5-minute frame, each holding the readings of all n sensors, one channel each (speed).
Temporal gated conv. The layer of Fig. 4 reads every sensor's sequence: 12 frames become 10, and each frame now has 64 channels.
Spatial graph conv. The layer of Fig. 3 mixes neighbours within each frame, all 10 frames in parallel, and squeezes the channels to 16, a bottleneck.
Temporal again. A second gated layer takes the frames from 10 to 8 and the channels back to 64, followed by layer normalisation. These three layers are one ST-Conv block (Eq. 8).
Block 2 and output. A second block takes 8 frames to 4. The output layer's temporal convolution maps them to one step, and a fully connected layer gives the forecast v̂, trained with an L2 loss (Eq. 9).
6. Accuracy on 228 and 1,026 sensors
Does it beat the methods it replaces, at every horizon?
On the California highway data (PeMSD7), both STGCN variants have the lowest error at all three horizons, and the gap grows with the horizon (Fig. 6).
15 min ahead. On PeMSD7(M), 228 sensors, three steps ahead. The two STGCN bars are the lowest; GCGRU and the linear LSVR come closest.
30 min. The same methods six steps ahead. Every method's error grows, and the two STGCN bars stay the lowest.
45 min. Nine steps ahead the classical models have fallen well behind, and STGCN(Cheb) leads GCGRU by 0.44 in MAE.
1,026 sensors, 45 min. On the larger graph, PeMSD7(L), the order holds. GCGRU had to be trained with half the batch size to fit in GPU memory.
7. Training cost
What does the convolutional design buy in time and size?
Because no step waits for the one before, training runs in parallel. We measured the full training time against GCGRU on both PeMSD7 graphs (Fig. 7).
A race on PeMSD7(M). The bars fill at the same rate, so their lengths are the training times. Both STGCN variants finish in about 272 s; GCGRU needs 3,824.54 s, which the paper calls a 14 times acceleration.
PeMSD7(L). On 1,026 sensors the gap stays above tenfold, even though GCGRU ran with half the batch size. Here the first-order variant is about 20% faster than the Chebyshev one.
Parameters. STGCN has 4.54 × 105 parameters. The paper puts this at about two thirds of GCGRU and over 95% fewer than FC-LSTM, without giving their counts.
8. Eight years of citations
How widely has the idea been taken up?
Citations of the paper have grown every year since it appeared, and the official code is still maintained. The counts differ between databases, so the figure shows them side by side (Fig. 8).
2018–2020. Citing works per year, as counted by OpenAlex. Uptake started slowly after the IJCAI paper and then took off.
2021–2023. The yearly count keeps rising, to almost a thousand in 2023.
2024–2026. Still rising: 1,948 citing works in 2026, counted up to 26 November, with five weeks of the year left.
Across databases. Totals depend on what each database indexes. OpenAlex counts most, Crossref fewest; the code repositories show use beyond citation.
9. The family it started
What grew from the sandwich block, and where did it travel?
Later models kept the pairing of graph convolution and temporal convolution and changed one part at a time: a learned graph[5], attention, continuous time. The decisive step for the general case was MTGNN[6], which learns the graph from the series themselves, so no map is needed (Fig. 9).
The first wave. 2018 to 2019. DCRNN[4] appeared alongside STGCN as a recurrent alternative. Graph WaveNet[5] kept the convolutional design and learned extra edges; ASTGCN added attention.
Any coupled series. In 2020 MTGNN[6] learned the graph from the data, so any set of related series qualifies. STSGCN, GMAN and AGCRN reworked the block in other ways.
Continuous time. 2021 to 2022. STGODE and STG-NCDE replace the stacked layers with differential equations over the graph.
Beyond traffic. The same block reached air quality, EEG and dengue[9], a standard library layer, two surveys[7][8] and a 2026 study of its own depth[10].
In the paper, we reported that STGCN outperformed the state of the art on two real-world data sets while achieving “faster training, easier convergences, and fewer parameters”, and that the framework “can be applied into more general spatio-temporal structured sequence forecasting scenarios, such as evolving of social networks, and preference prediction in recommendation systems”. The field did exactly that, and the block now reads air-quality stations, EEG electrodes and dengue counts that never stood beside a road[9].
References
- Defferrard et al. Convolutional neural networks on graphs with fast localized spectral filtering. NIPS 2016.
- Kipf and Welling. Semi-supervised classification with graph convolutional networks. 2016.
- Gehring et al. Convolutional sequence to sequence learning. 2017.
- Li et al. Diffusion convolutional recurrent neural network: Data-driven traffic forecasting. ICLR 2018.
- Wu et al. Graph WaveNet for deep spatial-temporal graph modeling. IJCAI 2019.
- Wu et al. Connecting the dots: Multivariate time series forecasting with graph neural networks. KDD 2020.
- Jin et al. A survey on graph neural networks for time series: Forecasting, classification, imputation, and anomaly detection. TPAMI 2024.
- Corradini et al. A systematic literature review of spatio-temporal graph neural network models for time series forecasting and classification. Neural Networks 2025.
- Siabi et al. Innovative application of a traffic-prediction spatio-temporal graph convolutional network for dengue disease forecasting. Scientific Reports 2026.
- Lone et al. Efficient traffic prediction at scale: A systematic study of STGCN architectural depth. 2026.
Bing Yu, Haoteng Yin and I presented “Spatio-Temporal Graph Convolutional Networks: A Deep Learning Framework for Traffic Forecasting” at IJCAI 2018. Figures 1–5 use an illustrative road map and invented readings to explain the method. Figures 6 and 7 plot results from Tables 2 and 3 of our paper. Figure 8 uses citation databases and GitHub, and Figure 9 draws on the follow-up studies named in the timeline.