Papers
Topics
Authors
Recent
Search
2000 character limit reached

DRIV-EX: Counterfactuals in Autonomous Driving

Updated 5 July 2026
  • DRIV-EX is a counterfactual explanation method that identifies the minimal semantic change in driving scene descriptions needed to flip LLM decisions.
  • It decouples continuous counterfactual search from controlled autoregressive decoding to maintain fluency and domain validity in generated trajectories.
  • It employs a proximity-preserving strategy using gradient-based optimization and candidate refinement to reveal latent model biases and ensure safe, interpretable outcomes.

Searching arXiv for the DRIV-EX paper and closely related autonomous-driving explainability work. DRIV-EX is a counterfactual-explanation method for LLM-based driving planners that identifies the smallest semantic change to a driving scene description required to alter a planner’s decision, typically by crossing a decision boundary between safe and dangerous maneuvers. It was introduced for autonomous-driving settings in which a LLM takes a structured textual scene description and generates a lane-change intention together with a trajectory. Rather than relying on free-form rationales, DRIV-EX searches for counterfactual scene edits that are close to the original input but sufficient to flip a key semantic decision token, and then reconstructs the result through controlled decoding so that the final explanation remains fluent, domain-valid, and near the source description (Cardiel et al., 28 Feb 2026).

1. Definition and problem formulation

DRIV-EX studies the interpretability of autonomous-driving LLMs through counterfactual explanations. In its primary setting, the target model is LC-LLM, a LoRA-finetuned planner trained on the textual highD dataset, where each sample is a rigid template describing the ego vehicle and surrounding traffic in terms of vehicle type, speeds, accelerations, positions, and the resulting maneuver and future trajectory (Cardiel et al., 28 Feb 2026).

The method is formulated around a safety-critical case: scenarios where the ground-truth scene is dangerous—defined as a collision within 4 seconds at constant velocity—but the model nevertheless predicts a safe maneuver. The objective is to find a modified input x\mathbf{x} that stays as close as possible to the original scene description xo\mathbf{x}^o while forcing a target decision yTy_T^* at a key semantic decoding step TT:

argminxVmc(xo,x) s.t.yT=argmaxzV  PM(zy<T,x).\begin{aligned} & \underset{\mathbf{x} \in V^m}{\arg\min} & & c(\mathbf{x}^o, \mathbf{x}) \ & \text{s.t.} & & y^*_T = \underset{z\in V}{\arg\max} \; P_{\mathcal{M}(z \mid \mathbf{y}_{<T}, \mathbf{x})}. \end{aligned}

In this formulation, c(xo,x)c(\mathbf{x}^o,\mathbf{x}) trades off proximity and fluency, M\mathcal{M} is the autoregressive driving model, and the decision is taken at a semantic step rather than a fixed token index. The paper argues that, in the rigid driving-template setting, changing the first critical decision token is usually sufficient to redirect the rest of the generation.

This positions DRIV-EX as a local interpretability method. It does not attempt to provide a global theory of model behavior; instead, it asks a sharply defined instance-level question: what minimally changed scene description would make the planner choose differently?

2. Continuous counterfactual search and controlled decoding

The central design choice in DRIV-EX is to decouple counterfactual search from counterfactual generation. The method uses gradient-based optimization in continuous embedding space to discover the semantic direction that changes the model’s decision, but it does not treat the resulting optimized embeddings as final explanations. Instead, those embeddings guide a controlled autoregressive decoding process that reconstructs a valid textual counterfactual (Cardiel et al., 28 Feb 2026).

The search begins with a sequence of soft embeddings

e=(e1,,em)Rm×d,\mathbf{e} = (\mathbf{e}_1, \dots, \mathbf{e}_m) \in \mathbb{R}^{m \times d},

initialized from the original scene description. At each iteration, each soft embedding is projected to the nearest vocabulary embedding by cosine similarity:

xi=ProjE(ei):=argmaxvEeiveiv.\mathbf{x}_i = \text{Proj}_E(\mathbf{e_i}) := \arg\max_{\mathbf{v} \in E} \frac{\mathbf{e}_i \cdot \mathbf{v}}{\|\mathbf{e}_i\|\|\mathbf{v}\|}.

