Introduction
Imagine you are driving down a busy highway. You see a car merging from the right, a truck braking in front of you, and a pedestrian waiting on a corner. Instantly, your brain maps these objects in 3D space, assigns them importance, and formulates a plan: “Slow down for the truck, watch the merging car.” You don’t think in raw GPS coordinates or pixel values. You think in terms of objects and relationships.
This is the holy grail for Autonomous Driving (AD) systems. Recently, Multi-modal Large Language Models (MLLMs) have shown promise in this field. These models can look at an image and answer questions like, “What should the ego vehicle do?” However, there is a significant linguistic barrier. While LLMs are fluent in English, they are surprisingly bad at speaking “coordinates.”
When a standard model tries to describe where an object is, it typically outputs text-based coordinates (e.g., <1018.5, 510.8>). This creates a “semantic gap.” The model is forcing a visual concept into a complex numerical text format, often leading to hallucinations or inaccuracies. The car might see the object but fail to describe its location correctly, leading to dangerous planning errors.
In this deep dive, we explore a new framework called MPDrive, presented by researchers from the South China University of Technology and Baidu Inc. MPDrive proposes a clever workaround: instead of forcing the LLM to predict complex coordinates, why not just label the image with visual markers (numbers) and let the LLM predict the number? It sounds simple, but the implementation involves sophisticated architectural choices that bridge the gap between visual perception and linguistic reasoning.
The Problem: The Language of Space
To understand why MPDrive is necessary, we first need to look at how current MLLMs handle autonomous driving tasks. These tasks correspond to AD-VQA (Autonomous Driving Visual Question Answering). The system is given images from the car’s cameras and asked questions related to perception (“Where is the pedestrian?”), prediction (“Will that car turn left?”), and planning (“Should I brake?”).
The traditional approach relies on textual regression. The model sees an image and tries to output a string of text representing the bounding box or center point of an object.

As illustrated in Figure 1, the mainstream approach (red box) attempts to output raw coordinates. This is computationally difficult for a language model because numbers are just tokens to an LLM; they lack inherent spatial meaning. If the model gets the number slightly wrong, it might reference an empty patch of road instead of the car.
The MPDrive approach (green box) fundamentally changes the output space. Instead of outputting coordinates, the system pre-processes the image to detect objects and overlays a visual “marker” (a numbered tag) on top of them. Now, the task for the LLM changes from “predict a coordinate” to “read the number on the car.” This ensures linguistic expressive consistency. If the model says “Object 1,” it definitively refers to the object labeled “1,” bridging the semantic gap.
The Solution: MPDrive Architecture
The core philosophy of MPDrive is Marker-Based Prompt Learning. The framework delegates the heavy lifting of precise localization to a specialized detection model (a “Detection Expert”) and lets the LLM focus on reasoning.
The architecture is composed of two primary innovations designed to handle these markers without losing the visual fidelity of the scene:
- Marker ControlNet (MCNet)
- Perception-Enhanced Spatial Prompt Learning (PSPL)
Let’s break down the full pipeline as shown in the system overview below.

As shown in Figure 2, the process begins with a Detection Expert (specifically, a model called StreamPETR). This expert identifies traffic elements (cars, trucks, pedestrians) and generates a Visual Marker Image (\(I_m\)). This image is essentially the original view but with semi-transparent masks and numerical indices overlaid on the detected objects.
The system then needs to digest both the raw image (\(I\)) and this new marker image (\(I_m\)). This brings us to the first major component.
1. Marker ControlNet (MCNet)
You might wonder: “Why not just feed the marker image directly into the LLM?” The problem is occlusion. Overlaying a big number “1” and a colored mask over a car might obscure critical details, like whether the car’s brake lights are on or if a turn signal is flashing. The model needs the spatial clarity of the markers and the visual fidelity of the original image.
To solve this, the researchers introduce MCNet. This module uses a dual-encoder structure inspired by ControlNet.
- The Frozen Encoder (\(E\)): The top path processes the original, clean image (\(I\)). The parameters of this encoder (\(\theta\)) are frozen, meaning they are not updated during training. This preserves the pre-trained visual knowledge of the foundation model.
- The Control Block (\(E_c\)): The bottom path processes the marker image (\(I_m\)). This encoder (\(\theta_c\)) is a trainable copy of the original encoder. It learns specifically how to interpret the markers.
- Zero Linear Layer (\(Z\)): This is a crucial trick. The output of the control block passes through a linear layer initialized with weights and biases of zero.
The fusion of these features happens via element-wise addition, described by the following equation:

Here, \(y_s\) represents the final scene-level features. Because the layer \(Z\) is initialized to zero, at the very start of training, the model behaves exactly like the original frozen model (the marker input has zero effect). As training progresses, the model slowly learns to incorporate the spatial information from the markers via backpropagation. This ensures that the visual markers guide the model without destroying the original semantic features.
2. Perception-Enhanced Spatial Prompt Learning (PSPL)
Having extracted scene-level features (\(y_s\)), MPDrive now needs to help the LLM understand specific objects. A global view of the road is good, but if the question is “Is the car on the left turning?”, the model needs focused information on that specific instance.
PSPL generates two types of prompts to feed into the LLM:
- Scene-Level Prompts: Derived directly from the MCNet output, capturing the whole environment.
- Instance-Level Prompts: Derived by focusing on specific objects.
To create the instance-level prompts, the model utilizes the masks provided by the detection expert. It performs Mask Average Pooling (MAP) on the scene features. Essentially, it takes the feature map of the whole image and “cuts out” the features corresponding to specific objects (like Object \(k\)).

