arXiv:2610.24516cs.AIOct 2026

Manuscript Offprint

arXiv:2610.24516

M2NetM^2Net: Unifying Scale-Specific Structures and Prototype Decomposition for Spatial-Temporal Forecasting

Chengyang Zhou, Zijian Zhang, Hao Miao, Chunxu Zhang, Ziming Liu, Chao Tang, Juncheng Hu, Irwin King

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Chengyang Zhou 1,2,3^{1,2,3}, Zijian Zhang 1,3,†^{1,3,\dagger}, Hao Miao 4,†^{4,\dagger}, Chunxu Zhang 1,3^{1,3}, Ziming Liu 1^{1}, Chao Tang 1^{1}, Juncheng Hu 1,†^{1,\dagger}, Irwin King 5^{5}

1^{1}College of Computer Science and Technology, Jilin University, Changchun, China

2^{2}Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China

3^{3}Key Laboratory of Symbolic Computation and Knowledge Engineering of Ministry of Education, Jilin University, Changchun, China

4^{4}Shenzhen Institute for Advanced Study, University of Electronic Science and Technology of China, Shenzhen, China

5^{5}The Chinese University of Hong Kong, Hong Kong, China

{chengyang25, liuzm5523, tangzhao5523}@mails.jlu.edu.cn, {zhangzijian, zhangchunxu, jchu}@jlu.edu.cn

miaohao@uestc.edu.cn, king@cse.cuhk.edu.hk

Abstract—Spatial-temporal forecasting is pivotal for intelligent urban management yet remains challenging due to the intricate coupling of spatial dynamics and temporal non-stationarity. Existing approaches, while effective, often overlook two fundamental characteristics of real-world data: (1) Granularity-dependence, where dominant spatial correlations shift significantly across different time scales, and (2) Signal entanglement, where global common patterns are inextricably mixed with node-specific disturbances. In this paper, we propose a novel framework named M2NetM^{2}Net (Multi-Scale Masked attention and Prototype network) to unify scale-specific structural learning and semantic decomposition. First, to capture the evolution of spatial dependencies, we introduce a Multi-Scale Masked attention mechanism. By downsampling temporal features into multiple resolutions, we dynamically generate scale-adaptive spatial masks, allowing the model to distinguish between micro-scale physical neighbors and macro-scale functional correlations. Second, to disentangle unique variations from shared trends, we propose a Prototype Residual Learning module. It retrieves global common patterns from a momentum-updated prototype bank and subtracts them from node representations, explicitly forcing the network to model the residual unique deviations. By integrating these two orthogonal views, i.e., structural multiscaling and semantic decomposition, our approach effectively isolates valid spatial-temporal signals from noise. Extensive experiments on real-world datasets demonstrate that M2NetM^{2}Net outperforms state-of-the-art baselines on extensive empirical verifications.

Index Terms—Spatial-temporal forecasting, Disentanglement learning, Traffic forecasting.

I. INTRODUCTION

The rapid deployment of sensing infrastructures and Internet-of-Things (IoT) devices has generated massive volumes of traffic data in modern cities [1], [2]. Effectively storing, managing, and analyzing these continuously collected spatial-temporal observations is critical for a variety of urban applications, including traffic management [3]–[6], congestion

Figure

(a) Node distribution.

(b) Node similarity (5-min).

(c) Node similarity (40-min).

Fig. 1: Spatial relation visualization of PEMS08. Adjacent nodes (e.g., 74 and 75) exhibit high spatial correlation at both scales. Coarse temporal scale (c) captures more long-range, non-adjacent relationships (e.g., nodes 80–115) compared to fine-grained scale (b).

mitigation [7], [8], and route planning [9]–[12]. As a result, modern spatial-temporal database systems and urban data management platforms have become essential infrastructures for handling large-scale traffic data [13]. Among the core functionalities supported by these database systems, traffic flow forecasting [8], [14]–[17], which predicts future traffic conditions based on historical time series [3], [18], serves

†^{\dagger} Corresponding author: Zijian Zhang, Hao Miao and Juncheng Hu as a fundamental data management task, enabling proactive decision making and intelligent transportation services [19], [20]. This task is challenging because traffic dynamics are governed by a complex interplay of factors, including spatial correlations embedded in road networks and non-stationary temporal evolution of traffic states [21], [22]. Accurately capturing these dual dependencies is critical for database-driven analytics, enabling decision-makers to optimize resource allocation and deploy proactive congestion control mechanisms.

