Logic-RAG: Augmenting Large Multimodal Models with Visual-Spatial Knowledge for Road Scene Understanding
Imran Kabir, Md Alimoor Reza, Syed Billah
TL;DR
Logic-RAG tackles the gap in visual-spatial reasoning of large multimodal models used in autonomous driving by grounding their responses in a dynamic, first-order logic knowledge base. It combines a perception module to extract structured scene facts, a Query-to-Logic Embedder to translate natural questions into FOL predicates, and a symbolic Inference Engine to derive conclusions before feeding results to LMMs, thereby reducing hallucination and increasing interpretability. The approach yields substantial accuracy gains on synthetic driving scenes ($\uparrow$ to $>80\%$) and real-world KITTI data ($\uparrow$ to $\approx90\%$), with ablations showing both fact-based KB context and full logical inference contribute to improvements. The framework is modular and extensible, enabling domain experts to augment the KB with new predicates and rules, and it demonstrates practical potential for safer, more trustworthy autonomous driving systems by improving spatial reasoning and explainability of model-assisted decisions.
Abstract
Large multimodal models (LMMs) are increasingly integrated into autonomous driving systems for user interaction. However, their limitations in fine-grained spatial reasoning pose challenges for system interpretability and user trust. We introduce Logic-RAG, a novel Retrieval-Augmented Generation (RAG) framework that improves LMMs' spatial understanding in driving scenarios. Logic-RAG constructs a dynamic knowledge base (KB) about object-object relationships in first-order logic (FOL) using a perception module, a query-to-logic embedder, and a logical inference engine. We evaluated Logic-RAG on visual-spatial queries using both synthetic and real-world driving videos. When using popular LMMs (GPT-4V, Claude 3.5) as proxies for an autonomous driving system, these models achieved only 55% accuracy on synthetic driving scenes and under 75% on real-world driving scenes. Augmenting them with Logic-RAG increased their accuracies to over 80% and 90%, respectively. An ablation study showed that even without logical inference, the fact-based context constructed by Logic-RAG alone improved accuracy by 15%. Logic-RAG is extensible: it allows seamless replacement of individual components with improved versions and enables domain experts to compose new knowledge in both FOL and natural language. In sum, Logic-RAG addresses critical spatial reasoning deficiencies in LMMs for autonomous driving applications. Code and data are available at https://github.com/Imran2205/LogicRAG.