In this equation, \(r_k\) is the region mask for the \(k\)-th object. The result, \(y_i^k\), is a concentrated feature vector representing just that specific car or pedestrian.
These features (scene and instance) are processed through a Multi-Layer Perceptron (MLP) to become visual tokens (\(T_s\) and \(T_i\)) that the LLM can understand.
The LLM Reasoning Phase
Finally, the LLM receives:
- The text tokens from the user’s question (e.g., “What is object 1 doing?”).
- The scene-level visual prompts (\(T_s\)).
- The instance-level visual prompts (\(T_i\)).
The LLM processes these inputs to generate an answer. Crucially, if the answer requires identifying a location, the LLM predicts the marker index (\(k\)). The system then looks up the coordinates of marker \(k\) from the detection expert and provides that as the final spatial output. This relieves the LLM of the burden of regression, treating spatial reasoning as a classification and language task.
Experiments and Results
The researchers evaluated MPDrive on two challenging datasets:
- DriveLM: A dataset focusing on multi-view images requiring reasoning about perception, prediction, and planning.
- CODA-LM: A dataset focused on “corner cases”—rare and dangerous driving scenarios that are notoriously difficult for AI.
Quantitative Analysis
The results show that MPDrive significantly outperforms existing state-of-the-art methods.

Looking at Table 1, we can see the comparison against models like EM-VLM4AD, MiniDrive, and InternVL-2.
- Spatial Perception (Match): MPDrive achieves a score of 13.43, nearly double that of InternVL-2 (7.59). This metric measures how accurately the model locates objects. The visual markers are clearly doing their job.
- Language Metrics (CIDEr, METEOR): The model also scores highest on language quality metrics. This suggests that by offloading the coordinate difficulties to the visual markers, the LLM has more capacity to generate coherent, accurate text descriptions.
Qualitative Analysis: Seeing the Difference
Numbers are great, but how does this look in practice? The blog post includes visual comparisons to demonstrate the difference in reasoning capabilities.

In Figure 3, we see a side-by-side comparison.
- Top Example: The task is to identify important objects. The Ground Truth (GT) prioritizes specific objects based on their movement. InternVL-2 (Red) gets confused, identifying the wrong priority and halluncinating coordinates. MPDrive (Green) matches the Ground Truth almost perfectly, correctly identifying the relevant markers.
- Bottom Example: The question asks about a potential collision with a pedestrian. InternVL-2 incorrectly assesses the risk, stating there is no collision course. MPDrive correctly identifies the pedestrian’s marker, analyzes the spatial relationship, and correctly predicts the need to account for the pedestrian (“Moderate right turn”).
What is the Model Looking At?
To verify that the model is actually paying attention to the right things, the researchers visualized the attention maps (visual prompts).

In Figure 4, the heatmaps show where the model is focusing.
- InternVL-2 (Middle Row): The attention is scattered. In the left image, it misses the truck entirely. In the right image, it spreads attention over irrelevant road areas.
- MPDrive (Bottom Row): The attention is sharp and focused. It highlights the specific vehicles relevant to the driving task. This confirms that the instance-level prompts (\(T_i\)) effectively guide the LLM’s attention to the specific regions defined by the markers.
Ablation Studies: Do We Need All the Parts?
The researchers performed ablation studies to prove that every part of the architecture matters.

Table 3 reveals the contribution of each component:
- Visual Marker Only: Adding markers alone improves spatial matching (7.59 \(\to\) 11.89) but slightly hurts language accuracy (82.54 \(\to\) 80.42). This confirms the hypothesis that markers can obscure image features if not handled carefully.
- Adding MCNet: When MCNet is added, language metrics improve significantly (BLEU-4 and METEOR go up). This proves that the dual-encoder strategy successfully restores the visual features lost by the markers.
- Adding Instance-Prompts: The full model (bottom row) achieves the best scores across the board. The instance-level features provide the fine-grained detail needed for high accuracy.
Conclusion and Implications
The MPDrive paper presents a compelling argument: Don’t force Large Language Models to do tasks they aren’t designed for. LLMs are probabilistic text generators, not coordinate regressors.
By translating the continuous problem of spatial coordinates into the discrete, text-based problem of reading visual markers, MPDrive bridges the semantic gap in Autonomous Driving VQA.
- MCNet ensures that these markers don’t degrade the visual quality of the scene.
- PSPL ensures that the model attends to both the global context and specific object details.
The implications for this are significant. As we move toward end-to-end autonomous driving systems where an AI “brain” makes driving decisions, the ability to accurately perceive and describe spatial relationships is non-negotiable. MPDrive shows that sometimes the best way to improve an AI’s performance isn’t just a bigger model, but a smarter way of representing the data it sees.
For students and researchers in the field, this paper serves as an excellent case study in prompt engineering and multi-modal fusion. It demonstrates that visual prompts can be just as powerful as text prompts when architected correctly.
This blog post explains the research paper “MPDrive: Improving Spatial Understanding with Marker-Based Prompt Learning for Autonomous Driving” by Zhang et al.
](https://deep-paper.org/en/paper/2504.00379/images/cover.png)