Learning to Deaggregate: Large-scale Trajectory Generation with Spatial Priors

David Bergström, Mattias Tiger, Fredrik HeintzNeurIPS 2026

TL;DR

Generating realistic synthetic GPS trajectories—like how taxis weave through city streets or ships navigate harbors—usually requires feeding a model specific trip details that lock it to a single city. By separating where things move (a simple spatial heatmap) from how they move (temporal dynamics), the Temporal Deaggregation Diffusion Model (TDDM) learns universal physics of motion. Hand it an occupancy map of an entirely unseen city, and it will generate realistic, street-hugging traffic zero-shot—often beating models actually trained there.

What Problem Does This Paper Address?

Whether you are modeling pandemics, planning smart cities, or tracking maritime traffic, you need massive amounts of trajectory data. Unfortunately, real human mobility data is locked behind strict privacy, commercial, and security walls.

Generative AI offers a way to create synthetic stand-ins, but existing models face a frustrating catch-22. Unconditional models (like standard GANs or VAEs) often suffer from mode collapse—drawing paths straight through buildings or rivers—and offer zero control. Conditional diffusion models fix quality by leaning on heavy per-trip hints, like exact origin-destination pairs and departure times. That ties the model to the exact city it was trained on and risks memorizing private trips. How do we generate sharp, controllable trajectories that generalize to brand-new places without retraining?

Methods

The authors introduce TDDM (Temporal Deaggregation Diffusion Model), built on a simple factorization: separate spatial occupancy from temporal movement.

Figure 1: TDDM is trained on real 2D trajectories (left) to generate synthetic trajectories (right), conditioned on how likely it should be for the population of synthetic trajectories to occupy space on the 2D plane (spatial prior). The latter is represented as a discrete distribution over occupancy frequency, i.e., the marginal distribution over the trajectory probability distribution if integrating out time. This yields both high-fidelity in-distribution generalization (top) and out-of-distribution generalization (bottom), the latter when conditioning on a marginal distribution not part of the training data (dashed rectangle). Trajectory data from Porto, Portugal.

First, TDDM chops a map into local $3 \times 3$ km patches. Crucially, each patch undergoes canonicalization—a similarity transform that shifts, rotates, and scales coordinates into a normalized $[0, 1]^2$ box. To the neural network, an intersection in downtown Beijing now looks mathematically identical to one in San Francisco.

For each normalized patch, the authors integrate out time to create a spatial prior ($\Pi$): a $64 \times 64$ heatmap showing the aggregate probability of any trajectory occupying each grid cell.

Under the hood, TDDM uses standard DDPM diffusion with a Transformer encoder. What’s novel is what goes into the denoiser: tokens for the noisy trajectory steps, ViT-style patches of the spatial prior $\Pi$, and the diffusion step $t$. By training on pairs of individual trajectories and their regional heatmaps, the model implicitly learns marginal consistency—when you sample many individual trips conditioned on $\Pi$, they naturally add up to match $\Pi$. To generate an entire city, TDDM simply samples across a grid of overlapping regions weighted by how busy each region is.

TDDM architecture showing region canonicalization, spatial prior patching, and the Transformer denoiser.

Datasets

TDDM is evaluated on four public trajectory datasets spanning three continents and distinct movement domains (all resampled to 1 Hz; urban datasets are map-matched):

  • Geolife: 17,621 multi-modal trajectories (walking, biking, driving) largely in Beijing, China.
  • Porto: A year of urban trips from 442 taxis in Porto, Portugal.
  • Cabspotting: 30 days of trips from ~500 taxis in the San Francisco Bay Area, USA.
  • Brest: Maritime AIS vessel trajectories in the waters off Brest, France (testing non-road generalization).

No new datasets are introduced, though the authors add Speed-KL (step-wise speed distribution divergence) alongside seven established spatial, dynamic, and downstream evaluation metrics.

