TrajMamba: An Efficient and Semantic-rich Vehicle Trajectory Pre-training Model
Authors: Yichen Liu
Yan Lin
Shengnan Guo
Zeyu Zhou
Youfang Lin
Huaiyu Wan
Venue: NeurIPS 2025 spotlight ()
Keywords: Trajectory Representation Learning
Spatio-Temporal Data Mining
Self-supervised
Primary area: applications
TL;DR: We propose a novel trajectory representation learning approach that efficiently learns travel semantics, including movement patterns and travel purposes, from vehicle trajectories.

Abstract: Vehicle GPS trajectories record how vehicles move over time, storing valuable travel semantics, including movement patterns and travel purposes. Learning travel semantics effectively and efficiently is crucial for real-world applications of trajectory data, which is hindered by two major challenges. First, travel purposes are tied to the functions of the roads and points-of-interest (POIs) involved in a trip. Such information is encoded in textual addresses and descriptions and introduces heavy computational burden to modeling. Second, real-world trajectories often contain redundant points, which harm both computational efficiency and trajectory embedding quality. To address these challenges, we propose TrajMamba, a novel approach for efficient and semantically rich vehicle trajectory learning. TrajMamba introduces a Traj-Mamba Encoder that captures movement patterns by jointly modeling both GPS and road perspectives of trajectories, enabling robust representations of continuous travel behaviors. It also incorporates a Travel Purpose-aware Pre-training procedure to integrate travel purposes into the learned embeddings without introducing extra overhead to embedding calculation. To reduce redundancy in trajectories, TrajMamba features a Knowledge Distillation Pre-training scheme to identify key trajectory points through a learnable mask generator and obtain effective compressed trajectory embeddings. Extensive experiments on two real-world datasets and three downstream tasks show that TrajMamba outperforms state-of-the-art baselines in both efficiency and accuracy.

