Abstract
TrajTok is a hybrid trajectory tokenizer designed for autonomous driving models utilizing the next-token prediction paradigm. By integrating rule-based gridding with data-driven filtering and expansion, TrajTok addresses common pitfalls in purely data-driven tokenization, such as insufficient coverage, asymmetry, and lack of robustness. This approach secured 2nd place in the 2025 Waymo Open Sim Agents Challenge (WOSAC), demonstrating superior performance in realism and map-based metrics.
Introduction
Discretizing continuous trajectories into discrete tokens is a foundational step for applying language modeling techniques to autonomous driving simulators. However, standard data-driven methods like k-disks often suffer from limited generalization to rare maneuvers, physical asymmetry, and sensitivity to dataset noise. TrajTok bridges this gap by combining the structure of rule-based systems with the flexibility of data-driven approaches to create a more robust and representative vocabulary.
Methods
The TrajTok pipeline involves four key stages designed to refine the tokenization process:
- Data Preparation & Flipping: Trajectories are normalized and flipped along the x-axis. This ensures that the resulting vocabulary is perfectly symmetric, reflecting the physical reality that vehicles can maneuver similarly in both directions.
- Gridding: The trajectory space is partitioned into a grid based on the endpoints of the paths.
- Filtering & Expanding: A binary map identifies valid regions. The system filters out "noisy" cells (those with very few neighbors) and expands into empty but plausible regions to ensure the model can represent paths not explicitly found in the training dataset.
- Generating: Tokens are generated for each valid grid cell. For expanded cells lacking empirical data, synthetic paths are created via curve interpolation to ensure they remain kinematically feasible.
Additionally, the authors employ Spatial-Aware Label Smoothing during training. Unlike standard label smoothing which treats all incorrect predictions as equally bad, this method assigns higher probability to tokens that are spatially proximal to the ground truth, helping the model learn the underlying geometric structure of movement.
Results and Discussion
Evaluated on the Waymo Open Motion Dataset (WOMD) for the 2025 WOSAC, TrajTok achieved a Realism Meta score of 0.7852, ranking 2nd overall. Notably, it outperformed all competitors in map-based metrics with a score of 0.9207, indicating high compliance with environmental constraints.
Key insights from the challenge include:
- Symmetry as a Prior: Purely data-driven models often struggle with asymmetric data distributions (e.g., more right turns than left turns). Forcing symmetry improves generalization across diverse driving scenarios.
- Coverage vs. Distribution: Expanding the token space beyond the training distribution allows the model to "imagine" valid paths it hasn't seen before, which is critical for long-tail safety scenarios.
- Vocabulary Scaling: Unlike traditional methods that degrade with larger vocabularies due to noise overfitting, TrajTok benefits from high-resolution tokenization (up to 8,000 tokens for vehicles), allowing for finer control in path planning.
Conclusion
TrajTok demonstrates that a hybrid approach to trajectory tokenization can significantly enhance the realism and map-compliance of autonomous driving simulators. By addressing the limitations of purely data-driven methods, it provides a more robust foundation for next-token prediction models in complex urban environments. Future work will focus on automating hyperparameter tuning for varied agent types and optimizing the computational overhead associated with large vocabularies.
Summary updated