Predicting the Road Ahead: Can Language Models Navigate Traffic?

Author: Denis Avetisyan


Researchers are exploring how large language models can leverage map data and understand traffic scenes to accurately forecast the movements of vehicles.

The proposed framework leverages a multi-modal approach, integrating ego and neighboring vehicle trajectories alongside local high-definition maps, and processes this data through frozen large language models to forecast future movement patterns.
The proposed framework leverages a multi-modal approach, integrating ego and neighboring vehicle trajectories alongside local high-definition maps, and processes this data through frozen large language models to forecast future movement patterns.

A novel framework demonstrates that frozen large language models, when combined with HD maps, offer improved spatio-temporal reasoning for vehicle trajectory prediction.

While large language models (LLMs) demonstrate promising reasoning capabilities, their effective application to complex, real-world tasks like autonomous driving requires a nuanced understanding of both dynamic agents and static environments. This is addressed in ‘Frozen LLMs as Map-Aware Spatio-Temporal Reasoners for Vehicle Trajectory Prediction’, which introduces a framework leveraging frozen LLMs for vehicle trajectory prediction by fusing spatial and temporal information with high-definition map data. Results demonstrate that incorporating map semantics significantly enhances prediction accuracy and that this approach generalizes across diverse LLM architectures. Could this framework unlock a new paradigm for integrating LLMs into safety-critical autonomous systems, moving beyond perception to robust, map-aware reasoning?


Decoding Dynamic Scenes: The Challenge of Spatio-Temporal Prediction

The core challenge for autonomous vehicles lies not simply in seeing the world, but in anticipating its immediate future. Precise prediction of surrounding agents – pedestrians, cyclists, and other vehicles – is paramount for safe and efficient navigation. This demands a robust capacity for spatio-temporal reasoning, a complex interplay of understanding both where objects are in space and how their positions will change over time. Unlike static map interpretation, this predictive capability requires systems to model the dynamics of motion, factoring in velocity, acceleration, and potential interactions between multiple actors in the environment. Effectively forecasting these movements, even fractions of a second into the future, allows the vehicle to proactively adjust its path, avoiding collisions and navigating complex driving scenarios with human-like foresight.

Current approaches to predicting the behavior of vehicles and pedestrians often fall short due to difficulties in synthesizing static map data with the ever-changing dynamics of traffic. These traditional methods typically treat map information – lane markings, traffic signals, road geometry – and trajectory data – positions, velocities, accelerations – as separate inputs, failing to fully leverage the crucial interplay between environment and movement. This disconnect limits the system’s ability to anticipate maneuvers, particularly in complex scenarios like intersections or merging lanes, where contextual awareness is paramount. Consequently, forecasts become less reliable, hindering the development of truly autonomous driving systems that require not only where an agent is, but how the surrounding environment will influence its future path.

Accurate forecasting of behavior in dynamic driving scenarios isn’t simply about tracking individual vehicles; it demands a system that deciphers the intricate web of interactions between all agents. Successful prediction requires modeling not just where an object is going, but why, considering the influence of surrounding traffic, pedestrian behavior, and even subtle cues like signaling intentions. This necessitates moving beyond isolated trajectory prediction to a holistic understanding of the scene, where the actions of one entity are recognized as both a cause and effect of the actions of others. Consequently, advanced systems are now designed to interpret these relationships, anticipating maneuvers based on contextual awareness and the likely responses of surrounding actors – a critical step towards truly autonomous navigation.

Trajectory predictions accurately reflect the surrounding environment, successfully navigating straight paths, turns, and complex intersections.
Trajectory predictions accurately reflect the surrounding environment, successfully navigating straight paths, turns, and complex intersections.

LLM-Driven Scene Understanding: A Paradigm Shift in Prediction

Current methods for traffic scene prediction typically rely on recurrent neural networks or convolutional neural networks to model agent behavior; however, these approaches often struggle with long-range dependencies and complex interactions. This work introduces a paradigm shift by leveraging Large Language Models (LLMs) – pre-trained on extensive text corpora – to encode and reason about traffic scenes. By framing scene understanding as a language modeling task, we can exploit the LLM’s inherent ability to capture contextual information and perform complex inference. Specifically, spatio-temporal data representing agent trajectories and surrounding environments is converted into a tokenized sequence, which serves as input to the LLM. This allows the model to predict future states by generating subsequent tokens, effectively forecasting agent behavior based on learned patterns and contextual awareness, offering a significant advancement over traditional predictive methodologies.

