Spatiotemporal Graph Transformer for Traffic Intelligence in Edge Computing
Summary
This paper proposes a spatiotemporal graph Transformer framework for traffic forecasting in edge computing, combining graph neural networks for spatial correlations and Transformer self-attention for long-range temporal dependencies. Experiments on real-world cellular data show it outperforms recurrent graph-based baselines like GCN-LSTM and GCN-GRU.
View Cached Full Text
Cached at: 08/06/26, 07:45 AM
# Spatiotemporal Graph Transformer for Traffic Intelligence in Edge Computing
Source: [https://arxiv.org/html/2608.04075](https://arxiv.org/html/2608.04075)
Laha Ale, , Letian Lin, Na Cao, Zheng Ma, and Peng Yu,L\. Ale is with the School of Computing and Artificial Intelligence, Southwest Jiaotong University, Chengdu, China \(e\-mail:laha\_ale@swjtu\.edu\.cn\)\.L\. Ale, L\. Lin and N\. Cao are with SWJTU\-Leeds Joint School, Southwest Jiaotong University, Chengdu, China \(e\-mail: \{L\.Ale, sc23ll, sc23n2c\}@leeds\.ac\.uk\)\.Z\. Ma is with the Key Lab of Information Coding and Transmission, Southwest Jiaotong University, Chengdu, China \(e\-mail: zma@home\.swjtu\.edu\.cn\)\.P\. Yu is with the State Key Laboratory of Networking and Switching Technology, Beijing University of Posts and Telecommunications, Beijing, China \(e\-mail:yupeng@bupt\.edu\.cn\)\.*Corresponding authors: Peng Yu \(email: yupeng@bupt\.edu\.cn\)*
###### Abstract
Accurate traffic forecasting is essential for proactive resource management in edge computing, where service demand evolves dynamically across both space and time\. In practical cellular edge systems, traffic exhibits strong spatial correlations among neighboring service regions and long\-range temporal dependencies driven by user mobility and application behavior\. Existing recurrent forecasting approaches can capture short\-term dynamics but often struggle to model long\-horizon traffic evolution under non\-stationary conditions\. To address this challenge, we propose a spatiotemporal graph Transformer framework that jointly models spatial interactions and temporal dependencies for traffic forecasting in edge computing\. The framework employs graph neural networks to capture spatial correlations among service regions and leverages Transformer\-based self\-attention to learn long\-range temporal patterns from historical traffic observations\. By decoupling spatial representation learning from temporal reasoning, the proposed approach provides an effective mechanism for large\-scale spatiotemporal traffic modeling\. Extensive experiments on a real\-world cellular network dataset demonstrate that the proposed graph Transformer consistently outperforms recurrent graph\-based baselines, including GCN\-RNN, GCN\-LSTM, and GCN\-GRU models, across multiple forecasting horizons\. The resulting forecasts enable more effective proactive resource provisioning and reduce overload risk compared with reactive management strategies\. These results highlight the potential of graph\-enhanced attention mechanisms for building intelligent and adaptive edge computing systems\.
###### Index Terms:
Edge Computing, Traffic, Graphic Neural Network
## IIntroduction
Edge computing has emerged as a key paradigm for supporting latency\-sensitive and bandwidth\-intensive applications by moving computation, storage, and intelligence closer to end users and devices\[[1](https://arxiv.org/html/2608.04075#bib.bib1),[2](https://arxiv.org/html/2608.04075#bib.bib2),[3](https://arxiv.org/html/2608.04075#bib.bib3)\]\. By reducing reliance on centralized cloud infrastructures, edge computing enables real\-time services such as immersive media, intelligent transportation, industrial automation, and mobile augmented reality\[[4](https://arxiv.org/html/2608.04075#bib.bib4),[5](https://arxiv.org/html/2608.04075#bib.bib5)\]\. The effectiveness of these systems, however, depends not only on the availability of edge resources but also on the ability to provision them proactively across geographically distributed service regions\. Since edge servers typically operate under limited and heterogeneous resource constraints\[[5](https://arxiv.org/html/2608.04075#bib.bib5)\], anticipating future service demand has become a fundamental requirement for reliable and efficient edge computing\.
Recent advances in AI\-native networking and 6G systems have highlighted the growing importance of*traffic intelligence*, which aims to understand, predict, and exploit spatiotemporal traffic dynamics for proactive network management\. Wireless traffic exhibits strong spatial correlations across neighboring regions and complex temporal dependencies driven by user mobility, application behavior, daily routines, and large\-scale events\[[6](https://arxiv.org/html/2608.04075#bib.bib6)\]\. Consequently, reactive resource management strategies based solely on current observations often lead to resource underutilization, service overload, and degraded quality of service\[[7](https://arxiv.org/html/2608.04075#bib.bib7),[8](https://arxiv.org/html/2608.04075#bib.bib8),[9](https://arxiv.org/html/2608.04075#bib.bib9)\]\. Accurate traffic intelligence therefore serves as a critical enabler for proactive resource provisioning, service placement, task scheduling, and edge orchestration\[[10](https://arxiv.org/html/2608.04075#bib.bib10)\]\.
To improve traffic prediction accuracy, recent studies have explored both foundation\-model\-based and distributed learning paradigms\. TIDES\[[11](https://arxiv.org/html/2608.04075#bib.bib11)\]introduces a traffic intelligence framework that leverages large language models and spatial\-temporal alignment mechanisms to capture heterogeneous wireless traffic patterns across urban regions\. Meanwhile, Zhang*et al\.*\[[12](https://arxiv.org/html/2608.04075#bib.bib12)\]propose a federated traffic prediction framework that combines gradient compression and correlation\-driven aggregation to model spatial dependencies while reducing communication overhead\. These studies demonstrate that exploiting spatial correlations is essential for scalable traffic intelligence in future wireless and edge systems\. However, despite substantial progress in spatial modeling, the challenge of capturing long\-range temporal dependencies in highly dynamic and non\-stationary traffic sequences remains insufficiently addressed\[[13](https://arxiv.org/html/2608.04075#bib.bib13)\]\.
Traffic intelligence in edge computing is fundamentally a spatiotemporal learning problem\. From the spatial perspective, traffic demand in one service region is influenced by neighboring regions through geographic proximity, user mobility, and shared network conditions\[[14](https://arxiv.org/html/2608.04075#bib.bib14),[15](https://arxiv.org/html/2608.04075#bib.bib15)\]\. From the temporal perspective, traffic exhibits both short\-term fluctuations and long\-range patterns, including diurnal cycles, weekly regularities, seasonal trends, and bursty events\[[16](https://arxiv.org/html/2608.04075#bib.bib16),[17](https://arxiv.org/html/2608.04075#bib.bib17)\]\. Traditional recurrent neural networks \(RNNs\), including long short\-term memory \(LSTM\) and gated recurrent unit \(GRU\) architectures\[[18](https://arxiv.org/html/2608.04075#bib.bib18),[19](https://arxiv.org/html/2608.04075#bib.bib19),[20](https://arxiv.org/html/2608.04075#bib.bib20)\], have been widely adopted for temporal forecasting\. Although effective for short\-term prediction, these models rely on sequential hidden\-state propagation and often struggle to preserve long\-range temporal dependencies under non\-stationary traffic conditions\[[21](https://arxiv.org/html/2608.04075#bib.bib21)\]\.
Transformer\-based models\[[22](https://arxiv.org/html/2608.04075#bib.bib22),[23](https://arxiv.org/html/2608.04075#bib.bib23)\]provide a compelling alternative through self\-attention mechanisms\. Rather than compressing historical observations into recursively updated hidden states, Transformers directly model interactions among different time steps and selectively attend to informative historical patterns\. This capability is particularly valuable for traffic intelligence, where future traffic demand may depend simultaneously on recent fluctuations, long\-term periodic behaviors, and irregular demand transitions\. Recent studies have explored Transformer architectures for spatiotemporal traffic prediction in wireless and urban environments\[[24](https://arxiv.org/html/2608.04075#bib.bib24),[25](https://arxiv.org/html/2608.04075#bib.bib25),[26](https://arxiv.org/html/2608.04075#bib.bib26)\]\. Nevertheless, the integration of graph\-based spatial modeling and Transformer\-based temporal reasoning for traffic intelligence in edge computing remains relatively underexplored, especially when evaluated in terms of proactive resource management effectiveness\.
To address this challenge, this paper proposes a spatiotemporal graph Transformer framework for traffic intelligence in edge computing\. The framework decouples spatial and temporal learning: a graph neural network aggregates traffic information across edge service regions using geographic and adaptive adjacency relationships, while a Transformer module captures long\-range temporal dependencies in the resulting spatial representations\. This combination supports multi\-horizon traffic forecasting for proactive edge resource management\.
We evaluate the resulting graph\-convolutional Transformer \(GCN\-Transformer\) model\[[27](https://arxiv.org/html/2608.04075#bib.bib27),[28](https://arxiv.org/html/2608.04075#bib.bib28)\]on a large\-scale real\-world cellular network dataset and compare it with GCN\-RNN, GCN\-LSTM, and GCN\-GRU baselines under identical settings\. The results show that the proposed model delivers more accurate and stable forecasts, especially at longer horizons and during rapid traffic changes, enabling more effective proactive provisioning and lower overload risk than reactive management strategies\.
The main contributions of this paper are summarized as follows:
- •We formulate spatiotemporal traffic intelligence as a fundamental capability for proactive resource management in edge computing and identify long\-range temporal reasoning as a key challenge in dynamic traffic environments\.
- •We propose a spatiotemporal graph Transformer framework that integrates graph neural networks for spatial dependency modeling with Transformer\-based temporal reasoning for multi\-horizon traffic forecasting\.
- •We conduct extensive evaluations on a real\-world cellular network dataset and demonstrate that the proposed framework consistently outperforms recurrent graph\-based approaches in forecasting accuracy, prediction stability, and support for proactive resource provisioning\.
## IISystem Model
We consider an edge computing system deployed over a large\-scale cellular network, as illustrated in Fig\.[1](https://arxiv.org/html/2608.04075#S2.F1)\. Edge servers provide computation and storage resources for geographically distributed users\. The service area is partitioned into multiple edge service regions, and each region is managed by an edge server or edge controller that provisions resources for nearby devices\. The goal of the system is to predict future resource demand in each region and use these predictions to support proactive resource provisioning, thereby reducing overload and service degradation\.
Figure 1:Traffic intelligence for proactive resource provisioning in edge computing\.### II\-ASpatial Graph Model
Let𝒱=\{1,2,…,N\}\\mathcal\{V\}=\\\{1,2,\\dots,N\\\}denote the set of edge service regions\. Each nodei∈𝒱i\\in\\mathcal\{V\}represents a cluster of geographically proximate base stations or access points\. The spatial relationships among regions are represented by a weighted graph𝒢=\(𝒱,ℰ\)\\mathcal\{G\}=\(\\mathcal\{V\},\\mathcal\{E\}\), whereℰ⊆𝒱×𝒱\\mathcal\{E\}\\subseteq\\mathcal\{V\}\\times\\mathcal\{V\}is the set of edges\.
An edge\(i,j\)∈ℰ\(i,j\)\\in\\mathcal\{E\}indicates that regionsiiandjjare spatially related, for example because they are geographically close, have overlapping service coverage, or are affected by similar user mobility patterns\. Each edge is assigned a non\-negative weightwijw\_\{ij\}that measures the strength of this relationship\. The resulting weighted adjacency matrix is denoted by𝐖∈ℝN×N\\mathbf\{W\}\\in\\mathbb\{R\}^\{N\\times N\}and serves as the graph structure for spatial demand modeling\.
### II\-BTraffic Demand Representation
Time is divided into equal\-length intervals indexed byt=1,2,…,Tt=1,2,\\dots,T\. Letxi\(t\)x\_\{i\}\(t\)denote the aggregated resource demand observed in edge service regioniiduring intervaltt\. Depending on the application scenario,xi\(t\)x\_\{i\}\(t\)may represent traffic volume, active service sessions, computation requests, or other indicators of service demand within regionii\.
The network\-wide demand state at timettis represented as
𝐱\(t\)=\[x1\(t\),x2\(t\),…,xN\(t\)\]⊤∈ℝN\.\\mathbf\{x\}\(t\)=\[x\_\{1\}\(t\),x\_\{2\}\(t\),\\dots,x\_\{N\}\(t\)\]^\{\\top\}\\in\\mathbb\{R\}^\{N\}\.\(1\)Given a historical observation window of lengthLL, the input demand sequence is
𝒳t=\{𝐱\(t−L\+1\),𝐱\(t−L\+2\),…,𝐱\(t\)\}\.\\mathcal\{X\}\_\{t\}=\\\{\\mathbf\{x\}\(t\-L\+1\),\\mathbf\{x\}\(t\-L\+2\),\\dots,\\mathbf\{x\}\(t\)\\\}\.\(2\)The forecasting task is to infer future demand states𝐱^\(t\+h\)\\hat\{\\mathbf\{x\}\}\(t\+h\)for one or more prediction horizonsh≥1h\\geq 1from𝒳t\\mathcal\{X\}\_\{t\}and the spatial graph𝒢\\mathcal\{G\}\.
### II\-CSpatial Feature Aggregation
Demand in neighboring edge regions is often correlated due to geographic proximity, overlapping coverage, and user mobility\. Therefore, before modeling temporal evolution, the system first aggregates spatial information over the graph\.
At each time intervaltt, let𝐗\(t\)∈ℝN×din\\mathbf\{X\}\(t\)\\in\\mathbb\{R\}^\{N\\times d\_\{\\mathrm\{in\}\}\}denote the node\-feature matrix, where each row contains the demand\-related features of one edge service region anddind\_\{\\mathrm\{in\}\}is the input feature dimension\. Spatial aggregation propagates information across neighboring nodes according to the weighted graph structure and produces
𝐇\(t\)=𝒜\(𝐗\(t\),𝒢\),\\mathbf\{H\}\(t\)=\\mathcal\{A\}\\\!\\left\(\\mathbf\{X\}\(t\),\\mathcal\{G\}\\right\),\(3\)where𝐇\(t\)∈ℝN×d\\mathbf\{H\}\(t\)\\in\\mathbb\{R\}^\{N\\times d\}is the spatially contextualized representation and𝒜\(⋅\)\\mathcal\{A\}\(\\cdot\)denotes a graph\-based aggregation operator\. Theiith row of𝐇\(t\)\\mathbf\{H\}\(t\), denoted by𝐡i\(t\)\\mathbf\{h\}\_\{i\}\(t\), contains the spatial feature representation of regionii\. The specific parameterization of𝒜\(⋅\)\\mathcal\{A\}\(\\cdot\)is described in Section[IV](https://arxiv.org/html/2608.04075#S4)\.
### II\-DTemporal Modeling with Transformer Memory
After spatial aggregation, the temporal evolution of each region is modeled using a Transformer encoder that performs temporal reasoning over historical traffic observations\. For regionii, the sequence of spatial representations
\{𝐡i\(t−L\+1\),𝐡i\(t−L\+2\),…,𝐡i\(t\)\}\\\{\\mathbf\{h\}\_\{i\}\(t\-L\+1\),\\mathbf\{h\}\_\{i\}\(t\-L\+2\),\\dots,\\mathbf\{h\}\_\{i\}\(t\)\\\}\(4\)is fed into a Transformer encoder\. The encoder applies self\-attention to learn dependencies among historical time steps, allowing the model to capture both short\-term traffic variations and long\-range temporal patterns\.
The scaled dot\-product attention operation is given by
Attention\(𝐐,𝐊,𝐕\)=softmax\(𝐐𝐊⊤d\)𝐕,\\text\{Attention\}\(\\mathbf\{Q\},\\mathbf\{K\},\\mathbf\{V\}\)=\\text\{softmax\}\\\!\\left\(\\frac\{\\mathbf\{Q\}\\mathbf\{K\}^\{\\top\}\}\{\\sqrt\{d\}\}\\right\)\\mathbf\{V\},\(5\)where𝐐\\mathbf\{Q\},𝐊\\mathbf\{K\}, and𝐕\\mathbf\{V\}are the query, key, and value projections of the input sequence, respectively\. By attending over the historical window, the Transformer provides a context\-aware temporal representation for multi\-horizon traffic forecasting\.
### II\-ETraffic Forecasting and Proactive Resource Provisioning
The output of the Transformer module is mapped to future traffic forecasts for all edge service regions\. These forecasts constitute the traffic intelligence available to the edge controller and are subsequently used to support proactive resource provisioning decisions\. By anticipating future traffic demand before it materializes, the controller can allocate computation, storage, and networking resources in advance\. Compared with reactive approaches that respond only after demand has been observed, proactive provisioning improves resource utilization, enhances service reliability, and mitigates the impact of sudden traffic surges and spatially correlated overload events\.
## IIIProblem Formulation
Based on the system model introduced in Section[II](https://arxiv.org/html/2608.04075#S2), we formulate spatiotemporal traffic forecasting as a supervised learning problem over a graph\-structured edge computing system\. Given historical traffic observations and the spatial relationships among service regions, the objective is to predict future traffic demand over multiple forecasting horizons\. The resulting forecasts provide predictive information for proactive resource provisioning and traffic\-aware edge management\.
### III\-AMulti\-Horizon Spatiotemporal Traffic Forecasting
Let𝒢=\(𝒱,ℰ\)\\mathcal\{G\}=\(\\mathcal\{V\},\\mathcal\{E\}\)denote the spatial graph of edge service regions\. At time intervaltt, the network\-wide traffic state is represented by
𝐱t=\[x1,t,x2,t,…,xN,t\]⊤∈ℝN,\\mathbf\{x\}\_\{t\}=\[x\_\{1,t\},x\_\{2,t\},\\ldots,x\_\{N,t\}\]^\{\\top\}\\in\\mathbb\{R\}^\{N\},\(6\)wherexi,tx\_\{i,t\}denotes the traffic demand observed in regionii, andNNis the number of service regions\.
Given a historical observation window of lengthLL, the input sequence is
𝐗t−L\+1:t=\[𝐱t−L\+1,𝐱t−L\+2,…,𝐱t\]∈ℝN×L\.\\mathbf\{X\}\_\{t\-L\+1:t\}=\[\\mathbf\{x\}\_\{t\-L\+1\},\\mathbf\{x\}\_\{t\-L\+2\},\\ldots,\\mathbf\{x\}\_\{t\}\]\\in\\mathbb\{R\}^\{N\\times L\}\.\(7\)
The goal is to learn a forecasting functionfθ\(⋅\)f\_\{\\theta\}\(\\cdot\)that maps the historical traffic sequence and spatial graph to a sequence of future traffic states:
𝐗^t\+1:t\+H=fθ\(𝐗t−L\+1:t,𝒢\),\\hat\{\\mathbf\{X\}\}\_\{t\+1:t\+H\}=f\_\{\\theta\}\\left\(\\mathbf\{X\}\_\{t\-L\+1:t\},\\mathcal\{G\}\\right\),\(8\)where
𝐗^t\+1:t\+H=\[𝐱^t\+1,𝐱^t\+2,…,𝐱^t\+H\]∈ℝN×H\.\\hat\{\\mathbf\{X\}\}\_\{t\+1:t\+H\}=\[\\hat\{\\mathbf\{x\}\}\_\{t\+1\},\\hat\{\\mathbf\{x\}\}\_\{t\+2\},\\ldots,\\hat\{\\mathbf\{x\}\}\_\{t\+H\}\]\\in\\mathbb\{R\}^\{N\\times H\}\.\(9\)
For each prediction horizonh∈\{1,2,…,H\}h\\in\\\{1,2,\\ldots,H\\\}, the model outputs
𝐱^t\+h=\[x^1,t\+h,x^2,t\+h,…,x^N,t\+h\]⊤\.\\hat\{\\mathbf\{x\}\}\_\{t\+h\}=\[\\hat\{x\}\_\{1,t\+h\},\\hat\{x\}\_\{2,t\+h\},\\ldots,\\hat\{x\}\_\{N,t\+h\}\]^\{\\top\}\.\(10\)
Given a training index set𝒯\\mathcal\{T\}, the model parameters are learned by minimizing the average forecasting error across all training samples, service regions, and prediction horizons\. Using the mean absolute error \(MAE\), the objective is
θ∗=argminθ1\|𝒯\|HN∑t∈𝒯∑h=1H‖𝐱^t\+h−𝐱t\+h‖1\.\\theta^\{\\ast\}=\\arg\\min\_\{\\theta\}\\frac\{1\}\{\|\\mathcal\{T\}\|HN\}\\sum\_\{t\\in\\mathcal\{T\}\}\\sum\_\{h=1\}^\{H\}\\left\\\|\\hat\{\\mathbf\{x\}\}\_\{t\+h\}\-\\mathbf\{x\}\_\{t\+h\}\\right\\\|\_\{1\}\.\(11\)
This formulation requires the model to capture spatial correlations among service regions and temporal dependencies across both short\-term and long\-term traffic patterns\.
### III\-BTraffic\-Aware Proactive Resource Provisioning
The predicted traffic states can be used by an edge controller to support proactive resource provisioning\. Let
𝐫t\+h=\[r1,t\+h,r2,t\+h,…,rN,t\+h\]⊤\\mathbf\{r\}\_\{t\+h\}=\[r\_\{1,t\+h\},r\_\{2,t\+h\},\\ldots,r\_\{N,t\+h\}\]^\{\\top\}\(12\)denote the resource allocation vector at horizonhh, whereri,t\+hr\_\{i,t\+h\}represents the computational, storage, or networking resources assigned to regionii\.
A generic traffic\-aware provisioning policy can be written as
𝐫t\+h=g\(𝐱^t\+h\),\\mathbf\{r\}\_\{t\+h\}=g\(\\hat\{\\mathbf\{x\}\}\_\{t\+h\}\),\(13\)whereg\(⋅\)g\(\\cdot\)maps forecasted traffic demand to resource allocation decisions subject to system constraints\. For example, regions predicted to experience increased traffic may receive additional resources in advance, while excess resources can be reassigned from regions with lower predicted demand\.
The design of the provisioning policyg\(⋅\)g\(\\cdot\)is beyond the scope of this paper\. Instead, this work focuses on improving the accuracy and stability of the spatiotemporal traffic forecasts, which serve as the input to proactive resource management mechanisms\.
## IVProposed Graph\-Based Transformer Memory Model
This section presents the proposed graph\-based Transformer memory model for traffic intelligence in edge computing\. Following the formulation in Section[III](https://arxiv.org/html/2608.04075#S3), the model predicts future traffic demand over multiple horizons by combining graph\-based spatial aggregation with attention\-based temporal memory\. The design separates spatial perception from temporal reasoning: the graph module extracts spatially contextualized traffic representations, while the Transformer module reasons over their historical evolution\.
### IV\-AModel Overview
The proposed framework consists of three main stages\. First, edge service regions are represented as nodes in a weighted spatial graph constructed from geographic proximity\. Second, a graph neural network \(GNN\) aggregates information from neighboring regions to capture spatial traffic correlations\. Third, a Transformer\-based temporal memory module processes the sequence of spatial representations and produces multi\-horizon traffic forecasts for all regions\.
At each time interval, node\-level traffic features are processed by the GNN through message passing over the spatial graph\. The resulting spatial embeddings are arranged as temporal sequences and passed to the Transformer memory, which attends to relevant historical time steps when predicting future traffic demand\. The final forecasts can then be used by an edge controller for proactive resource provisioning\.
Figure 2:Graph\-based Transformer memory framework for traffic intelligence in edge computing\.Formally, for a historical window\{𝐗\(t−L\+1\),…,𝐗\(t\)\}\\\{\\mathbf\{X\}\(t\-L\+1\),\\dots,\\mathbf\{X\}\(t\)\\\}and spatial graph𝒢\\mathcal\{G\}, the model can be written as
𝐇\(τ\)\\displaystyle\\mathbf\{H\}\(\\tau\)=ℱGNN\(𝐗\(τ\),𝒢\),τ=t−L\+1,…,t,\\displaystyle=\\mathcal\{F\}\_\{\\mathrm\{GNN\}\}\\\!\\left\(\\mathbf\{X\}\(\\tau\),\\mathcal\{G\}\\right\),\\quad\\tau=t\-L\+1,\\dots,t,\(14\)\{𝐱^\(t\+h\)\}h=1H\\displaystyle\\\{\\hat\{\\mathbf\{x\}\}\(t\+h\)\\\}\_\{h=1\}^\{H\}=ℱout\(ℱTM\(𝐇\(t−L\+1\),…,𝐇\(t\)\)\),\\displaystyle=\\mathcal\{F\}\_\{\\mathrm\{out\}\}\\\!\\left\(\\mathcal\{F\}\_\{\\mathrm\{TM\}\}\\\!\\left\(\\mathbf\{H\}\(t\-L\+1\),\\dots,\\mathbf\{H\}\(t\)\\right\)\\right\),whereℱGNN\(⋅\)\\mathcal\{F\}\_\{\\mathrm\{GNN\}\}\(\\cdot\)denotes graph\-based spatial aggregation,ℱTM\(⋅\)\\mathcal\{F\}\_\{\\mathrm\{TM\}\}\(\\cdot\)denotes Transformer\-based temporal memory, andℱout\(⋅\)\\mathcal\{F\}\_\{\\mathrm\{out\}\}\(\\cdot\)maps the learned spatiotemporal representation toHHfuture traffic\-demand vectors\.
### IV\-BInput Representation and Spatial Graph Construction
At each time steptt, the observed traffic demand across all edge service regions is represented by𝐱\(t\)∈ℝN\\mathbf\{x\}\(t\)\\in\\mathbb\{R\}^\{N\}\. This traffic\-demand vector can be augmented with contextual features, such as hour\-of\-day and day\-of\-week indicators, to form the node\-level input matrix
𝐗\(t\)∈ℝN×din,\\mathbf\{X\}\(t\)\\in\\mathbb\{R\}^\{N\\times d\_\{\\mathrm\{in\}\}\},\(15\)where each row contains the feature vector of one edge service region anddind\_\{\\mathrm\{in\}\}is the input feature dimension\.
Spatial interactions are modeled using a weighted graph𝒢=\(𝒱,ℰ\)\\mathcal\{G\}=\(\\mathcal\{V\},\\mathcal\{E\}\)\. Each nodei∈𝒱i\\in\\mathcal\{V\}corresponds to an edge service region, which is obtained by clustering geographically proximate base stations\. Let
𝐜i=\(ϕi,λi\)\\mathbf\{c\}\_\{i\}=\(\\phi\_\{i\},\\lambda\_\{i\}\)\(16\)denote the centroid of regionii, whereϕi\\phi\_\{i\}andλi\\lambda\_\{i\}are the latitude and longitude of the centroid, respectively\. The spatial distance between regionsiiandjjis computed using the Euclidean distance between their centroids:
dij=‖𝐜i−𝐜j‖2=\(ϕi−ϕj\)2\+\(λi−λj\)2\.d\_\{ij\}=\\left\\\|\\mathbf\{c\}\_\{i\}\-\\mathbf\{c\}\_\{j\}\\right\\\|\_\{2\}=\\sqrt\{\(\\phi\_\{i\}\-\\phi\_\{j\}\)^\{2\}\+\(\\lambda\_\{i\}\-\\lambda\_\{j\}\)^\{2\}\}\.\(17\)
A fully connected weighted graph is then constructed over the region centroids\. For each pair of regions\(i,j\)\(i,j\), the spatial weight is computed using a Gaussian kernel:
wij=exp\(−dij2σ2\),w\_\{ij\}=\\exp\\left\(\-\\frac\{d\_\{ij\}^\{2\}\}\{\\sigma^\{2\}\}\\right\),\(18\)whereσ\>0\\sigma\>0is the kernel bandwidth parameter controlling the spatial decay rate\. A smallerσ\\sigmaassigns relatively large weights only to nearby regions, while a largerσ\\sigmaallows more distant regions to retain stronger spatial correlations\. Since the weight decreases as the distance increases, geographically close regions have stronger graph connections\.
The resulting weights are assembled into the weighted adjacency matrix𝐖∈ℝN×N\\mathbf\{W\}\\in\\mathbb\{R\}^\{N\\times N\}, whereWij=wijW\_\{ij\}=w\_\{ij\}\. The adjacency matrix is then row\-normalized as
Aij=Wij∑k=1NWik\+ϵ,A\_\{ij\}=\\frac\{W\_\{ij\}\}\{\\sum\_\{k=1\}^\{N\}W\_\{ik\}\+\\epsilon\},\(19\)whereϵ\\epsilonis a small constant for numerical stability\. The normalized adjacency matrix𝐀\\mathbf\{A\}is used as the fixed spatial propagation matrix in the graph convolution module\. In addition, a learnable adaptive adjacency component is introduced in the model to complement the fixed geographic graph and capture data\-driven spatial dependencies that may not be fully explained by physical distance alone\.
Input:Event log
𝒟\\mathcal\{D\}; time slot
Δ\\Delta; history length
LL; forecast horizon
HH;
number of regions
NN; Gaussian kernel bandwidth
σ\\sigma;
learning rate
η\\eta; batch size
BB; epochs
EE\.
Output:Trained parameters
Θ⋆\\Theta^\{\\star\}; traffic forecasts
\{𝐱^\(t\+h\)\}h=1H\\\{\\hat\{\\mathbf\{x\}\}\(t\{\+\}h\)\\\}\_\{h=1\}^\{H\}\.
Offline preprocessing:
Cluster base\-station locations into
NNedge regions and assign events to regions\.
Discretize time into fixed\-length slots and aggregate node\-level traffic demand
𝐱\(t\)\\mathbf\{x\}\(t\)for each region\.
Construct a fully connected spatial graph over region centroids\.
Compute pairwise centroid distances using Euclidean distance:
dij=‖𝐜i−𝐜j‖2d\_\{ij\}=\\\|\\mathbf\{c\}\_\{i\}\-\\mathbf\{c\}\_\{j\}\\\|\_\{2\}\.
Compute pairwise edge weights using the Gaussian kernel:
wij=exp\(−dij2/σ2\)w\_\{ij\}=\\exp\(\-d\_\{ij\}^\{2\}/\\sigma^\{2\}\)\.
Form the weighted adjacency matrix
𝐖\\mathbf\{W\}and obtain the row\-normalized adjacency matrix
𝐀\\mathbf\{A\}\.
Construct sliding\-window samples
\(𝐗\(t−L\+1:t\),\{𝐱\(t\+h\)\}h=1H\)\\big\(\\mathbf\{X\}\(t\{\-\}L\{\+\}1\{:\}t\),\\\{\\mathbf\{x\}\(t\{\+\}h\)\\\}\_\{h=1\}^\{H\}\\big\)\.
Model:
Spatial aggregation:compute
𝐇\(τ\)←σg\(𝐀𝐗\(τ\)𝚯s\)\\mathbf\{H\}\(\\tau\)\\leftarrow\\sigma\_\{g\}\(\\mathbf\{A\}\\mathbf\{X\}\(\\tau\)\\boldsymbol\{\\Theta\}\_\{s\}\)for
τ=t−L\+1,…,t\\tau=t\{\-\}L\{\+\}1,\\dots,t\.
Temporal memory:apply a Transformer encoder to
\{𝐇\(t−L\+1\),…,𝐇\(t\)\}\\\{\\mathbf\{H\}\(t\{\-\}L\{\+\}1\),\\dots,\\mathbf\{H\}\(t\)\\\}\.
Output:predict
\{𝐱^\(t\+h\)\}h=1H\\\{\\hat\{\\mathbf\{x\}\}\(t\{\+\}h\)\\\}\_\{h=1\}^\{H\}\.
Training:
Initialize model parameters
Θ\\Theta\.
for*e=1e=1toEE*do
foreach*mini\-batchℬ\\mathcal\{B\}of sizeBB*do
Compute spatial embeddings and temporal representations\.
Minimize the multi\-horizon MAE loss:
ℒ=1\|ℬ\|H∑t∈ℬ∑h=1H‖𝐱^\(t\+h\)−𝐱\(t\+h\)‖1\.\\mathcal\{L\}=\\frac\{1\}\{\|\\mathcal\{B\}\|H\}\\sum\_\{t\\in\\mathcal\{B\}\}\\sum\_\{h=1\}^\{H\}\\left\\\|\\hat\{\\mathbf\{x\}\}\(t\{\+\}h\)\-\\mathbf\{x\}\(t\{\+\}h\)\\right\\\|\_\{1\}\.Update
Θ←Θ−η∇Θℒ\\Theta\\leftarrow\\Theta\-\\eta\\nabla\_\{\\Theta\}\\mathcal\{L\}\.
Set
Θ⋆←Θ\\Theta^\{\\star\}\\leftarrow\\Theta\.
Inference:
Given recent observations
𝐗\(t−L\+1:t\)\\mathbf\{X\}\(t\{\-\}L\{\+\}1\{:\}t\), predict future traffic demand
\{𝐱^\(t\+h\)\}h=1H\\\{\\hat\{\\mathbf\{x\}\}\(t\{\+\}h\)\\\}\_\{h=1\}^\{H\}for all edge service regions\.
The predicted traffic demand can be used by an edge controller as input for proactive resource provisioning decisions\.
Algorithm 1Spatiotemporal Graph Transformer for Traffic Intelligence in Edge Computing
### IV\-CSpatial Modeling via Graph Neural Networks
To model spatial dependencies among edge service regions, we apply graph convolution over the normalized spatial adjacency matrix\. The fixed adjacency matrix𝐀\(0\)\\mathbf\{A\}^\{\(0\)\}is obtained from the row\-normalized Gaussian kernel weights\. In the neural model, this fixed geographic adjacency is further combined with a learnable adaptive adjacency matrix𝐀\(adp\)\\mathbf\{A\}^\{\(\\mathrm\{adp\}\)\}:
𝐀¯=softmax\(𝐀\(0\)\+𝐀\(adp\)\),\\bar\{\\mathbf\{A\}\}=\\mathrm\{softmax\}\\left\(\\mathbf\{A\}^\{\(0\)\}\+\\mathbf\{A\}^\{\(\\mathrm\{adp\}\)\}\\right\),\(20\)where the softmax operation is applied row\-wise\. At each time steptt, spatial aggregation is performed as
𝐇\(t\)=ρ\(𝐀¯𝐗\(t\)𝚯s\),\\mathbf\{H\}\(t\)=\\rho\\left\(\\bar\{\\mathbf\{A\}\}\\mathbf\{X\}\(t\)\\boldsymbol\{\\Theta\}\_\{s\}\\right\),\(21\)where𝚯s\\boldsymbol\{\\Theta\}\_\{s\}is a learnable weight matrix,ρ\(⋅\)\\rho\(\\cdot\)is a nonlinear activation function, and𝐇\(t\)∈ℝN×ds\\mathbf\{H\}\(t\)\\in\\mathbb\{R\}^\{N\\times d\_\{s\}\}is the spatial embedding matrix\.
### IV\-DTemporal Sequence Construction
The spatial embeddings obtained from the GNN are arranged into temporal sequences\. For each regionii, the length\-LLsequence is constructed as
𝐒i\(t\)=\[𝐡i\(t−L\+1\);…;𝐡i\(t\)\]∈ℝL×ds,\\mathbf\{S\}\_\{i\}\(t\)=\\left\[\\mathbf\{h\}\_\{i\}\(t\-L\+1\);\\dots;\\mathbf\{h\}\_\{i\}\(t\)\\right\]\\in\\mathbb\{R\}^\{L\\times d\_\{s\}\},\(22\)where𝐡i\(t\)\\mathbf\{h\}\_\{i\}\(t\)denotes theiith row of𝐇\(t\)\\mathbf\{H\}\(t\)\. Thus,𝐒i\(t\)\\mathbf\{S\}\_\{i\}\(t\)captures the temporal evolution of regioniiafter spatial information from neighboring regions has been incorporated\.
### IV\-ETransformer\-Based Temporal Memory
To model long\-range temporal dependencies, we use a Transformer encoder as the temporal memory module\. Unlike recurrent architectures that pass information through a hidden state, the Transformer directly attends to all time steps within the historical window, enabling more flexible temporal reasoning\.
Each temporal sequence𝐒i\(t\)\\mathbf\{S\}\_\{i\}\(t\)is projected into a latent space and augmented with positional encodings to preserve temporal order\. Let𝐔i\(t\)∈ℝL×d\\mathbf\{U\}\_\{i\}\(t\)\\in\\mathbb\{R\}^\{L\\times d\}denote the resulting Transformer input\. Multi\-head self\-attention is computed as
MultiHead\(𝐐,𝐊,𝐕\)=Concat\(head1,…,headM\)𝐖O,\\mathrm\{MultiHead\}\(\\mathbf\{Q\},\\mathbf\{K\},\\mathbf\{V\}\)=\\mathrm\{Concat\}\(\\mathrm\{head\}\_\{1\},\\dots,\\mathrm\{head\}\_\{M\}\)\\mathbf\{W\}^\{O\},\(23\)whereMMis the number of attention heads and each head is given by
headm=softmax\(𝐐m𝐊m⊤dk\)𝐕m\.\\mathrm\{head\}\_\{m\}=\\mathrm\{softmax\}\\\!\\left\(\\frac\{\\mathbf\{Q\}\_\{m\}\\mathbf\{K\}\_\{m\}^\{\\top\}\}\{\\sqrt\{d\_\{k\}\}\}\\right\)\\mathbf\{V\}\_\{m\}\.\(24\)Here,𝐐m\\mathbf\{Q\}\_\{m\},𝐊m\\mathbf\{K\}\_\{m\}, and𝐕m\\mathbf\{V\}\_\{m\}are the query, key, and value projections for headmm, anddkd\_\{k\}is the key dimension\. This attention mechanism enables the model to emphasize historical patterns that are most relevant to future traffic demand, including periodic trends and abrupt workload changes\.
### IV\-FTraffic Forecasting Layer
Let𝐙i\(t\)\\mathbf\{Z\}\_\{i\}\(t\)denote the Transformer output sequence for regionii\. A temporal pooling operator𝒫\(⋅\)\\mathcal\{P\}\(\\cdot\)summarizes this sequence into a compact representation
𝐳i\(t\)=𝒫\(𝐙i\(t\)\)\.\\mathbf\{z\}\_\{i\}\(t\)=\\mathcal\{P\}\\\!\\left\(\\mathbf\{Z\}\_\{i\}\(t\)\\right\)\.\(25\)A fully connected forecasting layer then maps this representation to the multi\-horizon prediction vector
𝐲^i\(t\)=𝐖o𝐳i\(t\)\+𝐛o,\\hat\{\\mathbf\{y\}\}\_\{i\}\(t\)=\\mathbf\{W\}\_\{o\}\\mathbf\{z\}\_\{i\}\(t\)\+\\mathbf\{b\}\_\{o\},\(26\)where𝐲^i\(t\)=\[x^i\(t\+1\),…,x^i\(t\+H\)\]⊤∈ℝH\\hat\{\\mathbf\{y\}\}\_\{i\}\(t\)=\[\\hat\{x\}\_\{i\}\(t\+1\),\\dots,\\hat\{x\}\_\{i\}\(t\+H\)\]^\{\\top\}\\in\\mathbb\{R\}^\{H\}, and𝐖o\\mathbf\{W\}\_\{o\}and𝐛o\\mathbf\{b\}\_\{o\}are learnable output parameters\. Stacking𝐲^i\(t\)\\hat\{\\mathbf\{y\}\}\_\{i\}\(t\)over all regions gives the full set of forecasts\{𝐱^\(t\+h\)\}h=1H\\\{\\hat\{\\mathbf\{x\}\}\(t\+h\)\\\}\_\{h=1\}^\{H\}\.
### IV\-GModel Training
The proposed model is trained end\-to\-end by minimizing the multi\-horizon traffic prediction loss defined in Section[III](https://arxiv.org/html/2608.04075#S3)\. During training, historical traffic sequences are sampled using a sliding\-window strategy\. For a mini\-batchℬ\\mathcal\{B\}, the loss can be written as
ℒ\(Θ\)=1\|ℬ\|H∑t∈ℬ∑h=1H‖𝐱^\(t\+h\)−𝐱\(t\+h\)‖1\.\\mathcal\{L\}\(\\Theta\)=\\frac\{1\}\{\|\\mathcal\{B\}\|H\}\\sum\_\{t\\in\\mathcal\{B\}\}\\sum\_\{h=1\}^\{H\}\\left\\\|\\hat\{\\mathbf\{x\}\}\(t\+h\)\-\\mathbf\{x\}\(t\+h\)\\right\\\|\_\{1\}\.\(27\)whereΘ\\Thetadenotes all learnable parameters\. Gradients are propagated through both the spatial GNN and the Transformer memory module, enabling joint optimization of spatial perception and temporal reasoning\.
### IV\-HComputational Considerations
The proposed architecture is scalable for traffic intelligence in the evaluated cluster\-level edge network\. Graph convolution is applied to a fully connected weighted adjacency matrix over theNNedge regions, which preserves pairwise geographic correlations among all region centroids\. Since the experimental graph contains only 25 clusters, the quadratic number of pairwise edges remains computationally manageable\. The Transformer memory is applied to fixed\-length historical windows and can be parallelized across regions\. This design makes the framework suitable for practical edge controllers when the number of regions and the history length are moderate\.
## VPerformance Evaluation
This section evaluates the proposed graph\-convolutional Transformer model for traffic intelligence in edge computing\. The evaluation focuses on traffic forecasting accuracy across multiple prediction horizons, training and testing behavior, explained variance, node\-level prediction trajectories, and the spatial structure of prediction errors\. All compared models use the same data split, input window, prediction horizon, and spatial graph representation so that differences can be attributed mainly to the temporal modeling component\.
### V\-AExperimental Configuration
#### V\-A1Implementation Environment
The experiments are implemented in Python using PyTorch for model training\. Data preprocessing and numerical analysis are performed with NumPy, pandas, SciPy, and Scikit\-learn\. Visualization and geospatial processing are supported by Matplotlib, Seaborn, Shapely, PyProj, and Cartopy\. This software stack is used consistently for all compared models\.
#### V\-A2Dataset
The experiments use the China Telecom Shanghai dataset111Available at:http://sguangwang\.com/TelecomDataset\.html, a public cellular network dataset collected in Shanghai over a six\-month period\. The raw dataset contains approximately6\.9×1066\.9\\times 10^\{6\}connection records associated with 3,233 base stations\. Each record includes user connection information, base\-station coordinates, and connection timestamps\. The dataset is suitable for traffic demand forecasting in edge computing because it contains both spatial heterogeneity in base\-station deployment and temporal variation in user activity\.
#### V\-A3Data Preprocessing
The raw records are transformed into a structured cluster\-level time series through four main steps\. First, records outside the Shanghai metropolitan region are removed using the longitude range\[120\.85∘E,122\.20∘E\]\[120\.85^\{\\circ\}\\mathrm\{E\},122\.20^\{\\circ\}\\mathrm\{E\}\]and latitude range\[30\.70∘N,31\.90∘N\]\[30\.70^\{\\circ\}\\mathrm\{N\},31\.90^\{\\circ\}\\mathrm\{N\}\]\. Empty columns are removed, timestamps are converted to datetime format, invalid sessions with negative duration are filtered out, and duplicated sessions are discarded\.
Second, unique base\-station locations are extracted by de\-duplicating geographic coordinates, resulting in 3,009 valid spatial sites\. Figure[3](https://arxiv.org/html/2608.04075#S5.F3)shows the spatial distribution of these sites\. Base stations are more concentrated in the urban core and become sparser toward peripheral areas, which is consistent with the heterogeneous traffic demand expected in a metropolitan cellular network\.
Figure 3:Spatial distribution of the 3,009 valid base\-station sites retained after preprocessing in the Shanghai metropolitan area\.Third,KK\-means clustering is applied to the valid base\-station coordinates to formKc=25K\_\{c\}=25edge service regions\. Each base station is assigned asite\_idand acluster\_id, and each cluster is represented by its centroid and the number of base stations it contains\. These clusters serve as the graph nodes used in the forecasting model\.
Figure 4:Spatial residual maps for GCN\-RNN, GCN\-GRU, and GCN\-Transformer\. Rows correspond to models and columns correspond to the current timestamp,h=10h\{=\}10, andh=20h\{=\}20\. Residuals are computed as prediction minus ground truth; red indicates over\-prediction, blue indicates under\-prediction, and dots mark cluster centroids\.Figure 5:Predicted and actual traffic workload trajectories for four representative spatial nodes at prediction horizonh=20h\{=\}20\. Values are shown on the log scale over sampled test sequences; closer overlap with the true curve indicates better long\-horizon tracking\.Fourth, session\-level records are aggregated into hourly cluster\-level traffic demand\. Sessions spanning multiple hourly slots are split according to their overlap with each slot\. The slot\-level records are then aggregated bycluster\_idandtime\_slotto compute traffic demand indicators such as the number of unique users, the number of connections, and total workload\. Missing cluster\-time combinations are completed to form a regular spatiotemporal panel\. Additional temporal and traffic workload features, including hour of day, day of week, weekend indicator, cyclic time features, average workload per site, and average session duration, are generated for model input\.
#### V\-A4Graph and Model Settings
A fully connected spatial graph is constructed over the 25 cluster centroids\. Each node corresponds to one edge service region, and each pair of distinct clusters is connected by a distance\-weighted edge\. Consistent with the graph construction in Section[IV](https://arxiv.org/html/2608.04075#S4), edge weights are computed from centroid distances and normalized to form the adjacency matrix used by the graph convolutional module\. The same fixed geographic graph is used for the proposed model and all baselines\.
Table[I](https://arxiv.org/html/2608.04075#S5.T1)summarizes the main model settings\. All models use a hidden dimension of 64, a 168\-hour historical input window, a 24\-hour forecasting horizon, and a dropout rate of 0\.2\. The Transformer model uses four attention heads\. These shared settings provide a controlled comparison among different temporal modeling modules\.
TABLE I:Hyperparameter settings of the compared models\.ModelHiddenHeadsWindowHorizonDropoutGCN\-Transformer644168 h24 h0\.2GCN\-RNN64–168 h24 h0\.2GCN\-LSTM64–168 h24 h0\.2GCN\-GRU64–168 h24 h0\.2
#### V\-A5Model Implementation
The proposed model follows the architecture described in Section[IV](https://arxiv.org/html/2608.04075#S4)\. After preprocessing, supervised samples are generated with a sliding\-window strategy\. For each mini\-batch, the input tensor has shapeB×W×N×FB\\times W\\times N\\times F, whereBBis the batch size,WWis the historical window length,NNis the number of spatial clusters, andFFis the number of node\-level features\. The prediction target has shapeB×H×NB\\times H\\times N, whereHHis the prediction horizon\.
The spatial encoder uses two graph convolution layers to propagate information over the normalized adjacency matrix\. In addition to the fixed geographic graph, a learnable adaptive adjacency component is included to capture possible data\-driven relationships not fully represented by distance alone\. The temporal module uses a two\-layer Transformer encoder with sinusoidal positional encoding\. Temporal attention pooling summarizes the encoded sequence, and a regression head produces multi\-horizon traffic demand forecasts for all clusters\.
#### V\-A6Baseline Models
The proposed GCN\-Transformer is compared with three recurrent graph\-based baselines that share the same spatial encoder but use different temporal modules\.GCN\-RNNuses a standard Elman recurrent network,GCN\-LSTMuses a long short\-term memory network, andGCN\-GRUuses a gated recurrent unit network\. All baselines use the same hidden dimension, input window, prediction horizon, dropout rate, optimizer, and data split as the proposed model\. This design keeps the spatial representation fixed and isolates the effect of temporal modeling\.
### V\-BForecasting Results
#### V\-B1Training and Testing Behavior
Figures[6](https://arxiv.org/html/2608.04075#S5.F6)and[7](https://arxiv.org/html/2608.04075#S5.F7)compare the training and testing MAE losses of the four models over 100 epochs\. All models reduce the training loss rapidly during the early epochs and then converge more gradually\. The GCN\-Transformer reaches the lowest training loss and also maintains the lowest testing loss after convergence, indicating that its improvement is not limited to fitting the training samples\. GCN\-GRU provides the strongest recurrent baseline, whereas GCN\-RNN and GCN\-LSTM converge to higher and more fluctuating testing losses\. These curves suggest stable optimization and provide a consistent basis for the horizon\-wise accuracy comparison\.
Figure 6:Training MAE loss of the compared models over 100 epochs\. Lower values indicate smaller multi\-horizon prediction errors on the training set\.Figure 7:Testing MAE loss of the compared models over 100 epochs\. Lower and more stable curves indicate better generalization under the selected test split\.
#### V\-B2Multi\-Horizon Accuracy
Figure[8](https://arxiv.org/html/2608.04075#S5.F8)compares the mean absolute error \(MAE\) of all models from 1\-hour to 24\-hour prediction horizons\. For all models, MAE increases quickly over the first several horizons and then changes more gradually, confirming that longer forecasts are more difficult\. The GCN\-Transformer achieves the lowest MAE at every plotted horizon\. Its advantage over GCN\-GRU is moderate but consistent, while its advantage over GCN\-RNN and GCN\-LSTM becomes more visible at medium and long horizons\. This pattern suggests that self\-attention helps the model retain temporally relevant information from the historical window, rather than depending only on recurrent state propagation\.
Figure 8:Horizon\-wise MAE comparison of GCN\-RNN, GCN\-LSTM, GCN\-GRU, and GCN\-Transformer over the 1–24 h forecasting range\. Lower MAE indicates higher forecasting accuracy\.
#### V\-B3Spatial Residual Analysis
Figure 9:Horizon\-wiseR2R^\{2\}comparison of GCN\-RNN, GCN\-LSTM, GCN\-GRU, and GCN\-Transformer over the 1–24 h forecasting range\. HigherR2R^\{2\}indicates greater explained variance\.Figure 10:Spatial distribution of predicted average traffic workload per site for GCN\-RNN, GCN\-GRU, and GCN\-Transformer\. Rows correspond to models and columns correspond to the current timestamp,h=10h\{=\}10, andh=20h\{=\}20; warmer colors indicate higher predicted traffic workload and dots mark cluster centroids\.Figure[4](https://arxiv.org/html/2608.04075#S5.F4)shows the spatial distribution of prediction residuals, defined as prediction minus ground truth, for GCN\-RNN, GCN\-GRU, and GCN\-Transformer at the current timestamp,h=10h\{=\}10, andh=20h\{=\}20\. Red regions indicate over\-prediction, whereas blue regions indicate under\-prediction\. At the current timestamp, all models show mixed residuals with localized positive and negative errors\. Ath=10h\{=\}10, the recurrent baselines exhibit broader positive residuals in the eastern part of the service area and stronger negative residuals in the northwest, indicating more spatially coherent bias\. The GCN\-Transformer still has local errors, but its residuals are less concentrated\. Ath=20h\{=\}20, the recurrent baselines show wider underestimation regions, while the GCN\-Transformer produces a more balanced residual field\. These maps suggest that the Transformer improves not only aggregate error, but also the spatial distribution of prediction errors, although persistent residual patches show that long\-horizon spatial forecasting remains challenging\.
Overall, the results indicate that combining graph\-based spatial aggregation with Transformer\-based temporal memory improves forecasting stability and long\-horizon accuracy on the evaluated dataset\. The improvement is most visible when the forecast horizon increases and when traffic demand transitions occur across time\. These results support the use of attention\-based temporal memory for traffic\-aware proactive edge resource provisioning, while also indicating that further gains may be possible through richer contextual features or adaptive graph construction\.
### V\-CAdditional Evaluation Results
In addition to the main MAE and residual analyses, this subsection checks whether the same model ranking remains visible under explained variance, node\-level trajectories, and predicted spatial traffic workload fields\.
#### V\-C1R2R^\{2\}Performance Comparison
Figure[9](https://arxiv.org/html/2608.04075#S5.F9)reports theR2R^\{2\}scores of all four models over the 24\-hour prediction horizon\. HigherR2R^\{2\}indicates that a model explains more of the variance in the observed traffic workload\. For all models,R2R^\{2\}decreases from short to medium horizons and then stabilizes, which is consistent with the increasing difficulty of long\-horizon forecasting\. The GCN\-Transformer maintains the highestR2R^\{2\}across all horizons, while GCN\-GRU provides the strongest recurrent baseline\. GCN\-RNN and GCN\-LSTM obtain lower long\-horizon scores, with GCN\-LSTM showing the largest degradation near the final horizon\. This result is consistent with the MAE comparison and confirms that the observed improvement is not specific to a single error metric\.
#### V\-C2Per\-Node Prediction Trajectories
Figure[5](https://arxiv.org/html/2608.04075#S5.F5)compares predicted and actual traffic workload trajectories for four representative spatial nodes at prediction horizonh=20h\{=\}20\. All models capture the dominant periodic pattern, indicating that the historical window contains useful temporal regularity\. The differences appear mainly in the amplitude and timing of peaks and troughs\. GCN\-RNN tends to damp some high\-traffic periods, while GCN\-GRU and GCN\-LSTM provide stronger recurrent predictions\. The GCN\-Transformer often follows the phase and amplitude of the true trajectory more closely, especially around repeated daily transitions, but some abrupt peaks remain smoothed\. This indicates that the proposed model improves long\-horizon tracking while leaving room for future improvements in sharp peak prediction\.
#### V\-C3Spatial Prediction Analysis
Figure[10](https://arxiv.org/html/2608.04075#S5.F10)visualizes the predicted average traffic workload at the current timestamp,h=10h\{=\}10, andh=20h\{=\}20\. All models identify the main high\-traffic region near the central part of the service area, which shows that the shared graph encoder captures the dominant spatial structure\. Differences appear in how each model preserves the intensity and gradients of this hotspot across horizons\. The GCN\-Transformer produces a more coherent high\-traffic region and smoother surrounding gradients, especially at the longer horizon\. The recurrent baselines capture the general location of traffic demand but show more attenuation or distortion in some regions\. This spatial prediction view supports the residual analysis and indicates that temporal modeling affects the quality of spatial traffic workload fields, even when the graph encoder is shared\.
## VIConclusions
In this paper, we investigated traffic intelligence as a spatiotemporal learning problem for edge computing systems\. To address the joint challenges of spatially coupled service regions and long\-horizon traffic dynamics, we proposed a graph\-based Transformer memory framework that separates spatial perception from temporal reasoning\. The graph convolutional component captures correlations among edge service regions through geographic and adaptive adjacency relationships, while the Transformer\-based memory module models temporal dependencies across historical traffic workload sequences\.
Experimental results on a real cellular network dataset demonstrate that the proposed GCN\-Transformer consistently outperforms recurrent graph\-based baselines, including GCN\-RNN, GCN\-LSTM, and GCN\-GRU\. The advantage is especially clear at longer prediction horizons, where recurrent models are more likely to lose important historical information or underestimate traffic recovery\. The residual and spatial prediction analyses further show that the Transformer memory module produces more coherent spatial traffic patterns and better captures transitions between low\-activity and high\-activity periods\.
These findings indicate that attention\-based temporal memory is a useful mechanism for traffic\-aware proactive edge resource management\. More accurate long\-horizon traffic forecasting can help edge controllers allocate resources ahead of traffic changes, reduce overload risk, and improve the reliability of latency\-sensitive services\. Future work will extend this framework by incorporating additional contextual information, such as mobility traces, service types, and event\-driven traffic changes, and by integrating the forecasting model with online resource allocation policies in dynamic edge environments\.
## References
- \[1\]D\. Xu, T\. Li, Y\. Li, X\. Su, S\. Tarkoma, T\. Jiang, J\. Crowcroft, and P\. Hui, “Edge intelligence: Empowering intelligence to the edge of network,”*Proceedings of the IEEE*, vol\. 109, no\. 11, pp\. 1778–1837, 2021\.
- \[2\]J\. Peng, H\. Xing, X\. Chen, Y\. Li, Y\. Cui, D\. Zheng, L\. Ale, and L\. Feng, “Security enhanced computation offloading for collaborative inference at semantic\-communication\-empowered edge,”*IEEE Transactions on Mobile Computing*, vol\. 24, no\. 9, pp\. 8071–8088, 2025\.
- \[3\]L\. Ale, N\. Zhang, S\. A\. King, and D\. Chen, “Empowering generative AI through mobile edge computing,”*Nature Reviews Electrical Engineering*, vol\. 1, no\. 7, pp\. 478–486, 2024\. \[Online\]\. Available:http://dx\.doi\.org/10\.1038/s44287\-024\-00053\-6
- \[4\]M\. Patel, Y\. Hu, P\. Hédé, J\. Joubert, C\. Thornton, B\. Naughton,*et al\.*, “Mobile\-edge computing \- introductory technical white paper,” Mobile\-edge Computing \(MEC\) industry initiative,” White Paper, Sep\. 2014\.
- \[5\]S\. Deng, Z\. Xiang, J\. Taheri, M\. A\. Khoshkholghi, J\. Yin, A\. Y\. Zomaya, and S\. Dustdar, “Optimal application deployment in resource constrained distributed edges,”*IEEE Transactions on Mobile Computing*, vol\. 20, pp\. 1907–1923, May\. 2021\.
- \[6\]F\. Sun, P\. Wang, J\. Zhao, N\. Xu, J\. Zeng, J\. Tao, K\. Song, C\. Deng, J\. C\. Lui, and X\. Guan, “Mobile data traffic prediction by exploiting time\-evolving user mobility patterns,”*IEEE Transactions on Mobile Computing*, vol\. 21, no\. 12, pp\. 4456–4470, 2022\.
- \[7\]T\. Wu, X\. Fan, H\. Wei, Y\. Qu, C\. Xiang, P\. Yang, and F\. Wu, “Predictive service provisioning with online learning in wireless edge networks,”*IEEE Transactions on Mobile Computing*, vol\. 23, no\. 5, pp\. 4076–4091, 2024\.
- \[8\]T\. L\. Duc, R\. G\. Leiva, P\. Casari, and P\.\-O\. Östberg, “Machine learning methods for reliable resource provisioning in edge\-cloud computing: A survey,”*ACM Comput\. Surv\.*, vol\. 52, no\. 5, Sept\. 2019\. \[Online\]\. Available:https://doi\.org/10\.1145/3341145
- \[9\]X\. Zhang and S\. Debroy, “Resource management in mobile edge computing: A comprehensive survey,”*ACM Comput\. Surv\.*, vol\. 55, no\. 13s, July 2023\. \[Online\]\. Available:https://doi\.org/10\.1145/3589639
- \[10\]L\. Ale, N\. Zhang, S\. A\. King, and J\. Guardiola, “Spatio\-temporal bayesian learning for mobile edge computing resource planning in smart cities,”*ACM Transactions on Internet Technology*, vol\. 21, Aug\. 2021\.
- \[11\]C\. Zhang, H\. Zhang, J\. Qiao, Z\. Li, and M\.\-S\. Alouini, “Tides: Traffic intelligence with deepseek\-enhanced spatial–temporal prediction,”*IEEE Journal on Selected Areas in Communications*, vol\. 44, pp\. 2544–2558, 2026\.
- \[12\]C\. Zhang, H\. Zhang, S\. Dang, B\. Shihada, and M\.\-S\. Alouini, “Gradient compression and correlation driven federated learning for wireless traffic prediction,”*IEEE Transactions on Cognitive Communications and Networking*, vol\. 11, no\. 4, pp\. 2246–2258, 2025\.
- \[13\]L\. Ale, N\. Zhang, H\. Wu, D\. Chen, and T\. Han, “Online proactive caching in mobile edge computing using bidirectional deep recurrent neural network,”*IEEE Internet of Things Journal*, vol\. 6, no\. 3, pp\. 5520–5530, 2019\.
- \[14\]J\. Wang, J\. Tang, Z\. Xu, Y\. Wang, G\. Xue, X\. Zhang, and D\. Yang, “Spatiotemporal modeling and prediction in cellular networks: A big data enabled deep learning approach,” in*IEEE INFOCOM 2017 \- IEEE Conference on Computer Communications*, 2017, pp\. 1–9\.
- \[15\]Y\. Yao, B\. Gu, Z\. Su, and M\. Guizani, “MVSTGN: A multi\-view spatial\-temporal graph network for cellular traffic prediction,”*IEEE Transactions on Mobile Computing*, vol\. 22, no\. 5, pp\. 2837–2849, May 2023\.
- \[16\]F\. Xu, Y\. Li, H\. Wang, P\. Zhang, and D\. Jin, “Understanding mobile traffic patterns of large scale cellular towers in urban environment,”*IEEE/ACM Trans\. Netw\.*, vol\. 25, no\. 2, p\. 1147–1161, Apr\. 2017\. \[Online\]\. Available:https://doi\.org/10\.1109/TNET\.2016\.2623950
- \[17\]C\. Zhang and P\. Patras, “Long\-term mobile traffic forecasting using deep spatio\-temporal neural networks,” in*Proceedings of the Eighteenth ACM International Symposium on Mobile Ad Hoc Networking and Computing*, ser\. Mobihoc ’18\. New York, NY, USA: Association for Computing Machinery, 2018, p\. 231–240\. \[Online\]\. Available:https://doi\.org/10\.1145/3209582\.3209606
- \[18\]J\. L\. Elman, “Finding structure in time,”*Cognitive Science*, vol\. 14, pp\. 179–211, Mar\. 1990\.
- \[19\]S\. Hochreiter and J\. Schmidhuber, “Long short\-term memory,”*Neural Computation*, vol\. 9, no\. 8, pp\. 1735–1780, 1997\.
- \[20\]J\. Chung, C\. Gulcehre, K\. Cho, and Y\. Bengio, “Empirical evaluation of gated recurrent neural networks on sequence modeling,” Sep\. 2014\. \[Online\]\. Available:http://arxiv\.org/abs/1412\.3555
- \[21\]Z\. Wu, S\. Pan, G\. Long, J\. Jiang, and C\. Zhang, “Graph wavenet for deep spatial\-temporal graph modeling,” in*Proceedings of the Twenty\-Eighth International Joint Conference on Artificial Intelligence, IJCAI\-19*\. International Joint Conferences on Artificial Intelligence Organization, 7 2019, pp\. 1907–1913\. \[Online\]\. Available:https://doi\.org/10\.24963/ijcai\.2019/264
- \[22\]A\. Vaswani, N\. Shazeer, N\. Parmar, J\. Uszkoreit, L\. Jones, A\. N\. Gomez, Ł\. Kaiser, and I\. Polosukhin, “Attention is all you need,” in*Advances in Neural Information Processing Systems*, vol\. 30, 2017, pp\. 5998–6008\.
- \[23\]H\. Zhou, S\. Zhang, J\. Peng, S\. Zhang, J\. Li, H\. Xiong, and W\. Zhang, “Informer: Beyond efficient transformer for long sequence time\-series forecasting,”*Proceedings of the AAAI Conference on Artificial Intelligence*, vol\. 35, no\. 12, p\. 11106–11115, May 2021\. \[Online\]\. Available:https://ojs\.aaai\.org/index\.php/AAAI/article/view/17325
- \[24\]B\. Gu, J\. Zhan, S\. Gong, W\. Liu, Z\. Su, and M\. Guizani, “A spatial\-temporal transformer network for city\-level cellular traffic analysis and prediction,”*IEEE Transactions on Wireless Communications*, vol\. 22, no\. 12, pp\. 9412–9423, 2023\.
- \[25\]Y\. Hu, Y\. Zhou, J\. Song, L\. Xu, and X\. Zhou, “Citywide mobile traffic forecasting using spatial\-temporal downsampling transformer neural networks,”*IEEE Transactions on Network and Service Management*, vol\. 20, no\. 1, pp\. 152–165, 2023\.
- \[26\]J\. Gong, Y\. Liu, T\. Li, J\. Ding, Z\. Wang, and D\. Jin, “Sttf: A spatiotemporal transformer framework for multi\-task mobile network prediction,”*IEEE Transactions on Mobile Computing*, vol\. 24, no\. 5, pp\. 4072–4085, 2025\.
- \[27\]F\. Scarselli, M\. Gori, A\. C\. Tsoi, M\. Hagenbuchner, and G\. Monfardini, “The graph neural network model,”*IEEE Transactions on Neural Networks*, vol\. 20, pp\. 61–80, Jan\. 2009\.
- \[28\]K\. He, X\. Chen, Q\. Wu, S\. Yu, and Z\. Zhou, “Graph attention spatial\-temporal network with collaborative global\-local learning for citywide mobile traffic prediction,”*IEEE Transactions on Mobile Computing*, vol\. 21, no\. 4, pp\. 1244–1256, 2022\.
- \[29\]X\. Wang, Z\. Zhou, F\. Xiao, K\. Xing, Z\. Yang, Y\. Liu, and C\. Peng, “Spatio\-temporal analysis and prediction of cellular traffic in metropolis,”*IEEE Transactions on Mobile Computing*, vol\. 18, no\. 9, pp\. 2190–2202, 2019\.Similar Articles
PatchSTG: Scalable Spatiotemporal Graph Transformers for Traffic Forecasting on Irregular Sensor Networks
PatchSTG introduces a patch-based spatiotemporal graph Transformer for traffic forecasting on irregular sensor networks, achieving near-linear complexity while maintaining competitive performance.
Do We Really Need Transformers for Global Spatial Information Extraction in Traffic Forecasting?
This paper investigates whether complex transformer-based attention is necessary for global spatial information extraction in traffic forecasting, finding that simple global aggregation operators achieve comparable performance with lower computational complexity.
A Global-Local Graph Attention Network for Traffic Forecasting
Proposes a Global-Local Graph Attention Network (GLGAT) with pairwise encoding and event-based adjacency matrix for traffic forecasting, effectively capturing spatio-temporal correlations and achieving competitive performance on real-world datasets.
Graph-Conditioned Mixture of Graph Neural Network Experts for Traffic Forecasting
Proposes GC-MoE, a graph-conditioned mixture of experts framework for traffic forecasting that assigns each node a personalized combination of frozen pretrained spatio-temporal GNN experts based on graph topology and recent input, training only a lightweight routing module (∼17K parameters) and achieving competitive performance on four benchmarks.
STAGformer: A Spatio-temporal Agent Graph Transformer for Micro Mobility Demand Forecasting
STAGformer introduces a spatio-temporal agent graph transformer with linear complexity for bike-sharing demand forecasting, outperforming baselines on NYC and Chicago datasets.