The evolution of spatial-temporal forecasting has been characterized by the pursuit of more expressive representations for these dual dependencies. Early approaches, e.g., GWNet [23] and AGCRN [24], established a unified foundation by integrating adaptive graph learning with Recurrent Neural Networks. Recently, hybrid architectures, e.g., STAEformer [25], PDFformer [26], and D2STGNN [27], have pushed performance boundaries by employing Transformer-based attention mechanisms or disentangled representation learning.

Despite the promising performance of these advanced models, they still rely on spatial dependencies at a single temporal resolution, i.e., either through a fixed graph structure or an adaptive matrix applied to the entire time series. This design implicitly assumes that spatial correlations remain constant regardless of temporal granularity, overlooking a critical characteristic: the dominant spatial dependencies shift significantly across different time scales.

However, in reality, the effective spatial structure is inherently dependent on temporal granularity. As illustrated in Figure 1, we visualize the spatial relationship among nodes, as shown in subfigure (a). To illustrate the spatial relationship, we calculate Dynamic Time Warping (DTW) [28] similarity of traffic nodes in the PEMS08 dataset under different time intervals, e.g., 5-min interval in subfigure (b) and 40-min interval in subfigure (c).

At a fine scale in Figure 1 (b), spatial dependencies are dominated by physical proximity. For instance, adjacent Nodes 74 and 75 exhibit high similarity, while distant nodes show weak correlations. Conversely, at a coarse scale in Figure 1 (c), macroscopic functional similarities emerge. Geographically distant nodes (e.g., Nodes from 80 to 115) that appear unrelated in the fine-scale view exhibit strong correlations. This is likely because they share similar functional roles (e.g., suburban arterials) and synchronize during tidal commuting hours. Existing methods, by ignoring this “granularity-dependent” nature of spatial topology, fail to capture these diverse interactions simultaneously. They either overfit local physical neighbors or miss the distant functional correlations that only emerge at coarser temporal scales.

Beyond spatial scaling, existing GCN-based spatial learners face a fundamental challenge in processing signal composition. Real-world traffic data is a superposition of globally shared patterns (e.g., daily commuting fluctuation) and unique local variations (e.g., accidents or sudden congestion). While shared patterns facilitate generalization, unique disturbances are crucial for precise node-level forecasting. However, standard GCNs propagate information through neighborhood aggregation, which tends to mix these heterogeneous signals into an entangled representation. Consequently, node representations often become biased toward dominant shared trends, causing unique, transient dynamics to be “drowned out.” This over-smoothing phenomenon degrades the model’s ability to capture fine-grained heterogeneity, which is essential for robustness against non-stationary events.

To address these challenges, we propose a unified framework M2NetM^{2}Net that synergizes multi-scale structural modeling with prototype-based residual decomposition. First, to resolve the scale-effect issue, we introduce a Multi-Scale Masked Attention (MSMA) mechanism. By downsampling temporal features into multiple resolutions, MSMA generates granularity-specific spatial masks. This allows the model to explicitly attend to physical neighbors at fine scales and functional correlations at coarse scales, as observed in our preliminary analysis. Second, to resolve the signal entanglement, we design a Prototype Residual Learning (PRL) module. Instead of simple aggregation, we maintain a momentum-updated prototype bank to encode global commonalities. We then adopt a “subtract-to-refine” strategy: extracting unique node representations by subtracting the prototype-aligned context from the node’s features. This explicitly preserves local deviations against over-smoothing. To ease the reproducibility, we release our implementation code online 1^{1}.

Our main contributions are summarized as follows:

• We identify that spatial correlations are not one-fold but vary significantly with temporal granularity. We validate that coarse-scale observations reveal long-range functional dependencies often missed by fine-scale views.

• We propose M2NetM^{2}Net, which integrates Multi-Scale Masked Attention to capture dynamic spatial structures and a Prototype Residual Learning module to explicitly disentangle unique local variations from global trends.

• Extensive experiments on 5 real-world datasets demonstrate that M2NetM^{2}Net achieves state-of-the-art performance, validating the effectiveness of coupling scale-specific spatial views with residual-based signal decomposition.

References (57)