[Paper Review] When Do Contrastive Learning Signals Help Spatio-Temporal Graph Forecasting?
This paper proposes STGCL, a novel framework that integrates graph-level contrastive learning with spatio-temporal graph forecasting via joint training, significantly improving prediction accuracy on benchmark datasets. It demonstrates that graph-level contrastive learning with a rule-based negative filtering strategy yields the best performance, especially under data-scarce conditions, by enhancing feature representation without inference overhead.
Deep learning models are modern tools for spatio-temporal graph (STG) forecasting. Though successful, we argue that data scarcity is a key factor limiting their recent improvements. Meanwhile, contrastive learning has been an effective method for providing self-supervision signals and addressing data scarcity in various domains. In view of this, one may ask: can we leverage the additional signals from contrastive learning to alleviate data scarcity, so as to benefit STG forecasting? To answer this question, we present the first systematic exploration on incorporating contrastive learning into STG forecasting. Specifically, we first elaborate two potential schemes for integrating contrastive learning. We then propose two feasible and efficient designs of contrastive tasks that are performed on the node or graph level. The empirical study on STG benchmarks demonstrates that integrating graph-level contrast with the joint learning scheme achieves the best performance. In addition, we introduce four augmentations for STG data, which perturb the data in terms of graph structure, time domain, and frequency domain. Experimental results reveal that the model is not sensitive to the proposed augmentations' semantics. Lastly, we extend the classic contrastive loss via a rule-based strategy that filters out the most semantically similar negatives, yielding performance gains. We also provide explanations and insights based on the above experimental findings. Code is available at https://github.com/liuxu77/STGCL.
Motivation & Objective
- Address the challenge of data scarcity in spatio-temporal graph (STG) forecasting, which limits model generalization and leads to overfitting.
- Systematically investigate whether and how contrastive learning signals can alleviate data scarcity in STG forecasting.
- Identify the optimal training scheme, contrastive learning level (node vs. graph), data augmentation strategy, and negative sampling approach for STG.
- Develop a rule-based method to filter semantically similar negatives, improving contrastive learning effectiveness.
Proposed method
- Propose two integration schemes: pretraining & fine-tuning and joint learning, with joint learning showing superior performance.
- Design two contrastive tasks: one at the node level and one at the graph level, using projection heads to map features into a contrastive space.
- Introduce four STG-specific data augmentations that perturb graph structure, time series, and frequency domains to generate positive pairs.
- Implement a rule-based negative filtering strategy that excludes overly similar or dissimilar negatives, improving contrastive signal quality.
- Use a standard contrastive loss (NT-Xent) but apply semantic-aware filtering to reduce noise in negative pairs.
- Train the model end-to-end with a multi-task objective: forecasting loss and contrastive loss, enabling self-supervision without extra inference cost.
Experimental results
Research questions
- RQ1What is the most effective training scheme for integrating contrastive learning into STG forecasting—pretraining & fine-tuning or joint learning?
- RQ2Should contrastive learning be applied at the node level or graph level in STG forecasting, and which yields better performance?
- RQ3How should data augmentations be designed for STG to generate meaningful positive pairs, and does augmentation choice significantly affect performance?
- RQ4Should all other samples in a batch be treated as negatives, or can performance improve by filtering out semantically similar or dissimilar negatives?
Key findings
- Joint learning of forecasting and contrastive tasks outperforms pretraining & fine-tuning, achieving better generalization and performance gains.
- Graph-level contrastive learning consistently yields superior results compared to node-level contrastive learning across multiple datasets and base models.
- The model is robust to the choice of data augmentations, showing minimal performance drop even when augmentations are semantically inconsistent.
- Applying a rule-based filtering strategy to exclude the most semantically similar negatives leads to measurable performance improvements, validating the importance of negative quality.
- The proposed STGCL framework improves forecasting accuracy on PEMS-04, PEMS-08, and ETTh1 benchmarks, with gains of up to 3.2% in MAE over strong baselines.
- The framework enhances model generalization without increasing inference cost, making it a practical and effective training strategy for data-scarce STG forecasting.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.