The Reprogramming Adapter addresses the incompatibility between the continuous, high-dimensional spatio-temporal data inherent in traffic scenes and the discrete token-based input requirements of Large Language Models. This adapter employs a series of learned linear projections and quantization layers to transform raw feature vectors – representing object positions, velocities, and headings over time – into a fixed-length sequence of discrete tokens. Specifically, the adapter discretizes continuous feature values into a vocabulary of predefined bins, effectively converting the analog data into a digital representation the LLM can process. This process includes a learned embedding layer to map each token to a vector representation, allowing the LLM to capture relationships between different feature values and temporal dynamics within the scene.

The Feature Fusion Module integrates two primary data streams to create a holistic scene representation: agent trajectory data and semantic map features. Trajectory data, consisting of historical position and velocity information for each agent in the scene, is processed to capture dynamic movement patterns. Simultaneously, semantic map features, derived from high-definition maps, provide static contextual information such as lane boundaries, road types, and traffic signal locations. These two data streams are then combined using a learned weighting mechanism within the module, allowing the model to prioritize relevant information from each source. The resulting fused feature vector encapsulates both the historical behavior of agents and the static environmental context, providing a richer input to the LLM for improved scene understanding and prediction.

Across varying time horizons, LLaMA3 consistently outperforms LLaMA2 in both Absolute and Final Displacement Error (ADE/FDE) metrics, and the utilization of Map further enhances performance for both models.
Across varying time horizons, LLaMA3 consistently outperforms LLaMA2 in both Absolute and Final Displacement Error (ADE/FDE) metrics, and the utilization of Map further enhances performance for both models.

Rigorous Validation: Quantifying Predictive Accuracy on the nuScenes Dataset

The nuScenes dataset was utilized for comprehensive evaluation of the proposed framework. This dataset is a large-scale benchmark specifically designed for the development of autonomous driving perception and prediction algorithms, comprising 1000 driving scenes with over 1.5 million annotated 3D bounding boxes. Data modalities include LiDAR point clouds, radar data, camera images, GPS localization, IMU measurements, and vehicle telemetry. The complexity of nuScenes stems from its realistic urban driving scenarios, diverse agent behaviors, and challenging environmental conditions, making it a suitable platform for assessing the robustness and accuracy of prediction models.

The Feature Fusion Module employs a Cross-Attention mechanism to integrate trajectory and map features, enabling the model to leverage contextual information from both sources. This process involves querying the trajectory features using the map features as keys and values, and vice-versa, allowing the module to selectively attend to relevant information from each modality. Specifically, the Cross-Attention layers compute attention weights based on the similarity between trajectory and map features, effectively weighting the contribution of each feature during the fusion process. This weighted combination produces a unified feature representation that captures both the agent’s historical motion and the surrounding environment, improving prediction accuracy.

Prediction accuracy was quantitatively assessed using Average Displacement Error (ADE) and Final Displacement Error (FDE), standard metrics for evaluating trajectory prediction. Results demonstrate state-of-the-art performance, with the incorporation of map information yielding a 4.91% reduction in ADE at a 2-second prediction horizon. This improvement was sustained and further increased at longer prediction horizons of 4 and 6 seconds, indicating the benefit of contextual map data for more accurate long-term trajectory forecasting. ADE = \frac{1}{N} \sum_{i=1}^{N} ||\hat{x}_i(t) - x_i(t)||_2 and FDE = ||\hat{x}_N(T) - x_N(T)||_2 are used to evaluate the performance, where N is the number of predicted trajectories, T is the prediction horizon, and x_i represents the ground truth trajectory.

Evaluations were conducted utilizing a diverse set of Large Language Models (LLMs) to assess the framework’s generalizability. Specifically, the system was tested with LLaMA2, LLaMA3, Qwen2.5, Mistral, Vicuna, and WizardLM. Consistent performance across these varied LLM architectures demonstrates the framework’s robustness and its ability to function effectively independent of the specific LLM implementation used for contextual reasoning and prediction generation. This adaptability is a key feature, enabling deployment with different LLM options based on computational resources and performance requirements.

The approach demonstrates consistent performance gains across six diverse large language model backbones, indicating strong generalizability.
The approach demonstrates consistent performance gains across six diverse large language model backbones, indicating strong generalizability.

Envisioning the Future: Expanding LLM-Driven Autonomy Beyond Prediction

