Diffusion Transformers as Open-World Spatiotemporal Foundation Models

Yuan Yuan, Chonghua Han, Jingtao Ding, Guozhen Zhang, Depeng Jin, Yong Li

TL;DR

UrbanDiT is a new spatiotemporal foundation model that scales up diffusion transformers to handle open-world urban computing. By unifying heterogeneous data types (like grids and graphs) and diverse tasks (like prediction and imputation) into a single sequential framework, it achieves state-of-the-art performance and exhibits powerful zero-shot generalization across different cities.

What Problem Does This Paper Address?

Modeling the complex spatiotemporal dynamics of an urban environment—such as traffic flow, taxi demand, and cellular traffic—is crucial for smart city applications. However, doing this globally is notoriously difficult because urban data is highly fragmented.

Data typically falls into two distinct structural silos: grid-based data (regular cells tracking crowd flows) and graph-based data (irregular networks tracking traffic speeds on roads). Furthermore, different cities have unique layouts and infrastructures. Existing deep learning models are usually specialized, trained from scratch for a single city, a single data type, or a single task (mostly forward prediction). This paper tackles the challenge of building a general-purpose, open-world foundation model capable of learning universal spatiotemporal patterns across diverse cities, data structures, and applications.

Figure 1: A diagram of UrbanDiT: a foundation model that integrates diverse data sources while addressing multiple tasks.

Methods

The authors introduce UrbanDiT, which leverages the generative power of diffusion processes combined with the scalability of Transformer architectures (Diffusion Transformers, or DiT). Its architecture relies on three key innovations:

  1. Data Unification via Sequential Patching: To feed heterogeneous data into a Transformer, UrbanDiT tokenizes both grid and graph data into a unified 1D sequential format. Grid data is processed using 3D Convolutional Neural Networks (3D CNNs) for spatiotemporal patching, while graph data uses a combination of 1D CNNs (for time) and Graph Convolutional Networks (GCNs) to aggregate spatial topology.
  2. Unified Masking for Multi-Task Learning: Instead of engineering different architectures for different tasks, UrbanDiT treats every application—forward prediction, backward prediction, temporal interpolation, spatial extrapolation, and spatiotemporal imputation—as a masked reconstruction problem.
  3. Unified Prompt Learning Framework: To guide the denoising process, the model injects two types of prompts:
  4. Data-Driven Prompts: It maintains three memory pools (key-value stores) capturing time-domain, frequency-domain, and spatial patterns across different datasets.
  5. Task-Specific Prompts: An attention mechanism generates prompts directly from the task's mask matrix to inform the model of what it needs to reconstruct.

For training and inference efficiency, UrbanDiT adopts a rectified flow approach (InstaFlow), which straightens the diffusion trajectory into an ordinary differential equation (ODE) path, drastically reducing the required sampling steps.

Figure 2: Illustration of the whole framework of UrbanDiT, including four key components: a) Unifying different urban spatio-temporal data types; b) The diffusion pipeline of our UrbanDiT; c) Different masking strategies to specify different tasks; d) Unified prompt learning with data-driven and task-specific prompts to enhance the denoising process.

Datasets

UrbanDiT was evaluated on a comprehensive benchmark spanning multiple domains and cities:

  • Grid-based Datasets: TaxiBJ (Beijing taxi flow), FlowSH (Shanghai mobility flow), TaxiNYC (NYC taxi flow), CrowdNJ (Nanjing crowd flow), PopBJ (Beijing crowd flow), and PopSH (Shanghai dynamic population).
  • Graph-based Datasets: SpeedSH (Shanghai traffic speed), SpeedBJ (Beijing traffic speed), and SpeedNJ (Nanjing traffic speed).

Key Insights and Ideas

  • The Power of the Mask: Framing distinct spatiotemporal tasks purely as different masking configurations allows a single model architecture to excel at completely different tasks without task-specific fine-tuning.
  • Frequency-Domain Prompts Matter Most: In their ablation studies, the authors found that removing the frequency-domain prompt degraded performance more than removing spatial or temporal prompts. This highlights the importance of periodic urban cycles (e.g., rush hours, weekly patterns) in foundation models.
  • Rectified Flow for Speed: Traditional diffusion models are notoriously slow due to iterative sampling. By utilizing rectified flow, UrbanDiT hits an optimal accuracy-efficiency balance at just 20 inference steps, achieving a 25× speedup over standard DDPM approaches.

Key Results

  • State-of-the-Art Prediction: UrbanDiT achieved a 11.3% relative improvement in Mean Absolute Error (MAE) for forward prediction on grid data compared to the next-best baseline (CSDI). It also dominated graph-based traffic speed datasets.
  • Zero-Shot Superiority: In zero-shot settings (evaluating on a target city without any local training data), UrbanDiT's performance frequently bypassed competing models that did have access to the training data.
Figure 4: Evaluation of UrbanDiT and baseline models in 5% and 1% few-shot scenarios on the PopSH dataset. The red dashed line indicates UrbanDiT’s zero-shot performance
  • Clear Scaling Laws: The authors verified that UrbanDiT scales effectively. When expanding the dataset size, the largest model variant (UrbanDiT-L) showed a significantly steeper performance improvement slope (0.011) compared to smaller variants, indicating strong foundation model properties.

Limitations and Future Work

While UrbanDiT represents a massive leap forward for open-world urban modeling, it currently focuses exclusively on human activity data (mobility, traffic, population flows). The authors note that a truly holistic urban foundation model must expand to incorporate environmental and climate variables, such as air pollution index dynamics, weather indicators, and microclimate variations.

Summary updated

BibTeX
@inproceedings{yuan2025diffusion,
  author = {Yuan Yuan and Chonghua Han and Jingtao Ding and Guozhen Zhang and Depeng Jin and Yong Li},
  title = {{Diffusion Transformers as Open-World Spatiotemporal Foundation Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=supy1n4Tev},
}
Figure