The projected input is then evaluated by the driving LLM with a decision loss that increases the probability of the target token:

Ldec(x)=logPM(yTy<T,x).\mathcal{L}_{\text{dec}}(\mathbf{x}) = - \log P_{\mathcal{M}(y^*_T \mid \mathbf{y}_{<T}, \mathbf{x})}.

Because the projection step is non-differentiable, DRIV-EX uses a straight-through estimator and updates the underlying soft embeddings with Adam:

xo\mathbf{x}^o0

This repeated project-forward, backward, and update cycle searches for an embedding configuration that makes the target decision likely. The distinctive contribution lies in what happens next. Rather than outputting the projected optimized tokens directly, DRIV-EX instantiates a fluency model xo\mathbf{x}^o1 as the base model of xo\mathbf{x}^o2 without the instruction-tuned adapter, thereby preserving tokenizer and embedding-space compatibility. For each position xo\mathbf{x}^o3, it computes a vocabulary-distance penalty

xo\mathbf{x}^o4

rescales it with

xo\mathbf{x}^o5

and forms a decoding bias

xo\mathbf{x}^o6

Greedy decoding then selects

xo\mathbf{x}^o7

The paper’s claim is that this controlled decoding preserves fluency because the base-model logits remain active, while the bias steers generation toward the optimized semantic direction. This suggests that DRIV-EX treats continuous optimization as a semantic probe rather than as a direct text generator.

3. Proximity preservation, candidate selection, and task constraints

DRIV-EX explicitly constrains counterfactuals to remain close to the original scene description. It does so through three complementary mechanisms (Cardiel et al., 28 Feb 2026).

The first mechanism, Proj, restricts projection candidates to the top-xo\mathbf{x}^o8 nearest neighbors of the original tokens in cosine similarity. The second, Loss, adds a semantic similarity penalty to the optimization objective:

xo\mathbf{x}^o9

weighted by yTy_T^*0. The third, Bias, adds a second decoding bias term yTy_T^*1 computed relative to the original input yTy_T^*2, yielding

yTy_T^*3

These mechanisms are intended to preserve semantic fidelity while still allowing decision-flipping edits. The method applies counterfactual search only to variable template fields such as vehicle type, speeds, positions, and accelerations, rather than to arbitrary parts of the prompt. This restriction keeps the search space aligned with semantically meaningful driving-scene attributes.

After yTy_T^*4 iterations, DRIV-EX keeps a pool of candidates. If any candidate flips the decision, it returns the one with the highest semantic proximity to the original input; otherwise, it returns the candidate with the highest target-token probability. The paper also describes an optional refinement step in which modified token groups are reverted one by one to test whether the counterfactual still succeeds. In the reported Llama3 results, refinement slightly improves performance.

This architecture reflects a specific interpretability criterion: a useful driving counterfactual should not merely be adversarially effective, but also structurally valid and semantically local. In the paper’s terms, counterfactual quality is inseparable from linguistic fluency, domain validity, and proximity to the original input.

4. Evaluation protocol, baselines, and quantitative results

The evaluation compares DRIV-EX against DAB and PEZ, together with proximity-regularized variants marked with yTy_T^*5. The reported metrics are tightly matched to the counterfactual task: Decision (P@1), Template fitness, Minimum fluency, BERTScore, Aggregated success rate, and Aggregated collision rate. The Aggregated success rate requires all of the following simultaneously: the decision must flip, the output must remain template-valid, and the BERTScore must be at least 0.95 (Cardiel et al., 28 Feb 2026).

On the main safety-critical highD subsets, DRIV-EX is reported as the strongest method under this strict aggregated criterion. For Llama3, the paper reports: Decision 64.0%, min fluency yTy_T^*6, temp fitness 99.5%, BERTScore 98.3%, Aggregated 61.3%, and collision subset 56.0%. For the same model family, PEZ reaches Aggregated 45.3%. For Mistral, DRIV-EX reaches Decision 83.7%, Aggregated 69.4%, and collision subset 61.2%. For Qwen2.5, it reaches Decision 58.9%, Aggregated 34.4%, and collision subset 22.2%.