Key Insights and Ideas

  • Aggregate conditioning unlocks zero-shot transfer: Conditioning on population-level heatmaps rather than individual trip metadata acts as a powerful spatial anchor without leaking environment-specific IDs. Give TDDM a heatmap of an unseen city, and it "deaggregates" that static image back into plausible moving agents.
  • Learned physics beats post-hoc filtering: In ablations, taking an unconditional diffusion model and simply throwing away trajectories that wander off-road ("rejection sampling") fails to match TDDM. The spatial prior actively guides dynamics—like slowing down for turns at intersections—rather than just clipping bad samples.
  • Good foreign data can beat sparse local data: Remarkably, a TDDM trained only on Porto taxis generated better spatial coverage for Beijing, San Francisco, and Brest than models trained on a 25% slice of those target cities themselves—though local data still wins for getting city-specific trip lengths right.

Key Results

Averaged across all four datasets, TDDM outperforms five leading baselines (TimeGAN, TimeVAE, COSCI-GAN, Diffusion-TS, and DiffTraj) on all eight evaluation metrics:

  • Distributional Alignment: Achieves 0.368 symmetric KL divergence—roughly 3.4x lower than the best baseline, DiffTraj (1.259).
  • Dynamics: Slashes step-wise Speed-KL to 0.024 (vs. 0.565 for Diffusion-TS) and Length Error to 0.011 (vs. 0.185).
  • Downstream Utility: On Train-on-Synthetic, Test-on-Real (TSTR) next-step forecasting, TDDM achieves the lowest prediction error ($0.536 \times 10^{-3}$ vs. $0.864 \times 10^{-3}$ for DiffTraj).
  • Zero-Shot Transfer: Across all 12 city-to-city transfer pairs—including transferring between land taxis and ocean vessels—zero-shot TDDM beats every baseline trained directly on the target city on KL, JS, Density, and Pattern scores.
Figure 2: Comparison between original and synthetic trajectories for the Porto dataset. The top row plots the trajectories (all 100,000 real ones, 10,000 per model) and the bottom row the log-density of their points. The synthetic data of the proposed model, TDDM, (second column) most closely matches both the individual trajectory patterns and overall density distribution of the original data.

Limitations and Future Work

  • Traffic handedness & unseen modes: Canonicalization (shift, rotate, scale) preserves handedness; a model trained on right-hand driving will drive on the wrong side of the road in London. Nor can it invent dynamics it never saw (like a subway line).
  • Local horizon: Trips are generated inside fixed $3 \times 3$ km boxes, meaning cross-region phenomena—like a traffic jam spilling across town—aren't captured, and trip lengths don't automatically adapt when transferring between cities with very different scales.
  • Future directions: The authors suggest enriching $\Pi$ with directional, time-of-day, or trip-length priors, and—most excitingly—training a model to predict $\Pi$ directly from raw road-network maps so TDDM can populate cities where zero GPS data exists at all.

Summary updated

Abstract

Trajectories arise in many settings, including urban mobility, transportation, and maritime traffic. Existing generative models either offer no control over output distributions or rely on conditioning information specific to each individual trajectory, such as its origin and destination, distance, or departure time. This sample-specific conditioning limits controllability and ties the model to the environment where those statistics were observed. We propose to separate _where_ movement occurs from _how_ it unfolds: regional movement is summarized by a spatial prior $\Pi$, a marginal distribution of occupancy aggregated over many trajectories, and the generative model learns to draw samples that, conditioned on $\Pi$, aggregate to match it. We call this property _marginal consistency_, which turns the spatial prior into a controllable input, enabling zero-shot generation in unseen regions, cities, and even unseen domains by supplying only the target region's prior. The Temporal Deaggregation Diffusion Model (TDDM) realizes this idea. We evaluate it across four datasets spanning three continents and three modalities: multi-modal human mobility (Geolife), urban taxi (Porto, Cabspotting), and maritime traffic (Brest). TDDM improves fidelity and coverage over leading baselines and, zero-shot in new regions, cities, and domains, beats baselines trained there on most measures.
BibTeX
@inproceedings{bergstrom2026learning,
  author = {David Bergström and Mattias Tiger and Fredrik Heintz},
  title = {{Learning to Deaggregate: Large-scale Trajectory Generation with Spatial Priors}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=QTykg1wwRN},
}
Figure