The advent of autonomous vehicles (AVs) is expected to transform the current transportation system into a safe and reliable one. The existing infrastructures, operational criteria, and design method were developed to meet the requirements of human drivers. However, previous studies have shown that in the traditional horizontal and vertical combined design methods, where the two-dimensional alignment elements change, there are varying changes in curvature and torsion, which cause the continuous degradation of the spatial curve and torsion. This continuous degradation will inevitably cause changes in the trajectory of Autonomous Vehicles (AVs), thereby affecting driving safety. Therefore, studying the characteristics of autonomous vehicles trajectory deviation has theoretical significance for optimizing highway alignment safety design. Driving simulation tests were performed by using PreScan and Simulink to calibrate the lateral deviation. A machine learning approach called the Gradient Boosting Decision Tree (GBDT) algorithm was implemented to build a model and express the relationship between space alignment parameters and lane deviation. The results showed that the AV’s driving trajectory is significantly affected by the space alignment factors when the vehicle is driving in the inner lane, the downhill section, and the left-turn section. These findings will provide a novel perspective for road safety research based on autonomous vehicle driving trajectories.