Memory-augmented large language model (LLM) driving agents can reuse past experience, yet previously learned corrections often fail to transfer when traffic conditions change. A key limitation is that existing memories mainly record observed outcomes, providing little evidence about alternative actions. We introduce XMind, a training-free framework that enables LLM-based driving to "Think Twice" through cross-memory reasoning. XMind integrates working memory of recent traffic states with episodic memory of critical risk events. The agent first makes an initial decision from the current context and then cross-checks it against retrieved historical experience. If a conflict arises, it makes a second decision guided by the retrieved evidence. To construct reliable episodic memory, XMind evaluates alternative actions through counterfactual rollouts under perturbed traffic conditions and stores the verified outcomes as structured risk capsules. These capsules are retrieved by jointly matching spatial risk patterns and scenario semantics. Across closed-loop highway simulations, XMind achieves success rates of 83.3-93.3%, exceeding the strong baseline by 6.6 percentage points on average. Evaluation on K-Risk further demonstrates lower decision risk on unseen real-world high-risk interactions. Ablation studies confirm the complementary benefits of working memory, risk-text retrieval, and counterfactual verification. Code is available at https://github.com/xiangxiangliuwo/XMind
Figures & tables
Fig. 1: From reflection-based correction to “Think Twice” reasoning. Top: LLM reflection suggests a correction without counterfactual verification of recoverability. Bottom: XMind tests candidate actions under traffic perturbations and continuation policies, stores the resulting evidence in episodic risk capsules, and triggers “Think Twice” cross-memory reasoning when retrieved evidence disagrees with the initial decision.
Fig. 2: Overview of XMind. Working memory provides recent traffic context and a spatial risk layout. Online decision-making uses risk-gated episodic retrieval to cross-check the initial decision, triggering “Think Twice” reasoning when the retrieved preferred action differs from the initial choice. Offline validation evaluates candidate actions at critical states through counterfactual rollouts, distinguishing recoverable, dangerous, and uncertain actions. The resulting evidence is stored as risk capsules in episodic memory for reuse across episodes. The LLM parameters remain frozen throughout the whole process.
4 lanes, density 2.5
5 lanes, density 2.5
5 lanes, density 3.0
Tokens/step
Method
SR ↑
SS ↑
vˉ↑
TTCmin↑
SR ↑
SS ↑
vˉ↑
TTCmin↑
SR ↑
SS ↑
vˉ↑
TTCmin↑
Input ↓
Output ↓
DiLu [ 1 ]
70.0
22.13
12.99
6.33
73.3
23.27
15.15
5.57
46.7
16.47
13.32
4.63
≈ 2000
≈ 60
KoMA ∗ [ 4 ]
73.3
23.00
13.84
5.44
66.7
22.63
15.83
4.66
60.0
20.37
14.89
4.43
≈ 5800
≈ 200
RESPOND [ 5 ]
86.7
26.37
12.29
6.44
83.3
26.46
12.94
6.18
76.7
24.63
10.61
5.70
≈ 1000
≈ 50
XMind (ours)
93.3
28.13
10.74
7.19
90.0
27.53
11.65
5.62
83.3
25.77
10.98
4.44
≈ 3100
≈ 180
TABLE I: Comparison of driving performance and token usage across highway scenarios with different lane counts and traffic densities. Bold and underlined values indicate the best and second best results, respectively. This convention applies to all subsequent tables.
Event type
highD [ 29 ]
NGSIM [ 30 ]
extreme [ 31 ] ∗
Hard braking
42
35
38
Left cut in
23
30
-
Right cut in
21
42
-
Total
86
107
38
TABLE II: Counts of selected events across the K-Risk subsets.
Dataset
Method
Safer
Similar
Riskier
highD ( n=319 )
NoMem
15.36
77.12
7.52
30Mem
16.61
77.43
5.96
NGSIM ( n=468 )
NoMem
32.05
54.70
13.25
30Mem
35.26
51.28
13.46
extreme ( n=138 )
NoMem
21.01
68.84
10.15
30Mem
21.01
66.67
12.32
TABLE III: Pairwise safety comparison against Human (%).
Window N
SR (%) ↑
SS ↑
1
73.3
23.53
3
80.0
25.27
5
80.0
25.67
TABLE IV: Working memory window.
Fig. 3: Risk reduction and memory-guided decision revision on K-Risk. The bar chart shows mean peak risk reduction relative to Human at paired critical frames (higher is better). The scenario contrasts the recorded Human left lane change with XMind’s right lane change. The decision trace shows an initial SLOWER action, retrieval of a verified capsule, and a revised LANE_RIGHT decision. Prompt and reasoning excerpts are illustrative.
Method
Working
Episodic
Retrieval method
Counterfactual
SR (%) ↑
SS ↑
memory
memory
Text
Risk
verification
Without memory
×
×
×
×
×
50.0
17.03
Working memory only
✓
×
×
×
×
66.7
21.40
Text retrieval
✓
✓
✓
×
✓
73.3
23.03
Risk retrieval
✓
✓
×
✓
✓
80.0
24.83
w/o counterfactual verification
✓
✓
✓
✓
×
78.9
24.54
TABLE V: Ablation study with five lanes and a traffic density of 3.0. Text and Risk denote the two retrieval methods.
VLMs have shown promise for autonomous driving, yet still suffer from hallucination, weak spatio-temporal perception, and limited generalization. Recent methods improve reasoning and decision-making through CoT explanations, retrieval-augmented generation or the static injection of tool outputs. Although these mechanisms enrich the context, the model neither proactively perceives scene information nor accumulates experience after answering. To overcome these limitations, we present, to our knowledge, the first synergistic framework that tightly couples hierarchical memory with proactive tool invocation in a closed reasoning loop. Our contributions are threefold. (i) Hierarchical Driving Memory: a scene-level short-term memory maintains the dynamic scene state, and an evolving long-term memory retrieves reusable experience and tool strategies. (ii) Memory-Tool Synergistic Reasoning Framework: guided by the scene state and retrieved experience, the model adaptively invokes tools to refine its reasoning at inference time and consolidates reusable experience into a long-term memory pool offline. (iii) Data Generation and Two-stage Training Pipeline: verified memory-tool trajectories built by multi-step teacher rollout are used to train with SFT and GRPO. Our 7B model reaches an overall reasoning score of 80.03 and MCQ accuracy of 79.09% on DriveLMM-o1, surpassing the strongest baseline by 7.74 MCQ points and generalizes strongly across benchmarks. Notably, ablation and analysis studies validate the effectiveness of each component and further reveal the complementary roles of hierarchical memory. Short-term memory strengthens spatio-temporal understanding, improving STSBench accuracy by 24.2 points, while offline long-term memory consolidation yields an additional 3.57-point MCQ gain with all parameters frozen, demonstrating continual self-evolution through accumulated driving experience.
Recent multimodal large language models (MLLMs) can perceive a traffic scene, reason about it, and propose a driving action within a single model. However, existing MLLM-based drivers reason from scratch at each frame and commit to a single explanation, discarding earlier hypotheses about the scene. When the scene is ambiguous, the agent locks in on the wrong interpretation and acts on it before evidence accumulates. In this paper, we propose DriveMind, an MLLM-based driving framework that keeps several hypotheses about the scene alive at the same time and updates their weights as new frames arrive. Inspired by particle filtering, DriveMind propagates each hypothesis through a VLM, scores it against the current observation, and resamples to maintain diversity. On Bench2Drive, adding belief tracking to the same driving pipeline improves the Driving Score (DS) from 68.50 to 81.37 and the Success Rate (SR) from 41.36% to 54.09%. The largest gains occur on ambiguous scenarios such as unsignalized intersections (+20.0 DS) and oncoming-traffic interactions (+20.5 DS). Beyond the overall metrics, DriveMind also improves fine-grained interactive driving abilities such as merging, emergency braking, and give-way.
Yan Shi, Kehua Chen, Jiarui Qi +3
University of Washington · McGill University · University of Michigan
Large language models (LLMs) are increasingly used as reasoning engines in autonomous driving, yet their decision-making remains opaque. We propose to study their decision process through counterfactual explanations, which identify the minimal semantic changes to a scene description required to alter a driving plan. We introduce DRIV-EX, a method that leverages gradient-based optimization on continuous embeddings to identify the input shifts required to flip the model's decision. Crucially, to avoid the incoherent text typical of unconstrained continuous optimization, DRIV-EX uses these optimized embeddings solely as a semantic guide: they are used to bias a controlled decoding process that re-generates the original scene description. This approach effectively steers the generation toward the counterfactual target while guaranteeing the linguistic fluency, domain validity, and proximity to the original input, essential for interpretability. Evaluated using the LC-LLM planner on a textual transcription of the highD dataset, DRIV-EX generates valid, fluent counterfactuals more reliably than existing baselines. It successfully exposes latent biases and provides concrete insights to improve the robustness of LLM-based driving agents. The code is available at "https://github.com/Amaia-CARDIEL/DRIV_EX" .
Amaia Cardiel, Eloi Zablocki, Elias Ramzi +1
Aptikal, Université Grenoble Alpes, Grenoble, France · Valeo.ai, Paris, France