## 3 Description of the Dataset and Data Processing
The reason for this step is that the length of environmental features ultimately input to the model is fixed, while the number of points recorded in different scenes varies greatly. Therefore, it is necessary to extract a fixed number of key points to eliminate the data source difference between different scenes. The main selection idea is to retain all points for the left and right lane boundaries because these points are relatively few in number and have a significant influence on drivers' decisions such as turning and lane changing. For the lane centerline, points are selected at intervals, with the interval length calculated based on the remaining available key points that can be selected. In the second step, the spatial relationships between vehicles and all key points in the scene are calculated, including relative coordinates (Equations (1) and (2)), distances (Equation (3)), and the angles (Equation (4)) between them. It is worth stating that this process is performed on all vehicles in the scene. Thus, it ensures that all final output trajectories are fully referenced to the road information based on each vehicle's own perspective. First, the coordinates of the last frame of a vehicle in the scene \((X,Y)\), and the coordinates of the key point of the road \((X_{i},Y_{i})\) are read. \(N\) represents the total number of key points in this scene. The relative coordinates \(\left(X_{i}^{r},Y_{i}^{r}\right)\) are calculated by the following equation:  
\[X_{i}^{r}=X-X_{i},\;i\in[0,N) \tag{1}\]  
\[Y_{i}^{r}=Y-Y_{i},\;i\in[0,N) \tag{2}\]  
Relative coordinates can also avoid the situation where the large difference in coordinate values in different scenes leads to gradient explosion in the training process. The distance and angle between the vehicle and the key road point are also calculated as follows:  
\[Distance_{i}=\sqrt{\left(X-X_{i}\right)^{2}+\left(Y-Y_{i}\right)^{2}},\;i\in[ 0,N) \tag{3}\]  
\[Angle_{i}=arctan\left(\frac{Y-Y_{i}}{X-X_{i}}\right),\;i\in[0,N) \tag{4}\]  
Finally, the features of each node obtained above are integrated into a feature matrix, and the adjacency matrix is established based on the relationship between key road points. The value of the adjacency matrix is determined based on whether the key road points belong to the same lane, and its equation is as follows:  
\[adj\_norm[i][j]=\left\{ \begin{array}{ll}1,&if\;i\
eq j\;and\;lane\_id[i]= lane\_id[j]\\ 0,&otherwise\end{array} \right.,\;i,j\in[0,N) \tag{5}\]  
where \(i\) and \(j\) are any two key road points in a scene. \(lane\_id[i]\) represents the ID of the lane where key point \(i\) is located, and the same goes for \(lane\_id[j]\). Figure 2: Road data preprocessing process. In addition to the historical trajectory of a vehicle and the road information of the scene where the vehicle is situated, our model also needs to fully consider the relationships between different vehicles. This part of the work can also be completed in the data pre-processing stage, which has the benefit of avoiding repetitive calculations in each training round, and thus training time is reduced. The calculation method of the relationship matrix \(R\) is improved on the PECNet model, which calculates \(R\) based on whether vehicles are temporally and spatially adjacent [28]. The calculation equation for \(R\) is as follows:  
\[R[A][B]=\left\{ \begin{array}{ll}0,&if\ A=B\ or\ min_{1\leq i\leq t_{max}} \sqrt{\left(X_{i}^{A}-X_{B}^{B}\right)^{2}+\left(Y_{i}^{A}-Y_{i}^{B}\right)^{ 2}}>dis\_thresh\\ 0,&min\ \left(min_{1\leq i\leq t_{max}}|F_{t}^{A}-F_{1}^{B}|,min_{1\leq i\leq t_{ max}}|F_{t}^{B}-F_{1}^{A}|\right)>time\_thresh\\ 1,&otherwise\end{array} \right. \tag{6}\]  
\(A\) and \(B\) represent the serial numbers of any two vehicles in a scene, \(t_{max}\) represents the maximum sequence number of historical trajectories (i.e., 50), and \(F\) represents the corresponding timeframe in the entire scene record.