Source-linked AI summary
RAG-Driver: Generalisable Driving Explanations with Retrieval-Augmented In-Context Learning in Multi-Modal Large Language Model
Jianhao Yuan, Shuyang Sun, Daniel Omeiza, Bo Zhao, Paul Newman, Lars Kunze, Matthew Gadd
TL;DR
Driving systems need to explain their decisions, yet data scarcity and dataset domain gaps challenge generalisable MLLM driving agents. RAG-Driver retrieves expert demonstrations as in-context examples for multimodal driving prediction. It is reported to outperform existing methods both in-domain and in unseen environments without fine-tuning.
Problem
Data scarcity, domain gaps, expensive training, and catastrophic forgetting challenge the development and post-deployment generalisation of explainable MLLM driving systems.
Source: §I · p. 2Method
RAG-Driver combines an MLLM with retrieval from a memory of driving examples to provide in-context demonstrations for explanations, justifications, and control prediction.
Source: §III · p. 3, C. Retrival-Augmented In-context… · p. 5Results
RAG-Driver is reported to outperform existing methods in-domain and in unseen environments without fine-tuning.
Source: §I · p. 2Takeaways & Limitations
The system provides control signals alongside driving explanations and justifications, with zero-shot generalisation to unseen environments without additional training.
Source: §VI · p. 10The authors describe the work as an early exploration with limitations still to address before realizing the technology’s application.
Source: §V · p. 9
Abstract
from arXiv · showhide
We need to trust robots that use often opaque AI methods. They need to explain themselves to us, and we need to trust their explanation. In this regard, explainability plays a critical role in trustworthy autonomous decision-making to foster transparency and acceptance among end users, especially in complex autonomous driving. Recent advancements in Multi-Modal Large Language models (MLLMs) have shown promising potential in enhancing the explainability as a driving agent by producing control predictions along with natural language explanations. However, severe data scarcity due to expensive annotation costs and significant domain gaps between different datasets makes the development of a robust and generalisable system an extremely challenging task. Moreover, the prohibitively expensive training requirements of MLLM and the unsolved problem of catastrophic forgetting further limit their generalisability post-deployment. To address these challenges, we present RAG-Driver, a novel retrieval-augmented multi-modal large language model that leverages in-context learning for high-performance, explainable, and generalisable autonomous driving. By grounding in retrieved expert demonstration, we empirically validate that RAG-Driver achieves state-of-the-art performance in producing driving action explanations, justifications, and control signal prediction. More importantly, it exhibits exceptional zero-shot generalisation capabilities to unseen environments without further training endeavours.
I. INTRODUCTION
The introduction frames explainability and generalisation as central challenges for end-to-end autonomous driving. RAG-Driver uses retrieval-augmented in-context learning to produce driving explanations and control predictions, with reported gains in unseen environments without fine-tuning.
I. INTRODUCTION
- End-to-end driving can map raw sensor inputs directly to controls, but its black-box nature creates a transparency challenge.The introduction identifies explainability as important for reconciling system decisions with user expectations and fostering trust and acceptance.Source: §I · pp. 1–2, A. Explainable End-to-End Autonomous… · p. 2
A. Explainable End-to-End Autonomous Driving
- Attention visualisation and auxiliary perception tasks offer explanations, while natural-language MLLM explanations aim to make driving decisions more comprehensible to end users.The introduction characterizes attention and intermediate-task approaches as one-directional or not readily comprehensible to general users.Source: §I · p. 2
I. INTRODUCTION
- Data scarcity, dataset domain gaps, costly training, and catastrophic forgetting constrain MLLM driving systems’ generalisation to unseen environments.The authors describe retraining or fine-tuning after deployment as impractical because of computational demands and performance degradation.Source: §I · p. 2
- RAG-Driver combines retrieval-augmented in-context learning with an MLLM to generate driving actions, justifications, and control signals, and is reported to outperform existing methods in-domain and in unseen environments without fine-tuning.Its retrieved demonstrations provide similar driving scenarios as context for prediction.Source: §I · p. 2
A. Explainable End-to-End Autonomous Driving
- Prior driving MLLMs show promise, but annotation costs and dataset domain gaps remain obstacles to robust generalisation; RAG-Driver uses retrieval-augmented in-context learning to address them.The introduction also identifies state-of-the-art introspective explanation results on BDD-X and zero-shot generalisation on the Spoken-SAX dataset as contributions.Source: A. Explainable End-to-End Autonomous… · pp. 2–3, §I · p. 2
B. Multi-Modal Large Language Model
The paper situates RAG-Driver among multimodal language models and inference-time retrieval methods. Its architecture combines a video encoder, a projector, and an LLM to process current driving inputs alongside retrieved examples.
B. Multi-Modal Large Language Model
- MLLM driving agents build on multimodal perception and language generation, while high training costs and catastrophic forgetting complicate their generalisation after deployment.The cited driving approaches include DriveGPT4, Dolphins, DrivingMLM, and Reason2Drive.Source: B. Multi-Modal Large Language Model · p. 3
C. In-Context Learning and Retrieval-Augmented Generation
- In-context learning supplies demonstrations alongside a query without updating model parameters; retrieval-augmented generation dynamically selects relevant examples from an external database.RAG-Driver applies these inference paradigms to multimodal driving with a curated instruction-tuning dataset and vector-similarity retrieval.Source: C. In-Context Learning and… · p. 3
III. METHOD
- RAG-Driver pairs an MLLM perception-and-planning unit with a hybrid vector-and-text memory, using retrieval for multimodal in-context learning across explanations, justifications, and control prediction.The retrieval engine connects the memory unit to the MLLM during decision-making.Source: §III · p. 3
A. Multi-modal Large Language Model Architecture
- A frozen LanguageBind video encoder converts video into embeddings, and a two-layer MLP projector aligns them with language-token embeddings for the LLM.The video encoder uses a ViT-B/32 backbone and is pretrained with video-language contrastive learning; the caption describes temporal patches and CLIP4clip alignment.Source: A. Multi-modal Large Language Model… · pp. 3–4, Figure 3 · p. 4
- Vicuna 1.5 7B conditions on aligned video and textual context to autoregressively generate action explanations and numerical control signals.The decoder samples each output token based on previous outputs and the multimodal context.Source: A. Multi-modal Large Language Model… · pp. 4–5
B. Training Strategy
Training proceeds in two stages: projector pretraining aligns video and language features, then instruction tuning trains the model on structured driving demonstrations for its three prediction tasks.
B. Training Strategy
- Both stages use next-token prediction cross-entropy to maximize the conditional likelihood of the answer tokens.The paper describes this as the same loss in both stages.Source: B. Training Strategy · p. 5
- The first stage trains only the cross-modality projector on 3 million VIDAL-10M video-caption pairs while freezing the visual encoder and LLM.The stated aim is to project pretrained video embeddings into language tokens understandable by the LLM.Source: B. Training Strategy · p. 5
- The second stage instruction-tunes the model on 16K BDD-X video question-answer pairs containing two retrieved driving demonstrations per query.The demonstrations support action explanation, action justification, and control-signal prediction; numeric values are represented as language tokens.Source: B. Training Strategy · p. 5
C. Retrival-Augmented In-context Learning
RAG-Driver retrieves driving examples using hybrid video-and-control representations, then prefixes them to the current query. The authors interpret this context as implicitly adapting predictions without backpropagation.
C. Retrival-Augmented In-context Learning
- The memory associates video embeddings and 28-dimensional sensor control signals with expert explanations and justifications from training samples.The video embeddings use the same encoder as the MLLM architecture.Source: C. Retrival-Augmented In-context… · p. 5
- The retrieval strategy projects video and control embeddings into a shared hybrid space, using text similarity to form metric-learning pairs and cosine similarity to rank database examples.The authors report that visual-only retrieval can be suboptimal because it may favor perceptually similar examples instead of demonstrations of reasoning.Source: C. Retrival-Augmented In-context… · p. 5
- The system selects the two most relevant driving samples and prefixes their reasoning demonstrations before the current query.Each demonstration runs from contextual driving information through question-answer pairs; the query sample includes system information, the current query, and retrieved examples.Source: C. Retrival-Augmented In-context… · p. 5, Figure 4 · p. 6
- The authors interpret retrieved-context attention as an implicit meta-optimal adjustment toward the examples, analogous to gradient descent but performed without backpropagation.Their derivation separates query-dependent zero-shot terms from terms dependent on the in-context examples.Source: C. Retrival-Augmented In-context… · pp. 5–6
- RA-ICL is reported to improve explainable-driving prediction performance and generalisation without further training effort.The authors characterize it as an efficient inference method for MLLMs.Source: C. Retrival-Augmented In-context… · p. 6
A. Settings and Datasets
The evaluation uses BDD-X for in-distribution training and testing, then tests zero-shot transfer to Spoken-SAX using BDD-X training data as the retrieval memory. It evaluates driving explanations, justifications, and control-signal prediction.
A. Settings and Datasets
- BDD-X provides 77 hours of US driving videos across road and weather conditions, formatted into 16,803 training and 2,123 testing question-answer pairs.The experiments use the BDD-X training split for MLLM training and as the in-distribution memory database.Source: A. Settings and Datasets · p. 6
- Zero-shot transfer is tested on 58 Spoken-SAX question-answer pairs recorded in London, with the BDD-X training split as the retrieval memory.The same foundational model is used for transfer evaluation without fine-tuning on Spoken-SAX.Source: A. Settings and Datasets · p. 6
- Driving explanation and justification are measured with BLEU-4, METEOR, and CIDEr, while control prediction uses steering and speed RMSE and tolerance accuracy.The tolerance accuracy Aσ measures predictions within a threshold σ of ground truth.Source: A. Settings and Datasets · p. 7
- Videos are sampled to eight 224 × 224 frames, and inference takes roughly four seconds per round on one A100 GPU.The MLLM is fine-tuned from Video-LLaVA; the retrieval engine is trained on BDD-X using one A100 GPU.Source: A. Settings and Datasets · p. 7
B. Explainability in Driving Action and Justification
RAG-Driver improves driving explanations and justifications over DriveGPT4 and outperforms baselines on open-loop control prediction. Ablations examine retrieval similarity, when to provide demonstrations, and how many examples to use.
B. Explainability in Driving Action and Justification
- RAG-Driver’s explanation results support the effectiveness of ICL in enhancing MLLMs’ emergent reasoning capabilities.The paper reports comparable performance to specialist ADAPT and improved explainability over DriveGPT4.Source: B. Explainability in Driving Action… · p. 7
C. Control Signal Prediction
- RAG-Driver surpasses other methods in open-loop steering and speed prediction across tolerance ranges and RMSE.The comparison includes DriveGPT4, which uses the same visual input and past control signals for autoregressive prediction.Source: C. Control Signal Prediction · p. 7, Table II · p. 8
D. Ablation Study on Retrieval Strategy
- Hybrid video-and-control embeddings outperform visual-only retrieval, which can favor perceptual similarity over demonstrations of the reasoning process.Fine-tuning the embeddings allows heterogeneous multimodal sensor input to inform retrieval.Source: D. Ablation Study on Retrieval Strategy · p. 7
- Without prior training, the MLLM produces random strings and non-floating-point numbers with ICL examples, preventing meaningful metric calculation.The authors hypothesize that supervised fine-tuning is important for ICL capability, consistent with observations in [18].Source: D. Ablation Study on Retrieval Strategy · p. 7, Table III · p. 8
- Increasing hybrid-retrieved ICL examples from one to two improves explanation and justification while slightly reducing course control accuracy.The architecture constrains the choice to at most two examples.Source: D. Ablation Study on Retrieval Strategy · p. 7, Table IV · p. 8
B. Explainability in Driving Action and Justification
- 10.8% average improvement across explainability metrics over DriveGPT4, despite using only BDD-X rather than its additional LLaVA-150K data.The comparison concerns driving action explanations and justifications on the BDD-X test set.Source: B. Explainability in Driving Action… · p. 7, Table I · p. 8
E. Generalisation Capacity
On unseen Spoken-SAX data, RAG-Driver’s retrieval-augmented ICL examples provide a substantial performance boost without fine-tuning. Further training the retrieval engine with target-domain data improves out-of-distribution explanation and justification performance.
E. Generalisation Capacity
- On zero-shot Spoken-SAX evaluation, RAG-Driver gains a large performance margin while ADAPT and the base MLLM degrade sharply relative to in-distribution evaluation.The retrieval memory remains built from BDD-X, and the authors suggest hybrid retrieval can select effective examples with less distribution shift.Source: E. Generalisation Capacity · p. 8
F. Fine-tuning Retrieval Engine
- Qualitative examples from BDD-X and Spoken-SAX show that the generated driving action explanations and justifications are comprehensible to humans despite wording differences.The figure compares human annotations with predictions and shows four downsampled frames per video.Source: Figure 5 · p. 9
- Training the retrieval engine with Spoken-SAX target-domain samples further boosts out-of-distribution explanation and justification performance.In-distribution gains are less pronounced for justification, while action explanation improves considerably; the table concerns retrieval-engine training with target-domain samples.Source: F. Fine-tuning Retrieval Engine · pp. 8–9, Table V · p. 9
G. Qualitative Demonstration
RAG-Driver’s explanations remain human-understandable in qualitative examples from night, adversarial-weather, and unseen Spoken-SAX environments. The authors also identify model scale and context length as constraints on the current approach.
G. Qualitative Demonstration
- Qualitative examples show robust, intelligible action explanations and justifications across night and adversarial-weather conditions, with control signals close to the human record.In unseen Spoken-SAX environments, predictions are also described as human-understandable, qualitatively supporting zero-shot generalisation.Source: G. Qualitative Demonstration · p. 9
V. LIMITATIONS AND FUTURE WORK
- The authors frame the work as an early exploration and identify limitations that remain to be addressed before realizing the technology’s application.The current MLLM has 7 billion parameters, a modest scale relative to GPT-4V and Gemini; the authors expect performance improvements with scaling.Source: §V · p. 9, A. Computational Restriction and Scale… · p. 10
A. Computational Restriction and Scale of MLLM
- Inference uses two in-context examples per query because Vicuna 1.5 has a 4096-token context window, with each additional example adding roughly 1800 tokens.The authors describe context length as a fundamental architectural bottleneck for adopting more examples.Source: A. Computational Restriction and Scale… · p. 10
B. Data Scarcity
RAG-Driver addresses driving-language data scarcity and reports zero-shot generalisation without additional training, while the authors note unresolved hallucination and simulation-to-real evaluation challenges.
B. Data Scarcity
- Driving-specific video-caption datasets remain much smaller than generic datasets, while explanation-pair datasets such as BDD-X are not yet suitable for pretraining in scale and language format.The authors note emerging larger, well-annotated driving datasets as promising future potential.Source: B. Data Scarcity · p. 10
C. Hallucination
- Retrieval grounding mitigates hallucinations, but an isolated failure links slowing to a nonexistent stop sign; the authors hypothesise limited model capacity and spurious correlations as contributors.They suggest more powerful backbones, balanced data, and real-time verification or rectification as future directions.Source: C. Hallucination · p. 10
D. Closed-loop Evaluation
- A larger simulation-to-real gap remains a significant challenge for closed-loop testing of RAG-Driver, which is trained on real datasets.The authors say adaptation to simulation is non-trivial and identify simulator evaluation as an important step before deployment.Source: D. Closed-loop Evaluation · p. 10
VI. CONCLUSION
- RAG-Driver shows zero-shot generalisation to unseen environments without additional training and provides control signals, action explanations, and justifications.The conclusion describes strong capability across these outputs.Source: §VI · p. 10
APPENDIX
The appendix gives training settings, describes the comparison baselines, and derives how in-context samples affect a linear layer through an attention-like update.
A. Training Details
- Training uses MLP projectors and separate optimization settings for the projector and MLLM backbone.The projector fuses 1 × 1024 video and 1 × 28 control embeddings; the lightweight projector has input dimension 1052 and output dimension 1024, and the MLLM is trained for 2 epochs.Source: A. Training Details · p. 14
B. Baseline Details
- The baselines are S2VT, WAA, ADAPT [35], and DriveGPT4 [81], spanning video captioning, attention-based explanations, joint training, and multimodal instruction tuning.The descriptions distinguish their training and output approaches, including ADAPT’s alignment of action captioning with control prediction.Source: B. Baseline Details · p. 14
C. Linear Layer Parameter Update Derivations
- The derivation interprets attention output as a meta-optimal adjustment to fit retrieved context samples, without supervision.It relates a weighted sum of dot products to an attention mechanism and separates the in-context update from a query-dependent term.Source: C. Linear Layer Parameter Update… · p. 14
D. Action Representation
The paper uses floating-point action representations, while identifying their prediction as a limitation and pointing to alternative representations for future work.
D. Action Representation
- Floating-point action representation was chosen for reported effectiveness in robotics and driving and its intuitive alignment with human understanding.The cited examples include RT-2 [9], RT-X [58], and DriveGPT4 [81].Source: D. Action Representation · p. 14
- General-purpose LLMs are described as suboptimal at predicting floating-point numbers, which the authors hypothesize relates to discontinuous token encoding.The paper notes that this encoding does not follow the linearity of real-number space for addition and multiplication.Source: D. Action Representation · p. 14
- The authors identify continuous number representation and intermediate controller input as promising alternatives to explore.They also report using symbol tuning to fine-tune numerical language tokens on paired visual-language-action data as mitigation.Source: D. Action Representation · p. 14
Related papers
This paper cites
- Language Models are Few-Shot Learners2020
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale2020
- GPT-4 Technical Report2023
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks2020
- Gemini: A Family of Highly Capable Multimodal Models2023
- BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models2023