REFINE: Trajectory Representation Learning via Closed-Loop Transcription -- Extended Version

Sean Bin Yang, Ying Sun, Jilin Hu, Zongyi Xu, Kristian Torp, Hua Lu, Christian S. JensenarXiv 2026

TL;DR

REFINE introduces a closed-loop transcription framework for trajectory representation learning, bridging the gap between generative reconstruction and contrastive learning. By treating reconstructed trajectories as feedback signals, it eliminates the need for manual data augmentations while capturing both local road-network semantics and global spatio-temporal dependencies. Backed by control-theoretic convergence guarantees, REFINE achieves state-of-the-art performance across multiple downstream tasks on real-world datasets.

What Problem Does This Paper Address?

Trajectory Representation Learning (TRL) transforms raw GPS or road-network data into low-dimensional vector embeddings. These embeddings serve as the backbone for critical urban computing tasks like travel time estimation, trajectory classification, and similarity searches.

Currently, self-supervised TRL approaches fall into two main camps: discriminative methods (which use contrastive learning on manually designed data augmentations) and generative methods (which reconstruct randomly masked segments). The authors point out a fundamental flaw: both paradigms are open-loop. Generative methods use random masking that treats all road segments equally, ignoring network structure. Meanwhile, discriminative methods rely on brittle, heuristic data augmentations. This creates an artificial trade-off where a model excels at either generation or discrimination, but rarely both.

Figure 1: Architectures of the discriminative, generative, and hybrid paradigms, and of REFINE, adopting a closed-loop transcription paradigm, for trajectory representation learn- ing. Contrastive implies a contrastive loss, and Reconstruct implies a reconstruction loss. Symbols𝑇,𝑇′, and ˆ𝑇denote the input, masked, and reconstructed trajectories, respectively.

Methods

The authors propose REFINE (Representation lEarning Framework vIa closed-loop traNscription rEfinement), which reformulates TRL as a closed-loop transcription process inspired by feedback control theory.

The architecture consists of four main components:

  1. Importance-Aware Masking Strategy: Instead of masking segments uniformly at random, REFINE selectively masks "weak" segments based on static and dynamic criteria (road length, traversal frequency, and sampling point density). This preserves structurally critical road segments to stabilize training.
  2. Spatio-Temporal Embedding (STE): Uses a Graph Attention Network (GAT) to capture spatial road network constraints alongside a learnable sinusoidal time encoder to model temporal periodicity.
  3. Trajectory Encoder-Decoder: Built on a Transformer backbone. The encoder processes the masked trajectory, and the decoder attempts to reconstruct the full path.
  4. Closed-Loop Transcription Module: This is the core innovation. In the forward path, the model performs masked trajectory reconstruction. In the feedback path, the reconstructed trajectory embedding ($\widehat{Z}$) acts as a natural, noise-free positive view to contrast against the original trajectory embedding ($Z$). This completely eliminates the need for manual data augmentations.

Furthermore, the authors provide a rigorous control-theoretic analysis, proving linear convergence under the Polyak-Łojasiewicz (PL) condition and demonstrating mathematically how the closed-loop feedback prevents representation collapse.

Figure 2: Details of the proposed model REFINE. Our framework comprises a model input, spatio-temporal embedding (STE) module, encoder-decoder moudle, and closed-loop transcription module.

Datasets

The framework was evaluated on four massive, real-world trajectory datasets:

  • Porto: 859,986 taxi trajectories from Porto, Portugal.
  • Beijing: 889,306 trajectories from Beijing, China.
  • Xi'an: 1,420,054 trajectories from Xi'an, China.
  • Chengdu: 2,021,436 trajectories from Chengdu, China.

All GPS trajectories were map-matched to their respective road networks during preprocessing.

Key Insights and Ideas

  • The Feedback Loop as a Natural Regularizer: Instead of treating reconstruction and contrastive learning as competing objectives in a joint loss function, REFINE uses the generative output to drive the contrastive objective. This creates a self-correcting mechanism where generative expressiveness and discriminative power mutually reinforce each other.
  • Escaping Representation Collapse: In contrastive learning, models often "cheat" by collapsing all embeddings to a single point (mean collapse). The paper mathematically proves that REFINE's reconstruction residual provides a strict, sample-dependent "escape direction," ensuring the encoder parameter space remains highly expressive.
  • Not All Road Segments Are Equal: Random masking hurts trajectory learning because masking a major highway intersection destroys far more semantic context than masking a minor side street. Importance-aware masking ensures the model anchors its representations around highly informative hubs.

Key Results

REFINE was tested against 14 state-of-the-art baselines across three major downstream tasks:

  • Travel Time Estimation: REFINE achieved SOTA results on the Beijing, Xi'an, and Chengdu datasets. For example, on the Chengdu dataset, it reduced the Mean Absolute Error (MAE) to 1.003 minutes, outperforming the closest baseline (GTR at 1.119 minutes).
  • Trajectory Classification: It consistently delivered the highest accuracy and F1-scores across all datasets, proving its capability to learn highly discriminative features.
  • Trajectory Similarity Computation: Evaluated using Hausdorff and Fréchet distances, REFINE achieved the highest hit ratios (HR@1, HR@5, HR@10), showing that its embedding space accurately preserves true geometric and structural relationships.
  • Scalability: Increasing the encoder depth from 2 to 12 layers consistently boosted performance while parameter size grew linearly, demonstrating excellent scalability.

Limitations and Future Work

  • Road-Network Dependence: The current framework is tightly coupled with road-network-constrained trajectories (map-matched data). Adapting REFINE to free-space trajectories (e.g., flight paths, maritime routes, or open-space pedestrian movement) remains an open challenge.
  • Multimodal Expansion: While the model successfully integrates spatial and temporal data, the authors note that incorporating auxiliary modalities—such as textual descriptions or satellite imagery—is a promising direction for future closed-loop transcription models.

Summary updated

BibTeX
@misc{yang2026refine,
  author = {Sean Bin Yang and Ying Sun and Jilin Hu and Zongyi Xu and Kristian Torp and Hua Lu and Bin Yang and Christian S. Jensen},
  title = {{REFINE: Trajectory Representation Learning via Closed-Loop Transcription -- Extended Version}},
  year = {2026},
  eprint = {2609.07206},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.07206},
}
Figure