The paper emphasizes a consistent tradeoff pattern. DAB can flip decisions aggressively but often degrades semantic closeness. PEZ tends to remain nearer to the original prompt but struggles with fluency and structural validity. DRIV-EX is reported to balance these criteria more effectively because its fluency model steers search outputs back into valid text.

The ablation on proximity regularization further supports that interpretation. On Llama3, the paper reports: base method: Aggregated 52.0%, collision 48.0%; + Bias: 54.7%; + Proj: 50.7%; + Loss: 58.7%; and + Bias + Proj + Loss: 61.3%, collision 56.0%. The stated conclusion is that the three regularizers are synergistic rather than redundant.

5. Qualitative findings, exposed biases, and robustness implications

The qualitative analysis presents DRIV-EX as a tool for isolating minimal, semantically meaningful changes that alter the planner’s output. Reported examples include slightly adjusting vehicle speed, changing the ego vehicle type from car to truck, modifying lateral velocity yTy_T^*7, and changing a nearby vehicle’s speed by only a few km/h. One example shows that decreasing a surrounding vehicle’s speed and adjusting the ego vehicle’s longitudinal speed is sufficient to turn a safe plan into a collision-inducing one (Cardiel et al., 28 Feb 2026).

The paper argues that such counterfactuals expose latent biases in the driving LLM. Two categories are highlighted. First, injected shortcut biases can be recovered: in one experiment, the model learns to associate ego vehicle type with decision; in another, it relies on the last digit of nearby vehicles’ speeds. DRIV-EX identifies these shortcut features. Second, the method reveals real dataset bias: for Llama3 on textual highD, high negative lateral velocity yTy_T^*8 is found to strongly push the model toward a right-lane-change decision even when that decision causes a collision.

These findings are used to motivate debiasing experiments. The paper reports that removing lateral kinematic features, or removing all kinematic features from the text template, reduces collisions. The reported pattern is: Baseline has good F1 but more collisions; No yTy_T^*9 yields similar classification performance with fewer collisions; No TT0 yields fewer collisions still, but with more trajectory error. A plausible implication is that DRIV-EX can function as a diagnostic instrument for feature-level safety auditing, especially when an LLM planner over-relies on shortcut correlations that are predictive in-distribution but unsafe under counterfactual perturbation.

The method’s explanatory force therefore lies less in post-hoc narration than in boundary tracing. By identifying which semantic edits are sufficient to change a decision, it reveals which parts of the input the planner is actually using.

6. Scope, limitations, and nomenclatural disambiguation

DRIV-EX is explicitly limited to textual inputs, white-box access, and fixed input length; it does not insert or delete tokens. Its evaluation is confined to the textual highD dataset and its rigid template format, and the method is computationally expensive because it combines gradient optimization with autoregressive decoding. It is also described as a local interpretability method rather than a source of global explanations. The paper further notes a dual-use risk: the same mechanism that helps audit safety can also generate adversarial corner cases (Cardiel et al., 28 Feb 2026).

Within the autonomous-driving literature, the name is easily confused with several adjacent systems. DriveX is a self-supervised world model for generalizable scene knowledge and Omni Scene Modeling, not a counterfactual explanation method (Shi et al., 25 May 2025). DRIVE has also been used for Dynamic Rule Inference and Verified Evaluation, a framework for learning soft driving constraints and embedding them into convex planning (Geng et al., 6 Aug 2025), and for Dependable Robust Interpretable Visionary Ensemble, a robustness framework for concept-based explanation in the DCG model (Lai et al., 2024). In a separate just-in-time explanation setting, DriCon characterizes unexpected driving events on a dashboard-mounted edge device using a Self-Organizing Map, maneuver features, and spatial micro-events (Das et al., 2023). These systems share a concern with interpretability or generalizable driving knowledge, but they address different objects: world modeling, rule inference, dependable concept explanations, edge explanation of unexpected events, and counterfactual explanation for driving LLMs.

In that taxonomy, DRIV-EX occupies a specific niche. It is a counterfactual method for textual autonomous-driving planners that combines continuous embedding-space search with controlled decoding to produce fluent, template-valid, semantically local decision-flipping scene edits. Its reported value lies in revealing model sensitivities, uncovering latent shortcut biases, and suggesting targeted changes to input representation for safer LLM-based driving systems.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to DRIV-EX.