LightPath: Lightweight and Scalable Path Representation Learning

Sean Bin Yang, Jilin Hu, Chenjuan Guo, Bin Yang 0002, Christian S. Jensen

Abstract

Path Representation Learning (PRL) is a fundamental task in intelligent transportation systems, enabling services such as travel time estimation, route ranking, and navigation. However, state-of-the-art Transformer-based models often suffer from quadratic computational complexity, making them difficult to deploy on resource-constrained edge devices or for long-distance routes. This paper introduces LightPath, a novel framework designed to make PRL both lightweight and scalable. By integrating a sparse auto-encoder with global-local knowledge distillation and relational reasoning, LightPath achieves state-of-the-art accuracy while reducing computational overhead by over 60%. Our results demonstrate that LightPath significantly outperforms existing baselines in both efficiency and predictive performance.

1. Introduction

In the context of smart city infrastructure, the ability to transform a sequence of road segments into a compact mathematical vector—the "essence" of a trip—is critical. These embeddings facilitate a wide range of downstream applications. While Transformer architectures have set new benchmarks for accuracy in PRL, their $O(N^2)$ complexity relative to path length $N$ presents a significant barrier to scalability. Furthermore, the massive size of these models often necessitates cloud-based processing, which raises concerns regarding the privacy of sensitive trajectory data.

LightPath addresses these challenges by introducing a framework that maintains the representational power of Transformers while drastically reducing their computational footprint. This enables "green computing" and local, privacy-preserving execution on mobile devices.

2. Methodology

LightPath utilizes three core innovations to bridge the gap between performance and efficiency:

2.1 Sparse Auto-encoder

To mitigate the quadratic complexity of self-attention, LightPath employs a sparsity operation. Instead of processing every edge in a path, the model randomly removes a significant portion of the input. A Transformer encoder processes this thinned-out sequence, and a lightweight decoder is then tasked with reconstructing the original, complete path. This approach forces the model to learn global connectivity patterns and structural dependencies rather than simply memorizing local sequences.

2.2 Relational Reasoning (RR)

To enhance the robustness of the learned embeddings without requiring human-labeled data, LightPath incorporates a self-supervised "dual-view" relational reasoning component. By creating two distinct sparse versions of the same path, the model is trained to recognize that both views represent the same underlying route. This cross-network reasoning ensures that the resulting embeddings are invariant to minor structural perturbations.

2.3 Global-Local Knowledge Distillation (GLKD)

The transition to a lightweight architecture is finalized through a teacher-student distillation process. A large, complex "teacher" model is first trained to establish a high-performance baseline. Subsequently, a much smaller "student" model—featuring fewer layers and attention heads—is trained to mimic the teacher. This distillation occurs at two levels:

  • Global Distillation: Matching the final path-level embedding.
  • Local Distillation: Aligning the correlations between individual edges within the path.

3. Experimental Setup

3.1 Datasets

The framework was rigorously evaluated on three datasets:

  • Aalborg, Denmark: A real-world dataset comprising approximately 39,000 paths derived from 180 million GPS records.
  • Chengdu, China: A real-world dataset featuring 50,000 paths.
  • Synthetic Dataset: To test scalability beyond typical urban trip lengths, the authors generated synthetic routes with lengths of 100, 150, and 200 edges.

3.2 Baselines

LightPath was compared against nine state-of-the-art baselines, including Toast, PIM, and HierETA, focusing on unsupervised and semi-supervised path representation tasks.

4. Results and Discussion

4.1 Accuracy and Predictive Performance

LightPath consistently outperformed all baselines in travel time estimation tasks. On the Aalborg dataset, LightPath achieved a Mean Absolute Error (MAE) of 85.76 seconds, significantly lower than the next best unsupervised baseline (102.09 seconds). This indicates that the compression and sparsity techniques do not sacrifice—and may even enhance—the model's ability to capture relevant features.

4.2 Computational Efficiency

The model demonstrated superior scalability, particularly as path lengths increased. For paths containing 200 edges, LightPath reduced training GFLOPs (Giga floating-point operations) by 2.54x compared to standard Transformer models. During the inference phase, LightPath was nearly 200% faster than competitors like PIM and Toast when processing long-distance trajectories.

4.3 Model Compression

The distillation process successfully compressed the "large cuboid" of the teacher model into a "slim rectangle" student model. This reduction in model size makes LightPath viable for deployment on edge devices, allowing for local computation that preserves user privacy while maintaining high accuracy.

5. Conclusion and Future Work

LightPath proves that sparsity can be a powerful regularizer rather than a data loss, compelling models to learn more fundamental structural patterns of road networks. While the current iteration uses random sparsity, future research could explore "informed" sparsity—prioritizing critical nodes like major intersections. Additionally, integrating real-time traffic dynamics and testing on diverse city topologies (e.g., grid-based vs. organic sprawl) will be essential for further generalizing the framework. LightPath represents a significant step toward making advanced path representation learning accessible for real-world, large-scale deployment.

Summary updated

BibTeX
@inproceedings{yang2023lightpath,
  author = {Sean Bin Yang and Jilin Hu and Chenjuan Guo and Bin Yang and Christian S. Jensen},
  title = {{LightPath: Lightweight and Scalable Path Representation Learning}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2023},
}
Figure