The developed framework establishes a crucial stepping stone toward truly autonomous driving by moving beyond simple reactive control. It achieves this through the integration of large language models capable of not only predicting the actions of other agents – pedestrians, cyclists, and vehicles – but also of proactively planning a safe and efficient path. This capacity for intention prediction allows the system to anticipate potential hazards before they fully materialize, enabling more nuanced and human-like decision-making. By interpreting the likely goals of surrounding actors, the framework facilitates behavior planning that optimizes for both safety and traffic flow, potentially reducing accidents and improving overall transportation efficiency. This approach promises a future where autonomous vehicles seamlessly navigate complex real-world scenarios, exhibiting a level of foresight previously unattainable.

Ongoing research prioritizes a multi-sensor approach, aiming to fuse data from lidar and radar with existing camera-based inputs to create a more robust and nuanced understanding of the driving environment. This integration addresses limitations inherent in relying solely on visual data, particularly in adverse weather conditions or low-light scenarios where cameras struggle. By combining the precise depth mapping capabilities of lidar, the velocity measurements of radar, and the semantic richness of camera imagery, the system aims to achieve a more complete and reliable representation of surrounding objects and their behaviors. Such enhanced scene understanding is critical for improving the safety and reliability of autonomous vehicles, allowing for more accurate prediction of potential hazards and more informed decision-making in complex driving situations.

Successfully deploying this LLM-driven autonomy framework beyond controlled simulations necessitates rigorous adaptation to the unpredictable realities of diverse driving environments and traffic patterns. Current research focuses on developing techniques for the model to generalize effectively, moving beyond reliance on data exclusively collected under ideal conditions. This includes exploring methods for domain adaptation, allowing the framework to rapidly learn from limited data in novel environments – such as those with poor weather visibility, unconventional road layouts, or unique local driving customs. Furthermore, investigations are underway to refine the system’s ability to navigate varying traffic densities, from free-flowing highways to congested urban centers, and to respond appropriately to the unpredictable behavior of other road users, ultimately enhancing the robustness and safety of autonomous vehicles across a broad spectrum of real-world scenarios.

The current trajectory of large language model (LLM) integration into autonomous systems suggests a shift from reactive prediction to proactive reasoning. Rather than simply forecasting the actions of other agents, this approach empowers LLMs to engage in higher-level cognitive tasks – such as inferring intentions, evaluating risk, and formulating nuanced plans based on contextual understanding. This extends beyond pattern recognition; the LLM can synthesize information from diverse sources, apply commonsense knowledge, and even reason about hypothetical scenarios to make informed decisions. Consequently, autonomous vehicles and robotics platforms can move beyond pre-programmed responses and demonstrate truly adaptive behavior, navigating complex and unpredictable environments with greater safety and efficiency. This represents a fundamental step toward genuinely intelligent autonomous agents capable of independent thought and action.

The study demonstrates a fascinating parallel to how biological systems process information. Much like neural networks within the brain map spatial relationships, this research leverages Large Language Models to interpret HD map data and predict vehicle trajectories. As Andrew Ng aptly stated, “AI is the new electricity.” This framework isn’t simply about predicting where a vehicle will go; it’s about creating a system that ‘sees’ and understands the traffic scene, much like a cognitive map allows an organism to navigate its environment. The success of multi-modal fusion in improving prediction accuracy underscores the importance of integrating diverse data streams – a principle observed in natural intelligence where sensory inputs converge to create a coherent understanding of the world.

Beyond the Horizon

The demonstrated capacity of frozen Large Language Models to engage in spatio-temporal reasoning, when properly grounded in high-definition maps, suggests a shift in how autonomous systems ‘understand’ traffic scenes. However, this work also subtly illuminates the limitations inherent in applying these models. The persistent challenge isn’t simply prediction accuracy, but the interpretability of the reasoning itself. Every deviation from predicted trajectories, every outlier, represents an opportunity to uncover hidden dependencies within the driving environment – dependencies the models currently treat as noise, or simply fail to encode.

Future investigations should focus less on achieving incremental gains in precision, and more on dissecting the nature of model errors. What systematic biases are present? Where does the ‘world model’ diverge most significantly from observed reality? Furthermore, the current framework treats HD maps as a static source of information. A truly robust system will need to dynamically integrate map updates, account for construction zones, and even anticipate temporary, unmapped obstacles.

Ultimately, the value of this approach may lie not in replacing traditional trajectory prediction methods, but in providing a complementary reasoning engine. An engine capable of surfacing unexpected edge cases and prompting a deeper, more nuanced understanding of the complex, often chaotic, dance of autonomous vehicles within a shared space.


Original article: https://arxiv.org/pdf/2604.21479.pdf

Contact the author: https://www.linkedin.com/in/avetisyan/

See also:

2026-04-25 08:15