Abstract
Urban spatio-temporal prediction is crucial for informed decision-making, such as traffic management, resource optimization, and emergence response. Despite remarkable breakthroughs in pretrained natural language models that enable one model to handle diverse tasks, a universal solution for spatio-temporal prediction remains challenging. Existing prediction approaches are typically tailored for specific spatio-temporal scenarios, requiring task-specific model designs and extensive domain-specific training data. In this study, we introduce UniST, a universal model designed for general urban spatio-temporal prediction across a wide range of scenarios. Inspired by large language models, UniST achieves success through: (i) utilizing diverse spatio-temporal data from different scenarios, (ii) effective pre-training to capture complex spatio-temporal dynamics, (iii) knowledge-guided prompts to enhance generalization capabilities. These designs together unlock the potential of building a universal model for various scenarios. Extensive experiments on more than 20 spatio-temporal scenarios demonstrate UniST's efficacy in advancing state-of-the-art performance, especially in few-shot and zero-shot prediction.
Introduction
Urban spatio-temporal (ST) prediction is essential for modern "smart city" infrastructure, helping authorities manage traffic, optimize resources, and respond to emergencies. However, the field has long been plagued by task-specific silos. Typically, researchers must design and train bespoke models for every specific scenario—such as Beijing's taxi flow or London's air quality. These models are often data-hungry and fail to generalize; a model trained on traffic speed cannot easily be repurposed for cellular network usage. This leads to a massive data scarcity problem for cities or domains that lack extensive historical records.
The challenge in building a "universal" model lies in the diversity of ST data: different cities use different grid sizes, sampling frequencies, and exhibit vastly different underlying distributions. UniST aims to bridge this gap, creating a foundation model that learns the universal laws of human mobility and urban dynamics.
Methodology
UniST utilizes a Transformer-based encoder-decoder architecture and operates in two distinct stages:
1. Large-Scale Spatio-Temporal Pre-training
To handle varying data shapes, UniST employs Spatio-Temporal Patching, which breaks 4D urban data into 1D sequences compatible with Transformer architectures. The model uses Masked Token Modeling (MTM) with four specialized masking strategies to force the learning of different structural dependencies:
- Random Masking: Captures fine-grained local correlations.
- Tube Masking: Simulates missing sensors (spatial extrapolation).
- Block Masking: Simulates entire missing regions (spatial transfer).
- Temporal Masking: Compels the model to predict the future based solely on the past.
2. Spatio-Temporal Knowledge-Guided Prompt Learning
To adapt to new distributions (e.g., moving from traffic to population contexts), UniST incorporates a Prompt Network. This network leverages domain knowledge—spatial closeness, hierarchy, temporal closeness, and periodicity—to query a learnable Memory Pool. This pool retrieves relevant patterns learned during pre-training and injects them as prompts into the input space, effectively priming the model for the specific characteristics of the target dataset.
Experimental Evaluation
The authors evaluated UniST on an extensive collection of more than 20 spatio-temporal scenarios across multiple cities, including Beijing, New York, Nanjing, Shanghai, and Jinan. The domains include:
- Crowd Flow & Taxi/Bike Demand: TaxiBJ, BikeNYC, Crowd, TDrive.
- Traffic Speed: Over 12 distinct datasets (TrafficSH, TrafficJN, TrafficCD, etc.).
- Cellular Network Usage: Cellular (Nanjing).
- Dynamic Population: Environment data.
Results and Discussion
UniST consistently outperformed all baselines, including specialized models like STID and STNorm, across all 20+ datasets. It demonstrated significant advantages in several key areas:
- Few-Shot Performance: When restricted to only 1% of training data, UniST showed a massive lead over meta-learning and transfer-learning baselines.
- Zero-Shot Generalization: UniST achieved remarkable results on entirely unseen datasets, proving its utility as a true foundation model.
- Scalability: While performance generally improved with model size (tested up to 30M parameters), the researchers noted diminishing marginal returns, suggesting that current urban datasets may need even greater diversity to saturate larger models.
Key Insights
- Universal Patterns Exist: Despite surface-level differences between bike sharing and cellular usage, both are driven by human mobility. UniST proves that a model can learn shared underlying laws of urban physics.
- Prompts as Distribution Aligners: In UniST, spatio-temporal prompts tell the model where it is in terms of data distribution, allowing a single frozen backbone to adapt to wildly different urban contexts.
- The Power of Diverse Masking: The study shows that the method of masking matters. Tube and Block masking significantly improve spatial transfer and the handling of missing data compared to standard random masking.
Conclusion
UniST represents a significant step toward a universal foundation model for urban spatio-temporal prediction. By combining diverse pre-training with knowledge-guided prompts, it overcomes the limitations of task-specific models. Future work will look to incorporate graph-based road networks and irregular point-cloud data to further expand the model's universality.
Summary updated