TrajMamba: An Efficient and Semantic-rich Vehicle Trajectory Pre-training Model
Yichen Liu'; Yan Lin"; Shengnan Guol, Zeyu Zhou', Youfang Lin Huaiyu Wan 141
SScoool of Computer Science and Technology, Beijing Jiaotong University, China *Department of Computer Science. Aalborg University, Denmark Key Laboratory of Big Data & Artificial Intelligence Transportation, Ministry of Education, China "Beijing Key Laboratory of Traffic Data Mining and Embodied Intelligence, China (liuyichen, guoshn, zeyuzhou, yflin, hywan] @bj edu. cn. lyan0cs aau.dk
Abstract
Vehicle GPS trajectories record how vehicles move over time, storing valuable travel semantics, including movement patterns and travel purposes. Learning travel semantics effectively and efficiently is crucial for real-world applications of tra- jectory data, which hindered by two major challenges. First, travel purposes are tied to the functions of the roads and points-of-interest (POIs) involved in trip. Such information encoded in textual addresses and descriptions and introduces heavy computational burden to modeling. Second, real-world trajectories often contain redundant points, which harm both computational efficiency and trajectory embedding quality. To address these challenges, we propose TrajMamba, novel approach for efficient and semantically rich vehicle trajectory learning. TrajMamba introduces Fraj-Mamba Encoder that captures movement patterns by jointly modeling both GPS and road perspectives trajectories, enabling robust represen- tations of continuous travel behaviors. It also incorporates Travel Purpose-aware Pre-training procedure to integrate travel purposes into the learned embeddings without introducing extra overhead embedding calculation. To reduce redun- dancy in trajectories, TrajMamba features a Knowledge Distillation Pre-training scheme to identify key trajectory points through learnable mask generator and obtain effective compressed trajectory embeddings. Extensive experiments on two real-world datasets and three downstream tasks show that TrajMamba outperforms state-of-ther tetthhe-rtt art baselines in both efficiency and accuracy.
Introduction
vehicle GPS trajectory a sequence of (location, time) pairs recording the movement of the vehicle during its trip from one location to another. Recent progress in intelligent traffic systems (ITS) has highlighted the value of these trajectories in revealing travel semantics, including movement patterns and travel purposes. These semantic insights support various spatio-temporal data mining
tasks, including trajectory prediction [38, 40 5. travel time estimation [45] 24 34 anomaly
detection [26] 15). trajectory similarity measurement 43 [7] and trajectory clustering [44). With
the increasing availability of vehicle GPS trajectories, a powerful trajectory learning model that can extract travel semantics with high efficiency becomes more and more essential in building ITS.
For the vehicle trajectory (7i, T2....: Ts) in Fig. [ where each point represents GPS coordinate at specific time and lies on one of four road segments C22 and Points and share the same
Both authors contributed equally this rescarch.
Corresponding author.
39th Conference on Neural Information Processing Systems (NcurIPS 2025).

---

road segment 62. Both GPS coordinates and road segments provide spatial information about the vehicle's 's position. Together, they reveal con-
Trajectoyy Point
Overpuss
Inseresi
es
Movemuent Behaviir
Park
tinuous movement patterns (e-g.. turning, ac- celerating, going straight), characterizing the vehicle's s travel from one location to another.
e2
Expressway
Tumning
c4
Arterial Road
Straght
Accelarating
Turning
Beyond movement patterns, travel purposes can be revealed by the functionalities of nearby road segments and POIs along trajectory. For exam- ple, the trajectory in Fig. D starts in residential area, follows an expressway. an overpass, and an arterial road, passes by a park and market, and ends at an office building, indicating commuting purpose.
Collector Road
Office
Roilkux
Local Roads
Figure 1: A trajectory of commuting work.
Considering that many real-world applications of trajectories demand precise and real-time decisions, it is desirable to develop a trajectory learning method that effectively and efficiently incorporates the above information. However, this goal is hindered by two key challenges.
First, extracting travel purposes can be computationally heavy. As discussed, the functions of POIs and roads traversed by trajectory indicate its travel purposes, but extracting these functions often requires incorporation of textual modality. Language models (LMs) [8 [[] can capture these functions from POI and road descriptions, a capability explored in few recent trajectory learning studies [47] [47. However, integrating LMs into standard trajectory learning models significantly increases computational costs, since LMs usually several magnitudes larger than standard trajectory learning models.
Second, redundant points in trajectories affect both efficiency and effectiveness. Vehicle GPS trajectories are usually sampled at a high frequency. This leads to real-world trajectories that often include redundant points, reducing encoding efficiency. For instance, points gathered during traffic stops or when vehicles maintain steady speeds may not provide useful information. Hence, it is beneficial to compress trajectories to improve both efficiency and effectiveness. Existing methods for trajectory compression mostly rely on rule-hased or geometric approaches (e.g.. Douglas-Peuckee (9), Visvalingam- Whyatt (37), which have high time complexities. A more efficient and learnable trajectory compression approach remains an open problem.
To overcome these issues, we propose Trajectory Mamba (TrajMamba), new method for efficient and semantic-rich vehicle trajectory learning. TrajMamba introduces three components to achieve its design goal. First, Traj-Mamba encoder jointly models GPS and road perspectives of trajectories. Second, a travel purpose-avee -aware pre-training procedure that integrates travel purposes into the trajectory embeddings without introducing extra overhead to the embedding calculation. Third, knowledge distillation pre-training strategy that locates key trajectory points through a learnable mask generator reduce redundancy and obtains effective compressed trajectory embeddings for downstream tasks. We conduct extensive experiments on two real-world datasets and three downstream tasks, showing that TrajMamba outperforms state-of-the-art baselines in both accuracy and efficiency. Our robust outcomes in these three tasks exhibit average enhancements of 18.28% 27.89%. 39%, and 17.68% respectively.
2 Related Work
Vehicle trajectory learning methods extract valuable information from vehicle trajectories to perform various tasks. These methods can be broadly categorized into end-to-end trajectory learning methods and pre-trained trajectory embeddings.
End-to-end Trajectory Learning Methods are tailored for one specific task and are typically trained with specific labels. According to different task types, end-to-ent end methods can be roughly divided trajectory classification methods [21 33 and
into: trajectory prediction methods II 99
28 40)
trajectory similarity measurement methods 42
46
While end-to-end methods are straightforward to
implement and offer certain advantages, they cannot be easily reused for other tasks. This necessitates designing, training, and storing separate models for each task, which can impact computational

---

resources and storage efficiency. Additionally, the effectiveness of end-to-end methods depends on the abundance of spee-ipe labels, which cannot always be guaranteed.
Pre-trained Trajectory Embeddings that can be utilized across various tasks have recently re- ceived increasing attention due to their ability address the limitations of end-to-end methods. This approach involves learning trajectory encoders that map vehicle trajectories into embedding
vectors, which can then be used with prediction modules. Earlier works [4 20 [2]
commonly
leveraged RNNs to reconstruct discrete or continuous trajectory features based on auto-encoding
frameworks [6], while methods like CTLE 23 and Toast [ regard trajectory points as tokens in a sentence and process them using Transformers [36] and Masked Language Model (MLM) tasks [8. TrajCL [2] and MMTEC [22] introduce contrastive learning [30] to train the models. Fur- thermore, recent methods combine multiple tasks to enhance their learning capability. START [18]
and JGRM 27 leverage both MI.M tasks and contrastive tasks, while LightPath [41 integrates reconstruction task with a contrastive task.
Despite the promising progress made by existing efforts, discussed in Section [ there are still challenges in efficiently extracting travel purposes and removing redundant and noisy points in learnable manner from vehicle trajectories due their inherent complexity.
3 Preliminaries
Road Network A road network is modeled as a directed graph G (V, Here, Vss set of nodes, with each node v; E representing an intersection between road segments or the end of a segment. is a set of edges, with each edge e, E & representing a road segment linking two nodes. An edge is defined by its starting and ending nodes, and textual description including the name and type of the (ey, Uk: Road).
road: E,
Vehicle Trajectory A vehiele trajectory is a sequence of timestamped locations, defined as (Ti, ......, Tw), where n is the number of points. Each point т; (g. e,, f;) consists of the GPS coordinates Si = (Ing,, lat;), road segment e;, and timestamp f,, representing the vehicles location at specific time. In this study, we use the term trajectory to refer to vehicle trajectory.
Point of Interest A point of interest (POI) is location with specific cultural, environmental, or economic importance. We represent POI as p. (gi; desc."r), where gi represents its coordinates, and desc POI a textual description that includes its name, type, and address.
Problem Statement Vehicle trajectory learning aims to construct a learning model fe. where θ is the set of learnable parameters. Given vehicle trajectory T, the model calculates its embedding vector as ET = (T). This embedding vector eт captures the travel semantics of T and can be used in subsequent applications by adding prediction modules.
4 Methodology
Fig. provides the overall framework of TrajMamba, and its pipeline is implemented in the following three steps: 1) Given a trajectory T, we introduce Traj-Mamba Encoder to generate its embedding vector to effectively capture movement patterns. 2) To efficiently perceive travel purposes, develop Travel Purpose-aware Pre-training to train the Traj-Mamba encoder by aligning the learned embedding with the road and POI views of TT which encode the travel purpose through road and POI textual encoders. After this pre-training, we fix the weights of the encoder and regard it as the teacher model for the next step. 3) To effectively reduce redundancy in T, apply the Knowledge Distillation Pre-training. It employs learnable mask generator to identify key trajectory points in T for compression, then aligns the compressed representation from teacher-initialized Traj-Mamba encoder with the full-trajectory embedding from the teacher model.
4.1 Mraja Encoder
To effectively capture movement patterns, we design the Traj-Mamba Encoder consisting of L. stacked Traj-Mamih blocks inspired by the Mamba2 structure [7]. shown Fig. each block employs two multi-input selective SSMs, namely GPS-SSM and Road-SSM, to capture long-term spatiotemporal

---

Mask Generator
Match
Match
Filter
Mamba
POIs
Trajectories
Road Network
Block
POI Textual
Road Textual
Encoder
Encoder
g
T
POI views
Ruad views
Pos+
Neg-
Post
Neg
Traj-Mamba Encoder
Load Weight
Traj-Mamba
Pull
Push apurt
Pull
Push apart
Encoder
together
together
Trujectory
Full-Trajectory Embedding
[C
embedding
(n) Travel Purpose-aware Pre-training
(b) Knowledge Distillation Pre-training
Figure 2: The framework of TrajMamba.
correlations in input trajectories with linear time complexity. This enables the encoder to jointly model GPS and road perspectives and achieve the interaction between them to fuse information.
Given trajectory T (T1, ................................ Tr), we first extract three features from each point for encod- ing its GPS perspective, including GPS coordi- nates, the time delta At, relative to (1, and the timestamp in minutes. For the road perspective, we extract four features, including the road ID, day-in-week, hour-in-day, and connteeii-hooue of each point. We then embed these features obtain GPS and road latent vector sequences Z 7 E R"* & as the inputs Z 2 to the first Traj-M Mamba block, where E represents the dimension of trajectory embeddings (see Ap- pendix
V-R
Real-SSM
B
x
#2
Conv
GPS-
yc
g
SSM
8,
Trj Mamba Block x
Figure 3: Structure of Trabaa blocks.
H for details). To model continuous movement behavior, we also compute the speed, acceleration, and movement angle of each point, which form high-order movement feature sequence S TR=x33 Next, explain the Traj-Mamba block, we use the i-th block as a representative example.
In the GPS-SSM branch, we first transform the input - through a linear layer, followed by ID causal convolution layer with SiLU activation This captures local dependencies between continuous features within GPS perspectives to complement the GPS-SSM, producing the input x E _ We then implement the GPS-SSM selection mechanism by constructing input- dependent parameters. Specifically, we randomly initialize the hidden state mapping matrix A R# as a learnable parameter of the block. We then use the high-order movement behavior feature sequence S to calculate the other three parameter matrices B, C, and A follows:
B Linear(ST). C Linear(ST). A a (Linear(ST) + ba),
where Linear represents linear projection, da denotes the Softplus activation, and by is the bias parameter of A. Here, B, C' E 1 N A E "x where N is the state dimension of GPS-SSM and H the number of heads. This parameterization extends the state space of GPS-SSM to incorporate high-order movement behaviors, enabling precise control over how trajectory movement behavior changes affect the selective processing of GPS input embeddings. For simplicity, we denote Eq. as: B, C. A Param(S1 ST). After parameterization, we process x. through GPS-SSM
to obtain the output vector YO E RRAXE A more detailed introduction to SSMs is provided in Appendix A

---

The Road-SSM branch follows an analogous process. The ipput 2 is processed through linear layer with SiLU activation to obtain x E R The state space of Road-SSM is extended to trajectory geographical space to capture how changes in trajectory movement details affect road input embeddings selection, implemented as B', C", A = Param(Y The Road-SSM output vector Y E _ is computed using the same methodology as GPS-SSM.
Finally, we obtain the output embeddings - Z of the i-th Traj-Mamba block as follows:
5 Liinear(RMSNon Y xx!),, z!- Linear(YY?)
Here, the dot-product gating mechanism with X enables the feature selection of Y at the road perspective level. z - maintain the same shape Z Z and subsequently become the inputs to the next block. After obtaining the outputs Zí. R of the last block, we concatenate them and apply mean pooling to derive the trajectory embedding zT R as the final output of the Traj-Mant Maaja encoder.
4.2 Travel Purpose-aware Pre-training
To extract travel purpose without adding extra computational load to Traj-Mamba encoder, we propose a Travel Purpose-aware Pre-training scheme. As shown in Fig. Pa. this approach first models both road and POI views of a trajectory using two textual encoders to extract travel purpose, then aligns these representations with Traj-Mamba encoder's output embeddings through contrastive learning.
Road and POI Views. Given trajectory T = (TI, .2....,.T....................... Tn)) and the road network G, we first identify the closest POI Pt to each trajectory point T; based on their geographical distance. Next, we obtain the initial textual embeddings Ze,, pp, E _ for each road segment e; and POI using shared pre-trained textual embedding module Exext. To further capture the semantic information of roads and POIs, we consider the local information from neighboring road segments and POIs as well as the global information from the origin TI and destination Tn of T, then aggregate them to update the textual embeddings Ze, and Zp., For each unique POI, we also use index-fetching embedding layer Ep,, to assign it a learnable index embedding. The above process can be expressed as:
Zo; = Ze, + Agg Road Road (Zeg Zoz Ze, E.) pp. = Zp. Agg (Zp, ppp xp li Nº) + (Pt).
(3)
where Road (.), Agg POL()) are aggregation functions, and NN,N,; denote the sets of neighboring nodes for e; and pi. respectively. Here we use the residual connection to preserve the raw textual information. More details for road/POI textual embeddings are shown in Appendix [ Finally, the embedding sequences (že,, bey...., = and (šp, ppp..... xp.)) 2-layer Mamba2 blocks followed by mean pooling, generating the road and POI views 27 B of T.
are processed through a pair of .Road _POI
Contrastive Learning. After representing travel purposes road and POI views, we align the output embeddings from Traj-Mamba encoder with these two views using contrastive learning. Given trajectory batch T = {T.) == of size B, we can obtain their embedding vectors from Traj-Mamba encoder as {z 12 Their road and POI views, as described above, are H. l==1 and {z T== For each trajectory T,, regard 2T, as the anchor, its road and POI views 2T, 2T, Rood
Road B
POl as the
positive samples, and zT, =2. of other trajectories within the batch as the negative samples.
Next, we apply the InfoNCE loss (30], denoted by CRoad _PP1,, Note that the temperature parameter directly optimized during training as oog-parametrrized multiplicative scalar [32]. The overall loss is a combination of the two losses, defined as LT ( (CRoad + CPOI).
4.3 Knowledge Distillation Pre-training
To further reduce redundancy in trajectories, we we employ Knowledge Distillation Pre-training strategy. As shown Fig. Ppp, we first apply a learnable mask generator for trajectory compression based on the underlying correlations of trajectory features. Next, we designate the travel purpose-aware pre-trained Traj-Mamba encoder as the teacher model and fix its weights, then load these weights to initialize a new encoder to generate embeddings for compressed trajectories. Subsequently, align
5

---

the compressed representation with the full-trajectory embedding from the teacher model to ensure the effectiveness of compression.
Mask Generator: Given a trajectory T= (m, 72..... T we first filter out explicit redundant points, including all intermediate points during vehicle stops and steady pace points the same road segment, through preprocessing. Next, we input the preprocessed trajectory T with length n' S into the learnable mask generator to remove the implicit redundancy using the derived mask m. Due to the heavy-tailedness of logical masks [39], we apply a sparse stochastic gate g(-) with intrinsic binary-skewed parameter 14 E R maintain feature selection sparsity and reduce the variance in the masks. Specifically, for each point 7.the of Tpre, the point-specific mask m, is calculated by m; = = = max(O, min(1, 14; + <)), where e ~ NN, (0) is random noise injected into each point during training and removed during testing, with 5 fixed throughout training. Considering the underlying temporal correlations of trajectory features, we extend the SiLU activation by using these correlations as temperature scaling in the Sigmoid function to construct the smooth μa as follows:
μ MeanPool(fi O Sigmoid (FPr))
(4)
where ü is randomly initialized learnable parameter. A lightweight Mamba block Mamba is used to efficiently capture the correlations of trajectory features. Finally, we filter 7 based on to obtain the compressed trajectory T. Subsequently, derive its compressed representation γ as the trajectory embedding for various downstream tasks.
feed T into the Traj-Mamba encoder and
Pre-training Loss. Given a trajectory batch T = {Ti) of size B, we can obtain their compressed {= and their full-trajectory embeddings from the teacher model as Z = { 1 Next, we align these embeddings through two optimization objectives. To maximize the information from Z contained in Z, apply the MEC loss
embeddings as Z = { |
[25) following the infomax principle:
B+ E K
(-1)++1 k
C MM = trace
Be Z)
(5)
where K is the order of the Taylor expansion and is the upper bound of the decoding error. This loss maximizes the entropy of embeddings Z while satisfying view consistency between Ž and Z (both derived from T), enhancing the generalization of the compressed representations across various downstream tasks. Additionally, we optimize the mask using the Gaussian error function (erf) to constrain the length of compressed trajectories, ensuring encoding efficiency. Formally:
Cipask = Mcan( + erf( (MT, MT, , )).
(6)
2
V28
where MT, is the mask generator's parameter for Ti calculated by Eq. 4 Finally, the overall loss is balanced combination of these two objectives, denoted as C' 2 (C C.pas).
5 Experiments
To evaluate the performance of our proposed model, we conduct extensive experiments on two real-world vehicle trajectory datasets, targeting three different types of downstream tasks: Destination Prediction (DP), Arrival time estimation (ATE), and Similar Trajectory Search (STS). The code of htapricheenniiionnnraaaaaaa
TrajMamba is available at https://github..o
Datasets: our experiments, we use two world datasets released by Did called Chengdu and Xian. Trajectories shorter than 5 or longer than 120 points are excluded from our study, and their points have variations sampling intervals. For the two datasets, we fetch the information of POIs from the AMap APff and road networks from OpenStreetMarf" Appendix C [roviiees statistical information for each processed dataset. We split the datasets into training, validation, and testing sets in an 8:1:1 ratio, with departure times in chronological order.
Baselines: We compare the proposed model with nine state-of-the-art (SOTA) trajectory learning
methods including (2vec 20], Trembr [2], CTLE (23), Toast [6), TrajCL [2]. LightPath [4]]
START [8] MMTEC (22). and JGRM 27 More details are Appendix D
3 httpps//gaia.diiiccuxiigg.g/
4
butps://www.ppessteemmm...op

---

Table I: Destination prediction (DP) performance results. 1: higher better, 4: lower better. Bold: the best, underline: the second best. The results under w/o ft setting can be found Appendix
Dalaset
Chengdu
Xian
GPS
Segment
Road Segment
Metric
Method
Acc@5 1 (9)
Recall f (%%
|
Acc@l 1
Acc (%)
Recall f (%)
(meters)
(melers)
(%)
(meleers)
(meters)
(%)
12vec
579.30
387.50
47.74
73.51
16.64
482.64
310.08
74.67
13.53
Trembr
505.62
376.88
48.99
72.08
17.01
473.97
301-45
44.50
75.11
12.90
CTLE
19
382.82
51.00
79.43
21.47
477.70
384.08
76.78
14.83
Toast
480.52
412.58
50.90
79.66
21.07
523.76
443.99
45.08
77.65
15.46
TrajCL
79.69
21.57
L LightPath
553.27
360.86
49.15
78.59
20.66
598.20
348.61
44.39
72.75
14.42
333.10
MMTEC
312.78
212.78
52.85
79.55
22.69
311.99
207.94
47.45
79.45
17,90
172.79
25.68
81.79
19.01
TrajMmaba
129.47
85.95
58.21
86.81
30.45
236.33
155.63
48.81
83.37
20.55
Implement Details: The four key hhyer--paameee of TrajMamba and their optimal values E = 256, N = 32, and = Their effectiveness is reported in the subsequent section. Both travel purpose-aware pre-training and knowledge distillation pre-training schemes perform 15 epochs on the training set. More detailed experimental setup shown in Appendix We run each set of experiments times and report their mean values of the metrics.
5.1 Destination Prediction
Setups: DP task involves predicting the destination of trajectory both GPS and road segment levels. When calculating the embedding zT of a trajectory T, its last 5 points are omitted. A fully connected network then uses this embedding predict the destination's GPS coordinates or road segment. For GPS prediction, Mean Squared Error (MSE) is used as the loss function, while Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE) of the shortest distance on the Earth's surface serve as evaluation metrics. For road segment prediction, we use the cross- coosspy loss, with Accuracy @ (Ace@) Acc@5) and macro- Recall as evaluation metrics. For this task, we can either fine-tune trajectory learning methods with task supervision (default) or fix their parameters and only update the predictors parameters, denoted as without fine-tune (w/o ft).
Results: Our brief results are shown in Tab. and consistently surpass all baselines. The comparison with JGRM, the second best model, particularly noteworthy. For road segment prediction, our model achieves average performance gains of 9.30 % and 3.75 % over JGRM on two datasets, respectively. And for GPS prediction, our improvements are even more significant, exceeding 45.16% and 26.71 %. Our model performs exceptionally well in the DP task thanks to its effective extraction of both movement patterns and travel purposes, allowing for precise identification of trajectory destinations.
5.2 Arrival Time Estimation
Setups: ATE task aims to predict the arrival time trajectory still in movement, corresponding to real-world scenarios such ride-hailing arrival time estimation and traffic management. Similar to the DP task, we omit the last points of a trajectory T. use fully connected network for prediction, and adopt either fine-tune (default) or w/o ft setting. MSE supervises the prediction, while MAE, RMSE, and Mean Absolute Percentage Error (MAPE) are used as evaluation metrics.
The performance results of this task are shown in Tab. 2 and our model consistently surpasses all baselines. Under tune setting. TrajMamba remains competitive even when compared with the SOTA model, JGRM, by 32.35% and 23.44% % on two datasets. Moreover, our model shows superior performance under w/o setting, which further highlights the effectiveness of its pre-trae pre-training process and sufficient modeling of continuous features.
Results:
5.3 Similar Trajectory Search
Setups: STS task aims to identify the most similar trajectory to query trajectory from batch of candidates. Similarities between trajectories are calculated with the cosine similarity between their embeddings. Accuracy @N (Acc@) I, Acc @5) and Mean Rank used evaluation metries. The
7

---

Table 2: Arrival time estimation (ATE) performance results. A lower value indicates better perfor- mance. Bold: the best, underline: the second best.
Strategy
fine-tune/ / without fine-tune
Dataset
Chengdu
Xian
Metric
Method
RMSE (seconds)
MAB (seconds)
MAPE (%)
RMSE (seconds)
MAE (seconds)
MAPE (%)
12vec
127.41 138.30
64.67
79.77 74
14.01 / 18.71
214.40
207.11
108.80/ /90/10 117
16.96 16.01
Trembe
124.32 159.60
63.42/ 110.36
13,60/ 13.60/29.50 29.50
209.12 435.04
107.02/ 337 35
16.40/47.
CTLE
135.21 135.59
55.41
11.18 13.99
207. /6/ 272.88
107.46 176.16
16.25
Toast
171,58 149.67
91.66 79.69
18.84 00.4//1..00 17.89
202.99/
299.94
102.73/ 305.49
15.75 / 32.55
TrajCL
132.98 012.98/136.55 136.56
$5.78 / 79.59
11.6 19.85
183.74 194.64
73.21 106.66
12.55 / 16.80
LightPath
123.00 122.48
58.04 56.82
12.83 12.71
169.01
186.02
74.08 77.33
10.50 10.41
START
121.11 144.54
58.97 / 79.78
19.72
159.89
213.22
72.19 120.74
10.26 20,01
MMTEC
105.72 124.98
40.48/ 54.76
8.17 12.13
155.59
183.66
58 84 78. 14
7.65 12.03
JGRM
65.24/ 119.40
31.52/ 82.02
6.84 22.01
84.49
/ 202.81
39.92 137.75
/ 20.20
TrajMmaba
50.17 92.52
17.73/ / 44.89
4.77 11,07
74.75 / 134.57
25.99 / 55.74
4,55 8,79
Table Similar trajectory search (STS) perfor- mance results. t: higher better, L: lower better. Bold: the best, underline; the second best.
Table 4: Efficiency analysis of methods. A lower value indicates better performance. Bold: the best, underline: the second best.
Datnset
Chengdu
Dataset
Chengdu / Xian
Metric
Acc 1P (8)
AcceR5 f
Mean
Metric
Model size (MBytes)
Train time (min/epach)
Embed time
(secomds)
12vec
75.20/ 89.83
08.53/94.88
5.04 5.71
12vec
L641/1.415
2.783/5 917
4.722/10.613
Thembr
84.60/ 78.75
89.63 86.45
10.01 / 11.04
Tremhr
5.782/5. 301
3.36046.067
3,527/100 381
CTLE
69.07 /4.80
78.50/
41.69 48.32
CTLE
3.756/3. 756
4.533/14.354
16,736/38.8 318
Toast
71.73 32,60
81.70/ 60.00
46.16 46.02
Toust
4.008/3.557
4.400/10.650
13.812/38.00
TrajCI.
94.45/ 90.87
96.70 94.50
2,88 /.886
TrajCI.
4. 4.382/3.922
7.699/14,567
9.998/22.85 833
LightPath
68.35 74.50
82.05 188775
17.94 /6999
LightPath
12.958/12 507
10.250/23.217
25.726v61
START
91.07/ 91
96.57 99.23
4,90 4.26
START
15.928/15.026
15.927/37.528
29 59.0344/6..88 801
MMTEC
19.117
3,76 4.86
MMTEC
8888/1 6663
0.376/0.753
27 77.068/40.. 143
JGRM
86.63 86.97
96. 1 96.77
1.97 1.62
088/20.827
22.339/62.791
04.0088/51.. 8988
TrajMmaha
96.53 97.97
99.13 99.80
1.15 1.07
TrajMamba
5.407/5.182
3,225/7,273
1.721/3.918
parameters of trajectory learning methods are fixed after pre-training. Since most datasets don't have labeled data for this task, we create labels following the method introduced in Appendix [3.2
Our brief results are shown in Tab. TrajMambas best performance demonstrates that its pretraining process effectively extracts travel semantics and reduces redundancy from trajectories, while baselines underperform due to the inadequate modeling of these aspects. Notably, CTLE and Toast do not learn a trajectory-level representation directly, resulting in poor performance.
Results:
5.4 Model Efficiency
Tab. compares the efficiency of different methods on both datasets. In terms of model size and embed time, TrajMamba demonstrates high computational efficiency, achieving the same lightweight and embed speed as RNN-based methods such as TremBR and (2vec. It significantly more efficient compared to Transformer-based methods like START and LightPath. Notably, TrajMamba shows strong advantage in all three terms compared to JGRM, which is the closest to it in terms of effect. Appendix [ provides detailed computation cost analysis of Traja Given TrajMamba's 's superior performance across a variety of tasks, achieves its design goal of semantic-rien rich trajectory learning with high efficiency. It is worth noting that Trajaanna does not have particularly short training time. However, since the pre-training process does not add extra burden to the embedding process, where efficiency is more critical in real-world applications, the additional training time be considered worthwhile due to its effectiveness.
5.5 Model Analysis
Ablation Study. As shown in Tab. we have the following observations: 1) Different modules focus on different types of tasks, and the overall performance of our method beats variants. 2) V-Mamba and V-Trunsformer show performance degradation, proving the contribution of the Traj-Mamba blocks. 3) w/o Purpose and w/o KD all have worse performance compared to the complete model, showing that both pre-training procedures contribute to TrajMambas performance. 4) The worse
8

---

Table 5: Ablations Chengdu dataset in all tasks. t: higher better, 1: lower better. Bold: the best, underline: the second best. The setting variants can be found in Appendix G
Task
Destination Prediction
Arrival Time Estimation
Similar Trajectory Search
Metric
GPS
Road Segment
RMSE (socoeds)
MAB L (scconds)
MAPE (5)
Ace@l1 (9)
Acc (86
Method
RMSE
MAE.
Aec
A. G51
Recall (%6
Rank
(meters)
(metees)
(%)
(%)
V-Mamba
109.84
85.60
36
Transffmmer
139.76
57.56
93.90
97.45
who Purpose
153. 84
116.82
$8.07
36.25
29.94
53.21
18.78
5.30
85.35
91.95
5.83
wño KD
145. 34
106.00
52.83
30.74
22.48
53.26
19.52
5.35
95.40
99: 10
1.65
Compress
174.65
129.93
76.34
MG-Tamn-DP
173.95
129.12
48.83
77.37
50.55
20.30
5.34
96.10
MG-tran--DS DDS
150 70
106.35
53.12
80446
23 16
$4.70
19:55
5.56
95.10
9X. 80.
2.16
wio Filter
125.56
26.49
58,31
86.75
30.52
50.18
17.41
4,56
96.90
99.00
1.22
TrajMuulka
65.95
ACC@1 (%)
Recall (%)
31
59
59
59
59
30
30
30
30
58
58
58
58
29
29
29
29
57
57
28
28
128
256
64 128256
(a) Number of Layers L
(b) Embed Dimension
(c) State Dimension N
(d) Number Heads H
Figure 4: Effectiveness of hyper-parameters validated on Chengdu dataset.
performance witnessed by w/o Compress demonstrates that reducing redundancy in trajectories contributes to embedding quality. 5) MG-TTans-DD DP performs well in STS but poorly in DP, indicating advantages learnable trajectory compression for various downstream tasks; while the results of MG-Trans-DS verify our mask generator outperforms direct downsampling. highlighting its ability to identify key trajectory points. 6) w/o Filter performs comparably to the full model, validating the mask generator's 's effectiveness lies in its learnable soft masking mechanism rather than filtering preprocessing.
Hyperparameter Analysis. We analyze the effectiveness of hyper- paremeerrssetesss L, E, N, and H of Traja based on the Acc@1 and Recall of the DP task on Chengdus validation set. shown in Fig. f-cc, L, E, and N control the model capacity, where E has the most prominent effect since directly controls the dimension of the final trajectory embeddings. Fig. 4 shows that increasing E from 256 to 512 not only yields limited performance improvement but also increases model size and encoding time, conflicting with our goal of efficient inference. After balancing performance and efficiency, their optimal values are L 5, E 256, and N 32. In Fig. 41, H determines the complexity of the multi-input SSMs in Traj-M Traj-Mamba encoder, with an optimal value of 4.
Scalability. We analyze the scalability of the proposed model against JGRM, one of the SOTA models, on Chengdu dataset. As shown in Fig. 5a we use varying proportions of the training data: 100%, 40%, and 20% for the DP task and report the valid Ace @ on several fine-tune epochs. It can be seen that our model demonstrates faster progress and achieves superior performance with less data compared to JGRM. In Fig- 5b) the ATE results of models fine-tuned on dataset of different sizes also confirms this. This shows that our model can be adapted to downstream tasks with lightweight fine-tuning, which is attributed to our well-designed pre-training process. And considering the high encoding efficiency of our model, have good practicality in real-world applications of trajectorics.
Case Study. We analyze the effectiveness of TrajMamba's 's learnable trajectory compression. As shown in Fig. bal there are many redundant points in trajectory due to its high sampling frequeecyy After rule-baser filtering, explicit redundant points are removed, yet the resulting trajectory shown in Fig. (6b still retains many non-critical points that can be considered implicit redundant. Fig. |6c shows that the pre-traine pre-trained mask generator accurately locates key trajectory points closely linked to revealing travel semanties and eliminates the implicit redundancy, thereby outputting the effective compressed trajectory to achieve high encoding efficiency and embedding quality. Notably, trajectory points near the origin and destination are largely preserved, as they carry semantics strongly associated with travel purpose.

---

61
JGRM
56
40
20
48
ours, 1
JGRM,
40
ours,0.4
JGRM,0.4
20
ours,0.2
JGRM.02
32
10
0.2
0.6
1.0
Fine-tuning epochs
Training data proportions
(a) Valid Acc@ (%) in Destination Prediction
(b) Test MAE in Arrival Time Estimation
Figure 5: Scalability of fine-tuning Chengdu dataset.
(a) Raw Trajectory
(b) Filtered Trajectory
(c) Compressed Trajectory
Figure 6: Case Study Chengdu dataset.
Quantitative Study on Knowledge Distillation Pre-training Loss Weights. We analyze how differ- weights of CMEC and Cmaas affect downstream tasks and compression preformance Chengdu dataset. Larger CAIE weight masks compressed representations containing more information from full-trajectory embeddings; Larger Ciack weight yields shorter compressed trajectories from the mask generator. As shown Tab. 6 weights (0.5, 0.5) help the model balance these two objectives, achieving the best comprehensive downstream performance and efficient encoding time.
Table 6: Impact of different weights for the loss functions C CMEC and Lmaask on Chengdu dataset in all tasks. t: higher better, 4: lower better. Bold: the best, underline: the second best.
Destination Prediction
Arrival Time Estimattin
Similar Triectory Search
Efficiency
Method
Metric
RMSE
MAE (meters)
Acc8l1
(%)
Acedt5 1 (5)
Sepment
Racall (9)
RMSE 1 (scconds)
MAE (scconds)
MAPE L (%)
Accdt1 (9)
Acclt (%)
Mean Rank
(seconda)
Embee Time]
(1.0 0.0)
125.62
86. 54
56.28
83.85
26.36
51.77
19.66
5.34
95.80
98:30
1.66
1.946
91.97
13
86.36
30.08
58.51
17.92
1.731
(0.3, 0.71
90.07
15
96.55
30.05
18.56
1.692
58.21
6
Conclusion
We propose TrajMamba, new method for efficient and semantic-rich trajectory learning. First, Traj-Mamba Encoder is proposed to capture movement patterns by jointly modeling GPS and road perspectives. Next, Travel Purpose-aware Pre-training procedure is introduced to help Traj extract travel purposes from trajectories while maintaining its efficiency. Third, a Knowledge Distillation Pre-training is designed for key trajectory point identification through learnable mask generator and deriving effective compressed representations. Finally, extensive experiments on two real-world vehicle trajectory datasets and three representative tasks demonstrate the effectiveness and efficiency of Traja. Our work enables a more accurate and efficient analysis of vehicle trajectories, benefiting human mobility services and urban traffic management.
Limitations Our TrajMamba hindered by different travel semantics from road segments and POIs in trajectory data across datasets, causing model cross-city migration and zero-shot experiments unfeasible. Future work will focus on developing universal road and POI embeddings enhance cross-city migration and improve model transfcrability.
10

---

Acknowledgment. This work was supported by the National Natural Science Foundation of China (No. 62372031) and the Beijing Natural Science Foundation (Grant No. 4242029).
References
[1] Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss. Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language Models are Few-Shot Learners. In NeurIPS.
[2] Yanchuan Chang, Jianzhong Qi, Yuxuan Liang, and Egemen Tanin. 2023, Contrastive Trajectory Similarity Learning with Dual-Feature Attention. In ICDE. 2933-2945.
[3] Wei Chen, Haoyu Huang, Zhiyu Zhang, Tianyi Wang, Youfang Lin, Liang Chang, and Huaiyu Wan. 2025. Next-POI Recommendation via Spatial-Temporal Knowledge Graph Contrastive Learning and Trajectory Prompt. IEEE Transactions on Knowledge and Data Engineering (2025).
[4] Wei Chen, Shuzhe Li, Chao Huang, Yanwei Yu, Yongguo Jiang, and Junyu Dong. 2022. Mutual Distillation Learning Network for Trajectory-User Linking. In ICCAI 1973-1979.
[5] Wei Chen, Huaiyu Wan, Shengnan Guo, Haoyu Huang, Shaojie Zheng, Jiamu Li, Shuohao Lin, and Youfang Lin. 2022. Building and exploiting spatial-temporal knowledge graph for next POI recommendation. Knowledge-Basse Systems 258 (2022), 109951.
[6] Yile Chen, Xiucheng Li, Gao Cong, Zhifeng Bao, Cheng Long, Yiding Liu, Arun Kumar Chandran, and Richard Ellison. 2021. Robust Road Network Representation Learning: When Traffic Patterns Meet Traveling Semantics. In CIKM. 211-220.
[7] Tri Dao and Albert Gu. 2024. Transformers are SSMs: Generalized models and efficient algorithms through structured state space duality. arXiv preprint arXiv:2405.22 20060 (2024).
[8] Jacob Devlin, Ming- Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In NAACL. 4171-4186.
[9] David H Douglas and Thomas K Peucker. 1973. Algorithms for the reduction of the number of points required to represent digitized line or its caricature. Cartographica: the international journal for geographic information and geovisualization 10, 2 (1973), 112-122.
[10] Zhengxiao Du, Yujie Qian, Xiao Liu, Ming Ding, Jiezhong Qiu, Zhilin Yang, and Jie Tang. 2022. GLM: General Language Model Pretraining with Autoregressive Blank Infilling. In ACL. 320-335.
[11] Jie Feng, Yong Li. Chao Zhang, Funing Sun, Fanchao Meng. Ang Guo, and Depeng Jin. 2018. DeepMove: Predicting Human Mobility with Attentional Recurrent Networks. In Www. 1459-1468.
[12] Tao- Rang Fu and Wang- Chien Lee. 2020. Trembr: Representation Learning. ACM Trans. Intell. Syst. Technol. 11, 1 (2020), 10:1-10:25.
Exploring Road Networks for Trajectory
[13] Albert Gu and Tri Dao. 2023. Mamba: Linear-time sequence modeling with selective state spaces. arXiv preprint arXiv:2312.00752 (2023).
[14] Albert Gu, Karan Goel, and Christopher Ré. 2022. Efficiently Modeling Long Sequences with Structured State Spaces. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022.
[15] Xiaolin Han, Reynold Cheng, Chenhao Ma, and Tobias Grubenmann. 2022. DeepTEA: Effective and Efficient Online Time-dependent Trajectory Outlier Detection. PVLDB 15, 7 (2022), 1493-1505.
11

---

[16] Geoffrey E Hinton and Ruslan R Salakhutdinov. 2006. Reducing the dimensionality of data with neural networks. science 313, 5786 (2006), 504-507.
[17] Danlei Hu, Lu Chen, Hanxi Fang, Ziquan Fang. Tianyi Li, and Yunjun Gao. 2024. Spatio- Temporal Trajectory Similarity Measures: A Comprehensive Survey and Quantitative Study. IEEE Trans. Knowl. Data Eng. 36, 5 (2024), 2191-2212.
[18] Jiawei Jiang, Dayan Pan, Houxing Ren, Xiaohan Jiang, Chao Li, and Jingyuan Wang. 2023. Self-supervised Trajectory Representation Learning with Temporal Regularities and Travel Semantics. In ICDE. 843-855.
[19] Dejiang Kong and Fei Wu. 2018. HST-LSTM: A Hierarchical Term Memory Network for Location Prediction. In IJCAI. 2341-2347 -2447
Long-Shon
[20] Xiucheng Li, Kaiqi Zhao, Gao Cong, Christian S. Jensen, and Wei Wei. 2018. Deep Represen- tation Learning for Trajectory Similarity Computation. In ICDE. 617-628.
[21] Yuxuan Liang, Kun Ouyang. Yiwei Wang, Xu Liu, Hongyang Chen, Junbo Zhang, Yu Zheng, and Roger Zimmermann. 2022. TrajFormer: Efficient Trajectory Classification with Transform- ers. In CIKM. 1229-1237.
[22] Yan Lin, Huaiyu Wan, Shengnan Guo, Jilin Hu, Christian S. Jensen, and Youfang Lin. 2024. Pre-Traie Pre-Training General Trajectory Embeddings With Maximum Multi-View Entropy Coding. IEEE Trans. Knowl. Data Eng. 36, 12 (2024), 9037-9050.
[23] Yan Lin, Huaiyu Wan, Shengnan Guo, and Youfang Lin. 2021. Pre-training Context and Time Aware Location Embeddings from Opatial-Tempori Trajectories for User Next Location Prediction. In AAAI. 4241-4248.
[24] Yan Lin, Huaiyu Wan, Jilin Hu, Shengnan Guo, Bin Yang, Youfang Lin, and Christian S. Jensen. 2023. Prigin-Destination Travel Time Oracle for Map-based Services. PACMMOD 1, (2023), 217:1-217:27.
[25] Xin Liu, Zhongdao Wang, Yali Li, and Shengjin Wang. 2022. Self-Supervised Learning via Maximum Entropy Coding, In NeurIPS.
[26] Yiding Liu, Kaiqi Zhao, Gao Cong, and Zhifeng Bao. 2020. Online Anomalous Trajectory Detection with Deep Generative Sequence Modeling. In ICDE. 949-960.
[27] Zhipeng Ma, Zheyan Tu, Xinhai Chen, Yan Zhang, Deguo Xia, Guyue Zhou, Yilun Chen, Yu Zheng, and Jiangtao Gong. 2024. More Than Routing: Joint GPS and Route Modeling for Refine Trajectory Representation Learning. In Proceedings of the ACM on Web Conference 2024, WWW 2024, Singapore, May 13- 17, 2024. 3064 3075-3075.
[28) Congcong Miao, Ziyan Luo, Fengzhu Zeng, and Jilong Wang. 2020. Predicting Human Mobility via Attentive Convolutional Network. In WSDM 438-446.
[29] Meinard Müller. 2007. Dynamic time warping. Information retrieval for music and motion (2007), 69-84.
[30] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. 2018 Representation learning with contrastive predictive coding, arXiv preprint 1807 (2018).
[31] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Z. Yang, Zachary Vito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang. Junjie Bai, and Soumith Chintala. 2019. PyTorch: An Imperative Style, High-Performance Deep Learning Library. In NewrIPS. 6034-8035.
[32] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agar- wal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and llya Sutskever. 2021. Learning Transferable Visual Models From Naural Language Supervision. In ICML, Vol. 139. 3748-8763.
12

---

[33] Yu Sang, Zhenping Xie, Wei Chen, and Lei Zhao. 2023. TULRN: Trajectory user linking on road networks. WWW 26, (2023), 1949-1965.
[34] Zekai Shen, Haitao Yuan, Xiaowei Mao, Congkang Lv, Shengnan Guo, Youfang Lin, and Huaiyu Wan. 2025. Towards An Efficient and Effective En Route Travel Time Estimation Framework. arXiv preprint arXiv:2504.0400 (2025).
[35] Matthew Tancik, Pratul P. Srinivasan, Ben Mildenhall, Sara Fridovich- Keil, Nithin Raghavan, Utkarsh Singhal, Ravi Ramamoorthi, Jonathan T. Barron, and Ren Ng. 2020. Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains. In NeurIPS.
[36] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is All you Need. In NeurIPS. 5998-6008.
[37] Maheswari Visvalingam and James Whyatt. 2017. Line generalization by repeated elimination of points. In Landmarks in Mapping. Routledge, 155.
[38] Hao Wu, Ziyang Chen, Weiwei Sun, Baihua Zheng, and Wei Wang. 2017. Modeling Trajectories with Recurrent Neural Networks. In IJCAI. 3083-3090.
[39] Yutaro Yamada, Ofir Lindenbaum, Sahand Negahban, and Yuval Kluger. 2020. Feature Selection using Stochastic Gates. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event (Proceedings of Machine Learning Research, Vol. 119). PMLR, 10648-10659.
[40] Bingqi Yan, Geng Zhao, Lexue Song, Yanwei Yu, and Junyu Dong. 2023. PreCLN: Pretrained- based contrastive learning network for vehicle trajectory prediction. WWW 26, 4 (2023), 1853-1875.
[41] Sean Bin Yang, Jilin Hu, Chenjuan Guo, Bin Yang, and Christian S. Jensen. 2023. LightPath: Lightweight and Scalable Path Representation Learning. In KDD. 2999-3010.
[42] Di Yao, Gao Cong, Chao Zhang. and Jingping Bi. 2019. Computing Trajectory Similarity in Linear Time: A Generic Seed-Guided Neural Metric Learning Approach. In ICDE. 1358-1369.
[43] Di Yao, Haonan Hu, Lun Du, Gao Cong, Shi Han, and Jingping Bi. 2022. TrajGAT: A Graph- based Long-term Dependency Modeling Approach for Trajectory Similarity Computation. In KDD. 2275-2285.
[44] Di Yao, Chao Zhang, Zhihua Zhu, Jian-Hui Huang, and Jingping Bi. 2017. Trajectory clustering via deep representation learning. IJCNN. 3880-3887.
[45] Haitao Yuan, Guoliang Li, Zhifeng Bao, and Ling Feng. 2020. Effective Travel Time Estimation: When Historical Trajectories over Road Networks Matter. In SIGMOD. 2135-2149.
[46] Silin Zhou, Peng Han, Di Yao, Lisi Chen, and Xiangliang Zhang. 2023. Spatial-temporal fusion graph framework for trajectory similarity computation. WWW 26, 4 (2023), 1501-1523.
[47] Zeyu Zhou, Yan Lin, Haomin Wen, Shengnan Guo, Jilin Hu, Youfang Lin, and Huaiyu Wan. 2025. TrajCogn: Leveraging LLMs for Cognizing Movement patterns and Travel Purposes from Trajectories. In Proceedings of the hhirty-Fourth International Joint Conference on Artificial Intelligence, IJCAI 2025, Montreal, Canada, August 16-22, 2025, 3698-3706.
13

---

NeurIPS Paper Checklist
1. Claims
Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?
Answer: [Yes]
Justification:
See Abstract and Section Introduction.
Guidelines:
The answer NA means that the abstract and introduction do not include the claims made in the paper.
The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or
NA answer to this question will not be perceived well by the reviewers.
The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.
It is fine include aspirational goals as motivation long it is clear that these goals are not attained by the paper.
2. Limitations
Question: Does the paper discuss the limitations the work performed by the authors?
Answer: [Yes]
Justification: See Section 6 Limitations.
Guidelines:
The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.
The authors are encouraged to create a separate "Limitations" section in their paper.
The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.
The authors should reflect the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should articulated.
The authors should reflect on the factors that influence the performance of the approach. For example, facial recognition algorithm may perform poorly when image resolution low or images are taken in low lighting. Or speech-to-text system might not be used reliably provide closed captions for online lectures because it fails to handle technical jargon.
The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.
If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and faimess.
While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an impor- tant role in developing norms that preserve the integrity of the community, Reviewers will be specifically instructed to not penalize honesty concerning limitations.
3. Theory assumptions and proofs
Question: For each theoretical result, does the paper provide the full set of assumptions and complete (and correct) proof?
Answer: [NA]
14

---

Justification:
The paper does not include theoretical results.
Guidelines:
The answer NA means that the paper does not include theoretical results.
All the theorems, formulas, and proofs in the paper should be numbered and cross- referenced.
All assumptions should be clearly stated referenced in the statement of any theorems.
The proofs can either appear in the main paper or the supplemental material, but they appear in the supplemental material, the authors are encouraged to provide short proof sketch provide intuition.
Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.
Theorems and Lemmas that the proof relies upon should be properly referenced.
4. Experimental result reproducibility
Question: Does the paper fully disclose all the information needed to reproduce the main ex- perimental results of the paper to the extent that affects the main claims and/or conclusions of the paper (regardless whether the code and data are provided or not)?
Answer: [Yes]
Justification: See Section 5 and Appendix B
etc.
Guidelines:
The answer NA means that the paper does not include experiments.
If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.
If the contribution is dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.
Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g.. in the case of large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.
While NeurIPS does not require releasing code, the conference does require all submis- sions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example
(a) If the contribution is primarily a new algorithm, the paper should make clear how to reproduce that algorithm. (b) the contribution is primarily a new model architecture, the paper should describe the architccture clearly and fully.
(c) If the contribution is new model (e.g., a large language model), then there should either way to access this model for reproducing the results or way to reproduce the model (e.g., with an open-source dataset instructions for how to construct the dataset).
(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. the case of closed-source models, may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers have some path to reproducing or verifying the results.
5. Open access to data and code
Question: Does the paper provide open access to the data and code, with sufficient instruc- tions to faithfully reproduce the main experimental results, as described in supplemental material?
15

---

Answer: [Yes]
Justification: We have submitted our data and code on htwp://mmmmmmmmoossiiiese/e/aaaa Guidelines:
The answer NA means that paper does not include experiments requiring code.
Please see the NeurlPS code and data submission guidelines (https://nips.cc
for more details.
While we encourage the release code and data, we understand that this might not be possible, so No is acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for new open-source benchmark).
The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines (https
7
for more details.
The authors should provide instructions on data access and preparation, including how access the raw data, preprocessed data, intermediate data, and generated data,
The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only subset of experiments are reproducible, they should state which ones are omitted from the script and why.
At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).
Providing as much information as possible in supplemental material (appended the paper) is recommended, but including URLs to data and code is permitted.
6. Experimental setting/details
Question: Does the paper specify all the training and test details (e.g., data splits, hyper- parameters, how they were chosen, type of optimizer, etc.) necessary understand the results?
Answer: [Yes]
Justification:
See Section 5 and Appendix
Guidelines:
The answer NA means that the paper does include experiments.
The experimental setting should be presented the core the paper to level of detail that is necessary appreciate the results and make sense of them.
The full details can be provided either with the code, in appendix, as supplemental material.
7. Experiment statistical significance
Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?
Answer: [Yes]
Justification:
See Appendix
Guidelines:
The answer NA means that the paper does not include experiments.
The authors should answer "Yes" if the results are accompanied by error bars, confi- dence intervals, or statistical significance tests, least for the experiments that support the main claims of the paper.
The factors of variability that the enror bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall with given experimental conditions).
The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)
The assumptions made should be given (e.g., Normally distributed errors).
16

---

It should be clear whether the error bar is the standard deviation or the standard error of the mean.
is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have 96% CI, if the hypothesis of Normality of errors is not verified.
For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out range (e.g. negative emror rates).
If error bars reported in tables plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.
8. Experiments compute resources
For each experiment, does the paper provide sufficient information on the com- puter resources (type of compute workers, memory, time of execution) needed reproduce the experiments?
Question:
Answer: [Yes]
Justification:
See the Tab.
Subsection 5.4
Guidelines:
The answer NA means that the paper does not include experiments.
The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.
The paper should provide the amount compute required for each of the individual experimental runs well estimate the total compute.
The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary failed experiments that didn't make into the paper).
9. Code ethics
Question: Does the research conducted the paper conform, in every respect, with the NeurlPS Code of Ethics http://pwp....ee.....o//oo//oo/a
Answer: [Yes]
Justification: respects.
We ensured that the study complied with the NeurlPS Code of Ethics in all
Guidelines:
The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.
If the authors answer No, they should explain the special circumstances that require deviation from the Code of Ethics.
The authors should make sure to preserve anonymity (e.g., there a special consid- eration due to laws or regulations in their jurisdiction).
10. Broader impacts
Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
Answer: [Yes]
Justification: See Section
Guidelines:
The answer NA means that there no societal impact of the work performed.
If the authors answer NA or No, they should explain why their work has no societal impact why the paper does not address societal impact.
Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
17

---

The conference expects that many papers will be foundational research and not tied particular applications, let alone deployments. However, if there is direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.
If there negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms monitor how system learns from feedback over time, improving the efficiency and accessibility of ML).
11. Safeguards
Does the paper describe safeguards that have been put in place for responsible release of data models that have high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?
Question:
Answer: [NA]
Justification:
The paper does not suffer from this risk.
Guidelines:
The answer NA means that the paper poses such risks.
Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.
Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make best faith effort.
12. Licenses for existing assets
Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?
Question:
Answer: [Yes]
The paper mainly uses two existing assets: the original implementation of Mamba2 and two real-world vehicle trajectory datasets. See Section 4 and for correspond- ing licenses.
Justification:
Guidelines:
The answer NA means that the paper does not use existing assets.
The authors should cite the original paper that produced the code package dataset.
The authors should state which version of the asset used and, possible, include URI.
The name of the license (e.g., CC-BY 4.0) should be included for each asset.
For scraped data from a particular source (c.g.. website). the copyright and terms of service of that source should be provided.
If assets are released, the license, copyright information, and terms use in package should be provided. For popular datasets, taperswithcode com/ datasets has curated licenses for some datasets. Their licensing guide can help determine the license of dataset.
18

---

For existing datasets that are re-packaged, both the original license and the license of the derived asset (if has changed) should be provided.
this information is not available online, the authors are encouraged to reach out to the asset's s creators.
13. New assets
Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
Answer: [Yes]
Justification:
The code of the paper is asset and provide sufficient documentation.
See Section it.
Guidelines:
The answer NA means that the paper does not release new assets.
Researchers should communicate the details of the dataset/code/moodl as part of their submissions via structured templates. This includes details about training, license, limitations, etc.
The paper should discuss whether and how consent was obtained from people whose asset used.
At submission time, remember to anonymize your assets (if applicable). You can either create anonymized URL or include anonymized zip file.
14. Crowdsourcing and research with human subjects
Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well details about compensation (if any)?
Answer: [NA]
Justification:
The paper does not involve crowdsourcing nor research with human subjects.
Guidelines:
The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
Including this information in the supplemental material is fine, but if the main contribu- tion of the paper involves human subjects, then as much detail as possible should be included the main paper.
According to the NeurIPS Code Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.
15. Institutional review board (IRB) approvals or equivalent for research with human subjects
Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?
Answer: [NA]
Justification: The paper does not involve crowdsoureing nor research with human subjects.
Guidelines:
The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere the NeurIPS Code of Ethics and the guidelines for their institution.
19

---

For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.
16. Declaration of LLM usage
Question: Does the paper describe the usage of LLMs if it is important, original, or non-standard component of the core methods this research? Note that the LLM is used only for writing, editing, formatting purposes and does not impact the core methodology. scientific rigorousness, or originality of the research, declaration is not required.
Answer: [NA]
Justification: The core method development in this research does involve LLMs any important, original, or non-standard components.
Guidelines:
The answer NA means that the core method development in this research does not involve LLMs as any important, original, or non standadd components.
Please refer to LLM policy for what should or should not be described.
20

---

Appendix
Here we introduce the background of SSMs Sec The implement details including experiment settings and label construction for STS task can be found in Sec B The information of datasets are shown in Sec[C] An introduction to Baselines presented Sec D We display the complete results of three downstream tasks in Sec. E supplementing the standard deviations of each set of experiments. The computation cost analysis of our model's downstream components shown Sec. FF The settings of ablation variants are listed in Sec. G Moreover, introduce the detailed calculation processes of trajectory spatio-temporal feature embedding and road/POI textual embedding in Sec and Seell respectively.
A Structured State Space Models
Structured State Space Models (SSMs) are a recent class of sequence models for deep learning that have proven to be effective at handling rongerange models [14]. They inspired by pair of linear differential equations that maps a I-dimensional function z(t) E IR + y(t) E R through an intermediate hidden state h(t) R.V, formulated as:
h1(1) = Ah(() + Bx((), where A E RNN, B E RX11, and C E R IxN are the hidden state, input and output mapping matrices, respectively. When applying SSM to discrete sequence data, an additional timescale parameter A is introduced to transform the continuous parameters A, B to discrete parameters A, B through fixed discretization rules. The most common method is zero-order hold (ZOH) defined by AA) - I) AB. Then the discretized version of Eq.
Ch(I),
A = cxp( A) and B = can be obtained by A, B as follows:
h4 Al4-1 + BrG V1 Chh
Due to the linear-time invariance (LTT) property of Eq. 7 Eq. c be reformulated as convolution by unrolling the recurrence, enabling efficient parallelized computation during training. For multidi- mensional input æ, RR , the above dynamics are typically applied each channel independently. This is actually completely similar to how multi-head attention works, and thus further leads to the concept of multi-head SSM.
Multi-input SSM introduced in Mamba2 7 creates H heads by reshaping the input æ; E R into 2; E Is 2 For the i-th head, the recurrence formulations of multi-input SSM when D/H H = are follows:
he A, + B, V1,1 = C.h.i.
where Vt.i leri, A., and B; denote the i-th row of æt, hr, A, and B, respectively. Here, hr E BBHN A RH B RHH and the identity matrix I NxN, Finally, the output y, H is reshaped back to y, E TR. by aggregating heads. When D D/H > 1, the input æt,; of the i-th head can be treated D/ independent sequences, and then Eq. cann be applied to each sequence.
Selection Mechanisms Models using the LTI formulation guarantee computational efficiency at the expense of inability to dynamically focus specific inputs. To addressing this issue, Mamba [13 introduce the selective SSM, which makes the parameters B, C, and A depend on the input R L formulated as:
B = Linear(x)) C Linear(x)) A = a (Linear(x:) + ba)
(10)
In this way, each token of the input has its own unique input-dependent parameters, enabling the model to selectively process the input by focusing on ignoring specific tokens. Then, Mamba employs the hardware-cfficiee algorithm to ensure linear computational complexity with respect to the input length n.
B Implement Details
B.1 Settings
The TrajMamba model implemented using PyTorch [1 All models are trained on the training set and evaluated on the testing set. The travel purpose-aware pre-training and the knowledge distillation
21

---

pre-training both perform 15 epochs, while the downstream predictors are etrly-stopped based on the validation set. The final metries are calculated on the testing set. All experiments are performed five times, and the means and standard deviations are calculated. For model training, we use the Adam optimizer with a batch size of B 128, and the initial learning rates of two pre-training procedures are 0.001 and 0,0001, respectively. We set the radius for neighhoring POIs selection R = 300 meters. In Eq. [1]] we set a = 1.0, 3 = 0.5 to balance each factor. For K and in Eq. | we follow the same settings in [22]. The experiments are conducted servers equipped with Intel(R) Xeon(R) W-2155 CPUs and n Vidia(R) TITAN RTX GPUs.
B.2 Label Construction for Similar Trajectory Search
Considering that the datasets we used are recorded by taxis operating in two cities, trajectories sharing the same origin and destination (OD) pair can be regarded as more similar. For each trajectory T in the test dataset, we first construct its similar trajectory candidate set by collecting all test trajectories that have the same OD pairs it. The difference between T and each candidate is quantified by combining their GPS sequence distance calculated by DTW (29) algorithm and the number of differing road segments. In particular, we split T into subsequences of odd- and even-numbered points, calculate their difference as the benchmark, and compare it with each candidate. If candidate's difference from T is below the benchmark, we use 'I as the query T and the most similar candidate as the target T'. Otherwise, TV and T are created from the odd- and even-numbered subsequences of T, respectively. For the STS task, we randomly select 1,000 test trajectories, ensuring that more than 20% are not self-similar to maintain task difficulty. For each query, we exclude trajectories whose OD pairs within 500 meters away from query's is OD pair, and then randomly select 5,000 additional trajectories from the rest of the test dataset to use as the database.
C Datasets
The two real-world datasets Chengdu and Xian consist of vehicle trajectories recorded by taxis operating Chengdu and Xian, China. Due to the original trajectories having very dense sampling intervals, retain a portion of the trajectory points through three-hop resampling process, making most trajectories having sampling intervals of no less than 6 seconds. After resampling. trajectories with fewer than 5 more than 120 trajectory points considered anomalies and excluded. Addi- tionally, we retrieve the information of POIs within these datasets' areas of interest from the AMap API, and obtain the road network topology and information from OpenStreetMap.. The statistics of these datasets after the above preprocessing are listed in Table
Table Dataset statistics.
Dataset
Chengdu
Xian
Time span # #Trajectories
09/30 10/10, 2018 09/29 10/15, 2018
140,000
210,000
#Points
18,832,411
18,267,440
#Road segments
4.315
3,392
#POIs
12,439
3,900
D Overview of Baselines
12vec 200:: Pre-trains the model by reconstructing original trajectories from low-sampling ones using denoising auto-encoder.
Trembr [12] Constructs an RNN-based seq2seq model to recover road segments and the time of the input trajectories.
CTLE :3 Pre-trains a bi-directional Transformer with two MLM tasks for location and hour predictions. The trajectory representation is obtained by mean pooling point embeddings.
22

---

Toast [6]:
Uses a context-awant node2vec model to generate segment representations and trains the model with an MLM-based task and a sequence discrimination task.
TrajCL 2 : Introduces a dual-feature celf-attention-uee bastdd encoder and trains the model in
contrastive style using the InfoNCE loss.
LightPath 41: Constructs sparse path encoder and trains it with a path reconstruction task and
a cross-view cross-network contrastive task.
START 18
Includes time-aware trajectory encoder and GAT that considers the transitions between road segments. The model is trained with both an MLM task and a contrastive task.
Combines an attention-baue bbased discrete encoder and a NeuralCDE- based continuous encoder. The model is trained with a maximum entropy pretext task based on contrastive style.
MMTEC [2]:
JGRM 27: : Uses two encoders separately embed route and GPS trajectories and then employs a modal interactor for information fusion. An MLM task and a cross-modal contrastive task are designed for model training.
E
Performance Comparison in Three Downstream Tasks
For the DP task, methods can also be trained with fixed parameters. Tab. 8 compares the DP performance of different methods without fine-tune on two datasets. We observe that TrajMamba also consistently shows superior performance in this setting, demonstrating that its pretraining process extracts rich information from vehicle trajectories without additional task-specific supervision. For GPS prediction, our model achieves average performance gains 9.37% and 9.86% over the second best model JGRM on two datasets, respectively. And for road segment prediction, our improvements are even more significant, exceeding 27.47 % and 11.65%
Table 8: Destination prediction (DP) performance results with standard deviations under w/o ft setting. 1: higher better, lower better. Bold: the best, underline: the second best.
Dutaee
Cheaada
Xian
Meuic
GPS
Ruad Sepracat
GPS
Road Seyenenn
IMSE:
MAP (ucters)
Accel
Accdis
Recall
RMSE
MAE
Azcde1
Accde
Rncall
(meters)
(9)
(5)
(5)
(aatee)))
(metee)))
(9)
(9)
(9)
12xx0
2329 23...6
1888 1.....9......
10,77
25.37 23.399
1.64:1111
25R2
141-46/9
2235.27
9.55:1433
22. 1166021115
0.88:1101
Trembr
1787. 18:292.01 01
1419.5 58.198..10
13.45.0.20
28.52:x0244
1,20
2067 100.
7749
13.97
27.78:5:21
1.041135
29117%
2.90--.33
7.84--0.15
0.08-n00
1548
46
10.50-3305
8,0-10000
00.35
0:10:001
8.771007
9.971885
80051001
30,32-0.31
111551111.544
49.81=043
LaglaPaah
2365.8
1048
1550.35
18.55.0412
2.4011100
START
1347.
1111.7712011
48.42:0044
1406006118
24.11.00022
4.44111K
2137. 11.1144333.1
168763322600
16.48-0.4 48
54.21 38
2.20:0226
2110000:66.9 26.1
10.67:3.26
24.64:511
0.465005
ICRM
405
119 019.00-2::4
47. 07.49-0.55
14 14.95-0055
457.61-144 14.45
519 95-112887
36 57-377-337
21 21-91-3662
12.08-524
TrajManoba
365.00::0.76
291.12:16.88
$1.95:9422
77.72:109
22.95:881
386.7623388
308.42:3.88
42.89:0.199
74,56:6.29
14.55:6.21
Additionally, Tab. 12 and 3 in Section oonly report mean values the metrics in three downstream task. To supplement results in these tables, report performance results with standard deviations for each task in Tab. 9 I0 and [ respectively. can be seen that our model maintains the best mean values of the metries all downstream tasks while having relatively small standard deviations compared to most baseline models. This shows that our model can outcomes robust trajectory embeddings across various tasks.
Table Destination prediction (DP) performance results with standard deviations under fine-tune setting. t: higher better, L: lower better. Bold: the best, underline: the second best.
Chergsh
Mesic
Road Sepmentt
Road Segment
Methel
R
MAD
Acci81
AcciE5
Recall (%6
RMSE 1
MAB.
Acc&l1 1
Accil 5 (%)
Recall
(metees)
(metens)
(56)
(16
(meters]
(metens)
(16)
(%)
<ivcc
579, 119.30
387. 012.50
47.74g:0224
73.51:0015
16.4480.11
482.6822.67
310.08:3.00
43:60=0013
74.67a0:34
13.53a001
Trembr
505 6.542
376 076.8847.34
48 18.99:3038
22.0860.29
17.01:0.50
473.97e1.24
301 00.45:2400 MM
46 11.50:0.35
75.1 11:0/67
12.90am174
CTLE
430. 19:.52.65
582822552 5M
51.00:10:0
79 93-336064
21.4740.70
477, 70: 25
384 08:55.111
46384-072
76. 7866666
14.82:041
Theat
480 52-552--333
412 412.58-122 12-58--2330 32
50:90-11:9
06:00.10
21.0740.33 34
523 76-76---700 PM
443 99-60.11
45.08-0.5
77 73.6540.13
15-46-1555
TryC3.
965.00 19-11914
272 63644-4490
50.85 50.85-1125
69.00.15
21.5740.3 37
185 10-11-33
162 10.40
45.81-0.47
70 70:06-0.00
16.84-038
LightPath
$53.27 42.36
360.86 56
40.15 10.25
78.5910.55
20.6610.29
598.20 15.59
348 19.95
46.39
0.24
72.7510.41
14.43 11.44
START
353.101 10.47
240-40111 15.10
52.78 10.51
80-210041
23.52.10.31
119.00-427 4.25
200. 35.3551
46.13.003 0.27
70 70.34.1.400
16.31 11.5
MNTEC
312.781144.1
212.78
52.85
5510009
22 22.6910.40
311.99
207.34 3355
47.45-0.144
79.4510.25
17:901033
JGRM
215.951.9000
172.791-24500
54.27-10.77
85.06:10.55
25. 23.68.10.99
305. 12:.12255.65
236 K21.99
48.21-0.21
81.7910.27
19.01:1022 10
TrajMmaba
129.47-1.45
N5.95:2.51
38.11-0.11
8631::0.7
30.4519.42
236.33:2.10
155.63:2.7
48.11-813
N3.37::0.5
20.55::041
23

---

Table 10: Arrival Time Estimation (ATE) performance results with standard deviations. A lower value indicates better performance. Bold: the best, underline: the second best.
wilhoot fre-tane
Terghi
Xiss
Melnl
Metric
(scordd)
MAR (soooed))
MAPE
RMSI (scened))
MAR (scceed))
MAPE
Threhr
136-5763607 15g 50-5
(25 10
300 17:5000 435 Bl-s
107 07 14 35-355--00
CTEL:
17283 15.500
II 18-1
13
207 4477447777.888 -0
UP te be (176 tea
188441500
17.89uaU52
TrafCL
156.56030000
739.9922.7
Lightsn
(33 71100688771 7 120 18--n
18.113 de. 16.
11g161 Ter 11.71a100
189.0011 au 188 00-3446
10 109050117 Iildllen's
START
JGRM
65 (334454h/1110 119.400::05
31.52a25e/
/ (230220099
6.84amuy 22015UM1
$4.002335
(21231:224
3.9fitt45 22 2015144
38.172807 /913154277
B7733822 (4389:342
477531//11// 11.872475
147750855 01155089/113557:555 /1345775555
253995356 /55/9453107
4.5524000 8.7928.35
Table 11: Similar Trajectory Search (STS) performance results with standard deviations. t: higher better, 4: lower better. Bold: the best, underline: the second best.
Dataset
Chengdu / Xian
Metric
Acc@1 1 f (%)
Acc@5 1 (%)
Mcan Rank |
Method
12vec
75.20= / 89. 0.5
88,53:0076/ 003-:0.76//4.771000 94.57
4.0400475..71:00
Trembr
84.60=1.06/ 1.00=11.///8.5:16666 78.75:16.40
89.63:10:00/ 86.4514.07
10.01 / 11.04::.03
CTLE
69.07=4424 44.800+6/96
15-1525002 78.50=1.91
41.69+5.19 48.32++7.0
Toast
71.73+3888 /3..60+2.40
1170=33.88/60000+10
46. 16+22.11 6..02+6681
TrajCL
94.45-0.07 90.87700006
1170000.14/4450::0.11
2.88 / 1.86
LightPath
68.35.1.733/ 74.50:12297
82.05:16.66 88..65511888
17.94.19.2 6.99:0..4
START
91.07=0.15/ 1L.7=00.5//11433:...22 19.44
0057=00.1196.2310000
4.90 4.26611.15
MMTEC
90.17=0.12/ 1..17=0.12/82.7740.00 82.9770000
96.47-0.669111740000
3.76+ 4.86++0.35
JGRM
1..63++1011 16.97+1.45
96. 96.10-+044/96677707777
1.97+0.13 / 1.62+0.11
TrajMmaba
96.53_0.38 97.97.1.12
99.13-0.17/99.8000000
1.1510.00 1.07
F
Computation Cost
We analyze the time complexity of TrajMamba's downstream components, i.e., mask generator and Traj-Mamba encoder, and compare them with typical baselines JGRM and START.
Inference Time Complexity of Mamba. For the mask generator, the time complexity is O(''d), where d is the number of trajectory point features for the input mask generator and n'' is the length of the input trajectory after preprocessing. For the Traj-Mamba Encoder, the time complexity is O(dEE) and O for embedding initial latent vector and stacked Traj-Mamba blocks, respectively. Here, ñ is the length of the compressed trajectory output by the mask generator and E is the embedding dimension. Therefore, the combined time complexity of TrajMamba is On'' d2 + idE LnE"), where n', n and is trajectory length.
Complexity of Typical Baselines. For baseline JGRM, the time complexity is Om + I,pm E (2m)) F),, where m is the number of unique road segments in trajectories, and T.r, I,y are the numbers of route encoder layers and model interaction layers, respectively. And for START, the time complexity is O (VL network, H is the number of attention heads used by TPE-GAT, and Lgg Le are the numbers of TPE-GAT layers and TAT-Enc layers, respectively.
L E), where [V] is the number of road segments in the road
It is clear that TrajMamba achieves linear inference time complexity with respect trajectory length by avoiding the quadratic terms present in baselines: JGRM introduces O(m²) from Transforer- based modules, while START relies on O This design ensures encoding efficiency for long or large-batch trajectories in real-world scenarios, which is crucial for real-time applications.
G Variants of Ablation
To assess the effectiveness the modules implemented in TrajMamba, we compare the complete model with the following variants:
24

---

V-Mamb:: replace the Traj-M Traj-Mabba blocks with the vanilla Mamba2 blocks.
V-Transformer: replace Mamba-based modules with the vanilla Transformer layers.
w/o Purpose: replace the travel purpose-aware pre-training with a reconstruction task to pre-train the teacher Traj-Mamba encoder.
w/o KD: remove the knowledge distillation pre-training and directly align compressed representa- tions with the road and POI views derived from full trajectories.
w/o Compress: remove the mask generator and directly use full-trajectory embeddings for down- stream tasks.
MG-Trans-DD. DP: replace the mask generator with the Douglas-Peucket algorithm to generate com- pressed trajectories.
MG-Trans-DD replace the mask generator with direct trajectory downsampling at 60% sampling ratio.
w/o Filter: remove rule-based filtering preprocessing used in mask generator.
H
Trajectory Spatio-temporal Feature Embedding
Given trajectory T (m1, ......, Tr), we embed its GPS and road perspectives into a E_ dimensional embedding space respectively, where E' represents the embedding dimension of the trajectory embeddings.
For the GPS coordinates 9, of each trajectory point Tı, we employ a linear transformation layer to map it to _ The road segment is also mapped to IR के via index-fetching embedding layer E and a linear projection. Then we transform the timestamp 1, into five features: two duration time features E:tur including the time delta At, in minutes relative to t and the timestamp in minutes; three cyclic time features g.e including lay-in-week, hour-in-day, and minute-in-hour. These features are then encoded into five embedding vectors using learnable Fourier encoding layers (35]. Next, the two duration time feature vectors concatenated and then mapped into R through linear layer. The three cyclic time feature vectors also undergo the same process. Finally, the GPS latent vector 2 and road latent vector z the point are obtained as follows:
2 Linear(g;) Linear (CneearrCCtCCC (Fourieeeer)(
(1I)
Linear( Eiax (e:)) + Linear( Linear(Cat(Fouriee) (at((ourier((;"""))
where Cat denotes vector concatenation, and Fourier denotes the learnable Fourier encoding layer. By gathering the GPS and road latent vectors for each point in TT, respectively, obtain its sequences of latent vectors as z (2Π " ()) E Rax & and Z (z = ........2.. =R) E R=*
We also calculate the high-order movement behavior features for each point, including speed vs acceleration acc; and movement angle 0,, according the difference between the features of r and 1-+1- Note that these features of the last point тa are set to O. Then these three features are min-max normalized and concatenated into vector denoted as 8; (vi, acc;, 0t). By gathering this vector for each point T, we obtain its sequence of high-order movement behavior features as ST (31, ..,...,.........................
8n) E gnx3
I Road/POI Textual Embedding
Given trajectory T (Ti, .2....,
.......TTa Tn) and the road network G, the initial textual embeddings
Zegs Zp, E for each road segment e; and POI p; corresponding to point T, are obtained as follows:
Linear( Canear(Eusstaoe (desc Road)) )), Fp. Linear( (E (desc POr))
(12)
where Etext denotes a shared pre-trained textual embedding module for mapping a line of text into
an embedding vector, for which we use the text-embedding---ltae model provided by OpenA
Next, we aggregate the global information from the origin 71 and destination Tn as well as the local information from neighboring road segments and POIs to update ze, and 2p, for futher semantic
25

---

capture. Specifically, we obtain the neighbor set N, of road segment according to G: while for the neighbor set N of POI pı, we consider POIs within a radius of R from p; and select the closest 10 the number exceeds, And we implement aggregation functions Agg Hoad (.), Agg")())) in Eq. as
follows:
Agg Road (Ze, Res Re, 1j E Mi) (BN(WW,, Σ JEN; wyze, + W2(WfZe, + w =e, )))
(13)
Agg POI
Agg (2p, &pi pm 1j NGT) (BN(WW. Σ JEN; wypp, Walwfzp, + +uf uffzp.)) ))),
where W...... W EXE are learnable parameters, o, denotes ReLU activation function, and BN represents batch normalization. The contribution weights wf, w of Tı and Tn depend on the time interval between 7; and each of them, i.e., = At,/At, w = w/. The weight w, the neighbor road segment éj depends on its textual relevance e;, calculated by global linear attention mechanism :)) and the transition probability Pig from E; to e; derived from all observed trajectories. Similarly, the weight uz of the neighbor POI pj is affected by its textual relevance to p; and their distance disty. Formally:
w (Att =e,)) appi
w/ N pp,) + (f(disi(((distt.)
(14)
Att(z;, 25) exp(v' CaanhhLinar(Cat(( 22)))) f(distj) cxp(-dist,y/ maxxex, (dist;))),
where (disss;; is the distance weighting function, Norm (-) is the I.1 normalization based on the corresponding neighbor set, v E E a learnable parameter, and a, 3 are hyper-parameters.
Futhermore, to explore the impact pre-trained textual embedding module on our model's per- formance, introduce two additional pre-trained textual embedding modules provided by Hug- gingFace i.e., hyllcchines--eertlarre alternative models has limited impact performance, demonstrating that our pre-training process enables the model to learn robust representations.
and
As shown in Tab. 12 using
Table 12: Impact of pre-trained textual embedding module Eiext on Chengdu dataset in all tasks. 1: higher better, lower better. Bold: the best, underline: the second best.
Task
Destination Prediction
Arrival Time Estimation
Similar Trajectory Search
Metric
GPS
Road Segmest
RMSE 1 (suconds)
MAE (seconds)
MAPE 1 (5)
Acce1 1 (%)
Acc85 (%)
Mean Rank
Method
RMSE
MAE
Acc@1
Acc
Recall
chinese-lert-lagg
4.65
bye- www--arr--h--ooinstaa
131.34
87.63
58.39
30.30
50.32
17.46 17.73
4.63
96.30
1.15
test-cmborllingg--Huu 2-raae
179.47
85.05
58.21
86.81
30.45
50.17
4.77
96.53
99.13
1.15
'btpss//huggingfacc.oo
26


Reviews:
[{"review_id": "gs542ddAAr", "reviewer": "Reviewer_7HKs", "summary": "The paper introduces TrajMamba, a Mamba-based framework for trajectory compression and embedding. The authors propose a Travel Purpose-aware Pre-training method to incorporate travel purpose information, thereby alleviating the burden of encoding textual descriptions through contrastive learning. Additionally, a Knowledge Distillation Pre-training scheme is introduced to explicitly eliminate redundant trajectory points using a selfsupervised paradigm. Experiments conducted on two real-world datasets demonstrate the effectiveness of the proposed model.", "questions": "See weaknesses.", "limitations": "Yes.", "rating": 6, "confidence": 5, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 3, "significance": 4, "originality": 4, "strengths_and_weaknesses": "Strengths:\n[S1] Using sentence embedding models and contrastive learning to capture trajectory travel intentions is both novel and promising. By shifting the computational burden to the offline phase, the training efficiency is greatly improved.\n[S2] The approach of using a mask and the Gaussian error function for self-supervised trajectory compression training is ingenious.\n[S3] The experimental setup is reasonable, and both the effectiveness and efficiency of the model are validated.\n\nWeaknesses:\n[W1] The discussion on trajectory compression is insufficient. Is there any analysis of the compressed trajectories, such as the average compression ratio? How were the weights (1/2) for the loss functions L^MEC and L^mask determined, and how do different weights affect downstream tasks and compression performance?\n[W2] There is a lack of discussion regarding the sentence embedding. The paper uses text-embedding-3-large; would using other models affect the performance of the proposed approach？", "was_revised": true, "final_justification": "The authors has addressed most of my previous concerns. Combing with other reviewers' comments, I decide to raise my score to 6.", "rebuttal": "We sincerely appreciate your recognition of our work—this means a great deal to us. Below, we address your doubts as follows.\n\n**[W1]** We provide the following supplementary analysis:\n\n- The average compression ratio of trajectories (=compressed length/raw length) on Chengdu and Xian is shown below. This result proves that our model successfully identifies and removes a considerable part of the implicit redundancy contained in trajectories, retaining key points that benefit trajectory embedding representation.\n\n  | Dataset | ratio after preprocessing | ratio after soft masking mechanism |\n  | ------- | -------------------------------------------------- | ------------------------------------------------------------ |\n  | Chengdu | 67.189%                                            | 42.159%                                                      |\n  | Xian    | 70.419%                                            | 35.094%                                                      |\n\n- We set the weights for the loss functions $L^{MEC}$ and $L^{mask}$ to 1/2 to balance these two objectives. A larger weight for $L^{MEC}$ results in compressed representations containing more information from the full-trajectory embedding; a larger weight for $L^{mask}$ produces shorter compressed trajectories from the mask generator, achieving greater compression. We conducted supplementary experiments on the Chengdu dataset to explore the impact of different weights on downstream tasks and compression performance. The results demonstrate that when the weights for ($L^{MEC}$, $L^{mask}$) are **(0.5, 0.5)**, our model achieves the best overall performance across all downstream tasks and encoding time.\n\n  | Task                  |             | Destination | Prediction  |             |             | Arrival    | Time       | Estimation | Similar   | Trajectory  | Search      | Embed Time |\n  | --------------------- | ----------- | ----------- | ----------- | ----------- | ----------- | ---------- | ---------- | ---------- | --------- | ----------- | ----------- | ---------- |\n  | Metric                | RMSE        | MAE         | Acc@1       | Acc@5       | Recall      | RMSE       | MAE        | MAPE       | Mean Rank | ACC@1       | ACC@5       | seconds    |\n  | (1.0, 0.0)            | **125.619** | 86.543      | 56.277%     | 83.854%     | 26.363%     | 51.766     | 19.657     | 5.335%     | 1.662     | 95.800%     | 98.300%     | 1.944      |\n  | (0.7, 0.3)            | 135.447     | 91.966      | 58.130%     | 86.362%     | 30.075%     | 54.509     | 17.940     | 4.802%     | 1.155     | **96.600%** | 98.900%     | 1.731      |\n  | (0.3, 0.7)            | 134.870     | 90.072      | 58.145%     | 86.546%     | 30.031%     | 50.978     | 18.556     | 5.053%     | 1.204     | 95.800%     | 98.800%     | **1.692**  |\n  | (**0.5, 0.5**) (Ours) | 129.474     | **85.947**  | **58.205%** | **86.813%** | **30.446%** | **50.166** | **17.727** | **4.772%** | **1.148** | 96.525%     | **99.125%** | 1.721      |\n\n**[W2]** We evaluated two additional pre-trained textual embedding modules from HuggingFace: `hfl/chinese-lert-large` and `BAAI/bge-large-zh-noinstruct`. We explored how different textual embedding modules affect our model's performance. The results show that using alternative models has limited impact on performance, demonstrating that our pre-training process enables the model to learn robust representations.\n\n| Task                    |             | Destination | Prediction  |             |             | Arrival    | Time       | Estimation | Similar   | Trajectory  | Search      |\n| ----------------------- | ----------- | ----------- | ----------- | ----------- | ----------- | ---------- | ---------- | ---------- | --------- | ----------- | ----------- |\n| Metric                  | RMSE        | MAE         | Acc@1       | Acc@5       | Recall      | RMSE       | MAE        | MAPE       | Mean Rank | ACC@1       | ACC@5       |\n| chinese-lert-large      | **127.967** | **83.727**  | 58.222%     | 86.717%     | **30.579%** | 50.245     | 17.755     | 4.653%     | **1.131** | **97.300%** | 99.300%     |\n| bge-large-zh-noinstruct | 131.338     | 87.626      | **58.390%** | 86.799%     | 30.298%     | 50.317     | **17.458** | **4.631%** | 1.153     | 96.300%     | **99.400%** |\n| TrajMamba               | 129.474     | 85.947      | 58.205%     | **86.813%** | 30.446%     | **50.166** | 17.727     | 4.772%     | 1.148     | 96.525%     | 99.125%     |\n\n\nWe sincerely hope that the above content has adequately addressed your questions and concerns. Your positive feedback has been highly encouraging, and we look forward to further enhancing the work with your continued guidance."}, {"review_id": "bL4nIwy11q", "reviewer": "Reviewer_e8aq", "summary": "This paper studies the problem of vehicle trajectory learning. To address it, this paper proposes TrajMamba, a semantic-rich trajectory learning framework that integrates GPS and road features via a dual-branch encoder, leverages travel purpose and applies knowledge distillation for trajectory compression. Experiments on two datasets demonstrate the effectiveness of proposed model.", "questions": "Q1: In the Hyperparameter Analysis section, shouldn’t the optimal value of E be 512 instead of 256 based on the results?\n\nQ2: For the DP task on road segments, why is Recall used as the evaluation metric instead of F1-score, which is more commonly adopted in the literature [4]?", "limitations": "Yes", "rating": 4, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 2, "clarity": 3, "significance": 2, "originality": 2, "strengths_and_weaknesses": "Strengths:\nS1: This paper investigates the fundamental vehicle trajectory learning problem.\nS2: This paper develops an efficient and semantic-rich vehicle trajectory pretraining model.\nS3: Experiments are conducted to demonstrate the effectiveness of the proposed method.\n\nWeaknesses:\n\nW1: The motivation of this paper is weak. \n(1) The claimed burden of textual modeling for extracting travel purposes seems overstated. Lightweight or offline text encoders (e.g., ALBERT-12M, MiniLM-22M, DistilBERT-66M) are widely available and effective, yet the paper neither adopts nor compares against these alternatives. Besides, the process for obtaining the initial textual embeddings in the Travel Purpose-aware Pre-training module is not clear. If these embeddings are derived using the above lightweight or offline encoders, the motivation that \"extracting travel purposes can be computationally heavy\" is questionable. Moreover, although the authors claim no additional overhead, the proposed dual-text encoder setup inherently introduces latent computational costs, making the efficiency claims difficult to verify.\n(2) The authors argue that redundant GPS points harm both efficiency and effectiveness, yet the claim regarding effectiveness is not well substantiated.\n\nW2: Although the paper presents some technical contributions, the proposed Traj-Mamba framework exhibits limited novelty, as it primarily adopts existing Mamba/SSM blocks—which have already been explored in trajectory modeling [1]—to model GPS and road views separately, followed by a simple linear fusion. Besides, this dual-view design for GPS and road views  is also a common paradigm in trajectory representation learning.\n\n[1] \"Trajectory mamba: Efficient attention-mamba forecasting model based on selective ssm.\" Proceedings of the Computer Vision and Pattern Recognition Conference. 2025.\n\nW3: The claimed effectiveness of the compression module is weakened by the use of existing rule-based preprocessing to remove explicit redundancy. This setup makes it difficult to disentangle the contribution of the proposed soft masking mechanism from that of the preprocessing itself. I recommend providing an case study to better validate the effectiveness of the learnable trajectory compression.\n\nW4. To justify the paper’s claim of achieving state-of-the-art performance, it is recommended to include recent work such as [2, 3,4] as baselines.\n\n[2] \"Mrgrp: Empowering courier route prediction in food delivery service with multi-relational graph.\" Companion Proceedings of the ACM on Web Conference. 2025.\n[3] \"UniTR: A Unified Framework for Joint Representation Learning of Trajectories and Road Networks.\" Proceedings of the AAAI Conference on Artificial Intelligence. 2025.\n[4] \"Path-LLM: A Multi-Modal Path Representation Learning by Aligning and Fusing with Large Language Models.\" Proceedings of the ACM on Web Conference. 2025.\n\nW5. The paper emphasizes efficiency, but the observed improvements are modest. Besides, a detailed complexity analysis is recommended to support the efficiency claims.", "was_revised": true, "final_justification": "The authors have addressed my comments in general. I have raised my score accordingly.", "rebuttal": "We sincerely appreciate your detailed and insightful comments, which are highly valuable for improving our work. We have carefully addressed each point below.\n\n**[W1]** We clarify the motivation as follows:\n\n(1) Our focus is **eliminating additional downstream overhead**, which is more critical for real-world applications (e.g., real-time trajectory encoding), rather than pre-training costs. As noted, pre-training is offline with flexible resources, so its computational costs are acceptable if enabling effective downstream inference. Addressing your concerns: \n\n- The initial textual embeddings are obtained using OpenAI's text-embedding-3-large model (See Appendix H). We apologize for omitting this. \n- Regarding lightweight text encoders, we acknowledge their effectiveness but emphasize they conflict with our downstream efficiency goal: (i) Their sizes (e.g., 45.8, 83.8, and 251.7MB) are 8–47× larger than our downstream module (5.407/5.182MB), increasing deployment memory. (ii) They typically require 1024+ hidden dimensions to encode complex textual information, while our model (and most standard trajectory learning models) uses approximately 256. Integrating them into downstream tasks would inevitably add non-negligible overhead. \n- The dual-text encoder is exclusive to offline pre-training and does not participate in downstream tasks. Therefore, it introduces no additional overhead in downstream inference, avoiding persistent computational costs.\n\n(2) The variant **\"w/o Compress\"** without compression in our ablation study shows consistent performance degradation across all downstream tasks, directly verifying that redundant GPS points harm effectiveness.\n\n**[W2]** We appreciate your attention to the novelty of the Traj-Mamba Encoder. The referenced Trajectory Mamba[1] and our TrajMamba differ fundamentally in their core goals and technical designs, which we clarify as follows:\n\n1. Trajectory Mamba is tailored for real-time autonomous driving decision-making, where the focus lies in short-term (seconds) behavior prediction at intersections. Its data is often high-frequency (10-20Hz) and captures precise, rule-bound maneuvers (e.g., lane changes, turns). In contrast, our work targets vehicle GPS trajectories from ITS (e.g., taxi, logistics), which is low-frequency (seconds level), sparse, and reflects long-term (minutes/hours) human mobility patterns. Moreover, our work aim to encode trajectories into semantically-rich embedding vectors, which can then be adapted to multiple downstream tasks. This pre-training paradigm represents a different technical direction from task-specific prediction models.\n\n2. Trajectory Mamba optimizes SSM for recursive forecasting efficiency in dynamic scenes. Our Traj-Mamba Encoder, however, targets capturing long-term movement patterns of trajectories by jointly modeling and fusing GPS and road perspectives with linear time complexity: (1) Unlike directly input-dependent parameterization, it uses high-order movement behavior features to parameterize GPS-SSM, enabling precise control over how trajectory movement behavior changes affect the input selection. (2) Instead of parallel dual-view modeling followed by independent fusion module, it adopts bidirectional interaction between GPS and road views. Road-SSM parameters are extended to trajectory geographical space (rather than road network space), selecting input embeddings based on changes in trajectory movement details, while GPS intermediate embeddings are also selected via a dot-product gate at road level. \n\n**[W3]** To address the potential confounding effect of preprocessing on the soft masking mechanism, we conducted experiments without rule-based preprocessing. The results show that removing preprocessing yields comparable performance to the full model across all downstream tasks, directly validating the efficacy of the proposed soft masking mechanism.\n\n\n| Task              | DP     |       |        |        |        | ATE   |       |       | STS       |        |        |\n| ----------------- | ------ | ----- | ------ | ------ | ------ | ----- | ----- | ----- | --------- | ------ | ------ |\n| Metric            | RMSE   | MAE   | Acc@1  | Acc@5  | Recall | RMSE  | MAE   | MAPE  | Mean Rank | ACC@1  | ACC@5  |\n| w/o preprocessing | 125.56 | 86.49 | 58.31% | 86.75% | 30.52% | 50.18 | 17.41 | 4.56% | 1.22      | 96.90% | 99.00% |\n| TrajMamba         | 129.47 | 85.95 | 58.21% | 86.81% | 30.45% | 50.17 | 17.73 | 4.77% | 1.15      | 96.53% | 99.13% |\n\nRegarding the case study, due to the fact that this rebuttal can only provide textual information and is unable to offer any additional content in any form, we kindly ask for your understanding regarding our inability to present it to you here. We promise to include this experiment in subsequent versions.\n\n**[W4]** We have reproduced UniTR[3] and included it in our experiments. The results show that TrajMamba outperforms UniTR across all downstream tasks with high encoding efficiency, supporting our SOTA claim.\n\n\n| Task      | DP      |         |        |        |        | ATE    |       |        | STS       |        |        | Embed Time |\n| --------- | ------- | ------- | ------ | ------ | ------ | ------ | ----- | ------ | --------- | ------ | ------ | ---------- |\n| Metric    | RMSE    | MAE     | Acc@1  | Acc@5  | Recall | RMSE   | MAE   | MAPE   | Mean Rank | ACC@1  | ACC@5  | seconds    |\n| UniTR     | 3081.90 | 2689.76 | 27.75% | 52.41% | 6.83%  | 114.13 | 53.69 | 11.92% | 1.25      | 95.20% | 98.40% | 6.170      |\n| TrajMamba | 129.47  | 85.95   | 58.21% | 86.81% | 30.45% | 50.17  | 17.73 | 4.77%  | 1.15      | 96.53% | 99.13% | 1.721      |\n\n\nRegarding the other two works: (1) MRGRP[2] is dedicated to courier route prediction in food delivery services. It takes a set of discrete pick-up and delivery tasks as inputs and focuses on optimizing task scheduling with strict order constraints (e.g., delivery must follow pick-up for the same order). This differs fundamentally from our scenario: we process vehicle GPS trajectories and aim to learn semantically-rich embeddings for diverse downstream tasks, rather than task scheduling. (2) Path-LLM[4] studies path representation learning, where \"path\" refers to a theoretically navigable route on the road network, not the actual GPS trajectory generated by vehicle movement (which records real spatio-temporal behaviors). Its focus is on aligning path semantics with language models for navigation-related tasks, which does not overlap with our multi-downstream scenario. Due to these fundamental differences in input data, core objectives, and application scenarios, MRGRP and Path-LLM are not suitable as baselines for our work.\n\n**[W5]** Below we provide a detailed complexity analysis of TrajMamba's downstream components (Mask Generator + Traj-Mamba Encoder), compared with typical baselines JGRM and START.\n\n**Inference Time Complexity of TrajMamba**:\n\n1. Symbols Definition: $d$ is the number of trajectory point features for the input mask generator, $E$ is the embedding dimension, $L$ is the number of Traj-Mamba blocks, and $n, n'$ are the lengths of the input trajectory and the compressed trajectory after processing by the Mask Generator, respectively. \n2. In the mask generator, the time complexity is $O(nd^2)$.\n3. For the Traj-Mamba Encoder, the time complexity is $O(n'dE)$ and $O(Ln'E^2)$ for embedding initial latent vector and $L$ stacked Traj-Mamba blocks, respectively.\n4. The combined time complexity of TrajMamba is $O(nd^2+n'd E+Ln'E^2)$\n\n**Complexity of Typical Baselines**:\n\n- JGRM: $O(mE^2+L_rm^2E+L_f(2m)^2E)$, where $m$ is the number of unique road segments in trajectories, and $L_r, L_f$ are the numbers of route encoder layers and model interaction layers, respectively.\n- START: $O(L_gH|\\mathcal{V}|E^2+L_en^2E)$, where $|\\mathcal{V}|$ is the number of road segments in the road network, $H$ is the number of attention heads used by TPE-GAT, and $L_g, L_e$ are the numbers of TPE-GAT layers and TAT-Enc layers, respectively. \n\n**Conclusion**: TrajMamba achieves linear inference time complexity with respect to trajectory length $n$ by avoiding the quadratic terms present in baselines: JGRM introduces $O(m^2)$ from Transformer-based modules, while START relies on $O(n^2)$. This design ensures encoding efficiency for long or large-batch trajectories in real-world scenarios, which is crucial for real-time applications.\n\n**[Q1]** In Fig.4(b), the performance at E=256 shows significant improvement compared to E=128, but the improvement at E=512 is limited. Considering the increase in model size and encoding time resulting from changing E from 256 to 512 (which affects downstream inference efficiency and contradicts our goal of efficient inference), we chose E=256 to balance performance and efficiency.\n\n**[Q2]** We concur F1-score is a widely recognized metric for multi-class DP tasks. Our DP task involves predicting trajectory destinations at both road segment and GPS levels. For the latter, RMSE and MAE are necessary to measure prediction errors. Due to table width constraints, we selected metrics for road segment prediction following [5], and reasoned that these metrics provide complementary perspectives. To address your question, we provide supplementary F1-score results as follows, which are consistent with our Accuracy/Recall performance:\n\n\n| Dataset   | Chengdu / Xian  |\n| --------- | --------------- |\n| START     | 20.63% / 15.13% |\n| MMTEC     | 20.26% / 15.87% |\n| JGRM      | 21.35% / 16.18% |\n| TrajMamba | 27.04% / 18.50% |\n\n[5] \"TrajCogn: Leveraging LLMs for Cognizing Movement Patterns and Travel Purposes from Trajectories.\" Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI). 2025\n\nThank you again for your earnest efforts in identifying weaknesses and raising relevant questions. We hope these supplements meet your expectations and look forward to further suggestions for improvement."}, {"review_id": "tMzm3WcsbJ", "reviewer": "Reviewer_9qTq", "summary": "This paper proposes an efficient and semantics-rich vehicle-trajectory learning called TrajMamba which consists of three coordinated components. On two DiDi taxi datasets (Chengdu & Xi’an), TrajMamba improves over nine SOTA baselines on three downstream tasks—destination prediction, arrival-time estimation, and similar-trajectory search.", "questions": "(1) Do the other methods in Table 7 also have pre-training stage? If they do not have a separate pre-training stage, what is the setting and is this fair?\n\n(2) See weakness.", "limitations": "Yes.", "rating": 6, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 3, "significance": 3, "originality": 3, "strengths_and_weaknesses": "Strengths\n\n(1) The work tackles the real-world bottleneck of scaling semantic trajectory analytics, efficiently modelling GPS traces while preserving travel-purpose information.\n\n(2) By replacing quadratic self-attention with linear SSM blocks and adding a learnable compression module, the whole pipeline keeps time- and memory-costs low.\n\n(3) Three downstream tasks (destination prediction, arrival-time estimation, similar-trajectory search) are evaluated on two large-scale city datasets, with comprehensive ablations, sensitivity studies and efficiency baselines.\n\nWeaknesses\n\n(1) DP task only computes the MAE/RMSE for the last coordinate and path-aware metrics are absent, which may not reflect the exact learning ability of the trajectory representation.\n\n(2) In Table 7, the “w/o FT” variant underperforms fine-tuned models by a large margin. Without stronger evidence, it is difficult to assess the intrinsic value of the pre-training stage.", "was_revised": true, "final_justification": "The authors’ response fully addresses all issues, so I will raise my rating to strong accept.", "rebuttal": "We sincerely appreciate your recognition of our work—this means a great deal to us. Below, we address your doubts as follows.\n\n**[W1]** For the DP task, we believe our paper already employs path-aware metrics for performance evaluation. In Section 5.1, beyond computing the MAE/RMSE for the last coordinate, we also predict trajectory destinations **at the road segment level** to assess model performance. This road segment prediction is treated as a multi-classification task, optimized via cross-entropy loss, with evaluation metrics including Accuracy@N (Acc@1, Acc@5) and macro-Recall. We consider these metrics as 'path-aware metrics' because road segments are intrinsic components of the path itself. Predicting road segments and evaluating via these indicators directly reflects our model's ability to learn and predict path-related information. Compared to relying solely on MAE/RMSE for final coordinates, this approach enables a more comprehensive evaluation of the model's capability in the DP task across multiple dimensions. Detailed results are presented in Tables 1, 7, and 8. If our understanding of \"path-aware metrics\" differs from your expectation, we sincerely apologize and look forward to your clarification in the second round of review.\n\n**[W2/Q1]** For the without fine-tune setting used in our experiments, we clarify that all models under this setting fix their parameters after the pre-training stage and only update the predictors' parameters. In other words, the other methods in Table 7 also have a pre-training stage, and all models simply do not participate in fine-tuning with task supervision (only predictors are trained). To assess the intrinsic value of the pre-training stage, the variants **\"w/o Purpose\"** and **\"w/o KD\"** in our ablation study remove the two training stages proposed in the paper (for DP and ATE tasks under the fine-tune setting), and their worse performance compared to our complete model demonstrates that both pre-training procedures contribute to TrajMamba's performance. Moreover, we supplement the performance of these **variants under the w/o ft setting on the Chengdu dataset** to further demonstrate the effectiveness of the two training stages.\n\n| Task        |             | Destination | Prediction  |             |             | Arrival    | Time       | Estimation  |\n| ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | ---------- | ---------- | ----------- |\n| Metric      | RMSE        | MAE         | Acc@1       | Acc@5       | Recall      | RMSE       | MAE        | MAPE        |\n| w/o Purpose | 405.480     | 330.212     | 51.392%     | 77.038%     | 22.023%     | 106.729    | 52.578     | 12.931%     |\n| w/o KD      | 639.438     | 512.874     | 41.778%     | 68.915%     | 14.376%     | 118.398    | 65.387     | 15.548%     |\n| TrajMamba   | **365.602** | **291.119** | **51.954%** | **77.722%** | **22.953%** | **92.519** | **44.889** | **11.073%** |\n\nWe sincerely hope that the above content has adequately addressed your questions and concerns. Your positive feedback has been highly encouraging, and we look forward to further enhancing the work with your continued guidance."}, {"review_id": "X8PEvtZ1bA", "reviewer": "Reviewer_ewCK", "summary": "This paper proposes an efficient and semantically rich pre-trained model for vehicle trajectory design, TrajMamba. The model primarily addresses two core challenges: First, efficiently extracting travel purposes related to road and POI features; Second, how to handle redundant data points in real trajectories to improve computational efficiency and embedding quality. Specifically, TrajMamba comprises three key components:  Traj-Mamba Encoder jointly models GPS and road perspective to capture complex vehicle movement patterns.  Travel Purpose-Aware Pre-training aligns the trajectory embeddings learned by the model with travel purposes extracted from road and POI text information, enabling the model to understand travel intent without incurring additional computational overhead. Knowledge Distillation Pre-training uses a learnable masking generator to identify and compress key points in trajectories, yielding efficient and information-rich compressed trajectory embeddings.   Extensive experiments on two real-world datasets and three downstream tasks demonstrate that TrajMamba outperforms current state-of-the-art baseline models in both accuracy and efficiency.", "questions": "1. Regarding the trajectory compressor or mask generator, does it mainly remove redundant trajectory points? What is the effect of directly downsampling the trajectory by a certain ratio?\n2. Regarding the task of arrival time estimation, the setting seems somewhat unreasonable. Typically, trajectory points have similar sampling frequencies, and predictions based on start and end points or road segment sequences should be more realistic.", "limitations": "yes", "rating": 4, "confidence": 5, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 2, "significance": 3, "originality": 2, "strengths_and_weaknesses": "Strengths:\n1. TrajMamba can effectively extract two key types of semantic information from vehicle trajectories. The first is to capture continuous “movement patterns” by jointly modeling GPS and road perspectives. The second is to efficiently learn “travel purposes” from road and POI information through pre-training.\n2. The proposed model uses knowledge distillation pre-training and a learnable mask generator to effectively identify and compress redundant points in trajectories, thereby improving computational efficiency and embedding quality.\n3. The experiments conducted on two real-world datasets and three downstream tasks demonstrated that TrajMamba outperforms existing state-of-the-art baseline models and exhibits efficiency in terms of model size and computation time.\n4. The proposed model offers scalability. Compared with other advanced models, TrajMamba can achieve better performance with less training data and shorter fine-tuning time.\n\n\nWeaknesses：\n1. The performance of the model depends heavily on high-quality external data, including accurate road network maps, POI information, and the accuracy of the map-matching algorithm. If these external data contain noise or are missing (which is common for trajectory data), the performance of the model may decline.\n2. This paper proposes a two-stage pre-training process that includes “purpose perception” and “knowledge distillation.” However, the article does not fully argue why these two independent stages are necessary, and whether training directly using compressed trajectories can achieve the same effect.\n3. This paper claims that the model is efficient, mainly in terms of the final embedding computation (inference) time and model size. However, this paper uses a two-stage training framework and combines many modules and additional information collection operations, the efficiency of which may not be satisfactory and may mislead readers' judgment.\n4. The experiment was conducted only on trajectories in two Chinese cities (Chengdu and Xi'an) and provided by the same organization. The homogeneity of this dataset raises questions about the model's generalization ability.", "was_revised": true, "final_justification": "The overall quality of this work is satisfactory, but the generalization performance and efficiency issues of the model still further limit its applicability.", "rebuttal": "We sincerely appreciate your detailed and insightful comments, which are highly valuable for improving our work. We have carefully addressed each point below.\n\n**[W1]** Here is our clarification of external data quality's influence on performance, based on the actual design and implementation:\n\n- Our model does rely on city road networks and POI data, which are independent of trajectory data. However, these can be easily obtained through the following means: (1) Road networks from OpenStreetMap, a widely used open-source platform with stable data quality. (2) POI information from reliable map APIs like AMap and Google Maps. Such sources are widely available and effective, ensuring stable and high-quality data that is less prone to noise or missing information. For our experimental datasets, we directly obtained these external data through the above channels. \n\n- Regarding the accuracy of map-matching algorithms, it is common practice to use such algorithms (e.g., FMM[1], LMM[2]) to map GPS trajectories to urban road networks. Most recent map-matching algorithms have strong capabilities to handle noisy data and complex road networks.\n\n  [1] Can Yang and Gyozo Gidofalvi. 2018. Fast map matching, an algorithm integrating hidden Markov model with precomputation. International Journal of Geographical Information Science 32, 3 (2018), 547–570.\n\n  [2] Wannes Meert and Mathias Verbeke. 2018. HMM with non-emitting states for Map Matching. In ECDA.\n\n**[W2]** This design is rooted in the **teacher-student framework** of knowledge distillation, where a well-trained teacher model transfers knowledge to a student model. Specifically: \n\n- The travel purpose-aware pre-trained teacher model first learns semantically-rich embeddings from **complete trajectories**, capturing both movement patterns and travel purposes. This aligns with the principle that a knowledgeable teacher is essential for effective knowledge transfer.\n- In knowledge distillation pre-training stage, the student model then learns to generate compressed trajectory representations guided by the teacher's output embeddings. This avoids the instability of training two uninformed student models to learn from each other. They may fall into the local optimal solution during training, unable to obtain an effective learning direction, which will lead to training collapse.\n\nMoreover, we designed an ablation variant **\"w/o KD\"** in our ablation study, which removes the knowledge distillation pre-training and **directly trains compressed representations through travel purpose-aware pre-training**. Its worse performance compared to our complete model demonstrates that the two-stage pre-training procedure is necessary and effective for TrajMamba's performance.\n\n**[W3]** Our efficiency focus is explicitly on **downstream inference**—the phase critical for real-world applications (e.g., real-time trajectory encoding), rather than pre-training. \n\nThe two-stage training, along with additional modules and information collection, are part of the offline pre-training process. Pre-training involves more flexible resource allocation, so their computational costs are acceptable. Importantly, these components do not participate in downstream tasks: they are only used during model training, leaving no additional overhead in real-world applications.\n\nThis design ensures that the efficiency metrics we highlight—final embedding computation time—accurately reflect the performance users will experience in deployment, avoiding the persistent downstream costs that would arise from alternative designs.\n\n**[W4]** To address this, we conducted supplementary experiments on a new real-world trajectory dataset: **Porto**. Hosted on Kaggle for a taxi trajectory prediction contest, this dataset is widely used in TRL studies and contains GPS trajectories of taxis in Porto, Portugal. We obtained POI information from the Azure Maps API and road networks from OpenStreetMap.\n\nWe re-evaluated our model and several best-performing baselines from the Chengdu and Xi'an datasets, including **START, MMTEC, and JGRM**, on the Porto dataset across all downstream tasks. The results demonstrate that our model maintains consistent performance advantages over baselines on the Porto dataset, aligning with its behavior on the Chengdu and Xi'an datasets. These experimental results verify our model's generalization ability across trajectories from different geographical regions and data sources. \n\n| Task      |             | Destination | Prediction  |             |            | Arrival    | Time      | Estimation | Similar   | Trajectory  | Search      |\n| --------- | ----------- | ----------- | ----------- | ----------- | ---------- | ---------- | --------- | ---------- | --------- | ----------- | ----------- |\n| Metric    | RMSE        | MAE         | Acc@1       | Acc@5       | Recall     | RMSE       | MAE       | MAPE       | Mean Rank | ACC@1       | ACC@5       |\n| START     | 329.393     | 222.210     | 23.655%     | 51.459%     | 6.692%     | 15.435     | 5.134     | 0.860%     | 7.398     | 83.500%     | 88.800%     |\n| MMTEC     | 331.370     | 225.183     | 23.569%     | 51.065%     | 6.369%     | 17.193     | 7.413     | 1.124%     | 5.160     | 81.900%     | 89.600%     |\n| JGRM      | 315.479     | 217.562     | 23.981%     | 51.643%     | 6.804%     | 13.584     | 5.384     | 0.864%     | 2.156     | 88.900%     | 95.800%     |\n| TrajMamba | **296.413** | **194.835** | **24.156%** | **52.464%** | **7.696%** | **10.680** | **4.417** | **0.768%** | **1.664** | **94.800%** | **99.300%** |\n\n**[Q1]** Yes, our mask generator primarily identifies key trajectory points and removes redundant ones. We conducted supplementary experiments to compare its effect with directly downsampling trajectories by a certain ratio (sampling ratio=60%) across all downstream tasks on the Chengdu dataset. These results verify our mask generator's ability to identify key trajectory points for effective compression, which is superior to direct downsampling. \n\n| Task                  |             | Destination | Prediction  |             |             | Arrival    | Time       | Estimation | Similar   | Trajectory  | Search      |\n| --------------------- | ----------- | ----------- | ----------- | ----------- | ----------- | ---------- | ---------- | ---------- | --------- | ----------- | ----------- |\n| Metric                | RMSE        | MAE         | Acc@1       | Acc@5       | Recall      | RMSE       | MAE        | MAPE       | Mean Rank | ACC@1       | ACC@5       |\n| directly downsampling | 150.700     | 106.353     | 53.124%     | 80.460%     | 23.158%     | 54.695     | 19.553     | 5.562%     | 2.161     | 95.100%     | 98.800%     |\n| TrajMamba             | **129.474** | **85.947**  | **58.205%** | **86.813%** | **30.446%** | **50.166** | **17.727** | **4.772%** | **1.148** | **96.525%** | **99.125%** |\n\nAdditionally, we designed an ablation variant **\"w/o MG\"** in our ablation study, which replaces the mask generator with the Douglas-Peucker algorithm to generate compressed trajectories. Its worse performance compared to our complete model in the DP task also indicates the advantages of our mask generator for various downstream tasks.\n\n**[Q2]** In our experimental datasets (Chengdu and Xi'an), trajectory points do not have strictly uniform sampling intervals—unlike the Porto dataset, which has a fixed 15-second interval. While most trajectories have sampling intervals of at least 6 seconds, there is significant variability:\n\n| Dataset                                          | Chengdu | Xian   |\n| ------------------------------------------------ | ------- | ------ |\n| Average sampling interval                        | 6.33    | 12.55  |\n| Median sampling interval                         | 6.00    | 12.00  |\n| Standard deviation of sampling interval          | 13.49   | 22.31  |\n| Proportion of sampling interval <6s / <12s       | 5.59%   | 7.48%  |\n| Proportion of sampling interval 6s / 12s         | 88.27%  | 83.56% |\n| Proportion of sampling interval 7\\~10s / 13\\~15s | 4.85%   | 6.92%  |\n| Proportion of sampling interval >10s / >15s      | 1.27%   | 2.03%  |\n\nMoreover, our ATE task is designed to predict the end time of **trajectories still in movement**. This setting aligns with practical scenarios such as ride-hailing arrival time estimation and traffic management, where real-time estimation of remaining travel time for ongoing trips holds substantial application value. These variations and task design choices reflect real-world trajectory data characteristics and practical needs, enhancing the model's adaptability to real-world scenarios. \n\nThank you again for your earnest efforts in identifying weaknesses and raising relevant questions. We hope these supplements meet your expectations and look forward to further suggestions for improvement."}]

Author rebuttal:

Meta-review: The paper introduces TrajMamba, a Mamba-based framework for trajectory compression and embedding. It has a Travel Purpose-aware Pre-training method to incorporate travel purpose information. This approach alleviates the burden of encoding textual descriptions through contrastive learning. In addition, it introduces a Knowledge Distillation Pre-training scheme to remove redundant trajectory points via self-supervised learning. Experiments demonstrate the effectiveness of the proposed approach.

All reviewers agreed to accept the paper after rebuttal. The AC agrees with the decision and recommends it as  a highlight, given its potential to guide future research on large-scale trajectory representation learning.
Decision: Accept (spotlight)