LMDrive: Closed-Loop End-to-End Driving with Large Language Models

Hao Shao, Yuxuan Hu, Letian Wang, Guanglu Song, Steven L. Waslander, Yu Liu, Hongsheng Li

Introduction

Autonomous driving (AD) systems typically rely on modular pipelines or end-to-end neural networks that process rigid, fixed-format inputs like GPS waypoints. These systems often struggle with "long-tail" unforeseen events and lack the ability to interact naturally with human passengers. LMDrive addresses these limitations by introducing the first end-to-end, closed-loop autonomous driving framework that utilizes a Large Language Model (LLM) as its central reasoning engine. Unlike open-loop models that merely predict paths from single frames, LMDrive operates in a dynamic simulation, allowing the LLM to directly control the vehicle and react to environmental consequences in real-time.

System Architecture

Overview of the LMDrive closed-loop framework, illustrating the interaction between the LLM brain, multi-modal sensor data, and the environment. Source, p. 1

Overview of the LMDrive closed-loop framework, illustrating the interaction between the LLM brain, multi-modal sensor data, and the environment.

LMDrive bridges the gap between high-level natural language and low-level vehicle control through three integrated components:

  1. Vision Encoder: This module processes inputs from four RGB cameras and a LiDAR sensor. It utilizes a ResNet backbone for imagery and PointPillars for LiDAR data, fusing them into a Bird’s-Eye-View (BEV) representation to provide 360-degree spatial awareness.
  2. LLM Brain: The framework employs a pre-trained, frozen LLaMA model to leverage its inherent reasoning capabilities. To manage the high dimensionality of visual data, a Q-Former (inspired by BLIP-2) compresses visual features into a concise set of "visual tokens" compatible with the LLM.
  3. Action Prediction: Based on visual tokens and language instructions, the LLM predicts future waypoints. These are then translated into steering, throttle, and brake signals using standard PID controllers.

Instruction Following and Safety

Multi-view camera inputs paired with navigation and real-time 'notice' instructions. Source, p. 3

Multi-view camera inputs paired with navigation and real-time 'notice' instructions.

A key feature of LMDrive is its ability to process two types of language inputs: standard navigation commands and real-time "notice instructions" (e.g., "Watch out for the pedestrians up ahead!"). The inclusion of these notices acts as a high-level attention mechanism, significantly reducing collisions. Furthermore, the model demonstrates "instructional robustness"—it can identify and ignore misleading or unsafe commands (such as being told to change lanes illegally), prioritizing environmental constraints and safety over human error.

Datasets and Benchmarking

To facilitate research in this area, the authors introduced the LMDrive Dataset, containing 64,000 instruction-following clips, and the LangAuto Benchmark. LangAuto evaluates agents across diverse tracks, including sequential command chains and adversarial events where sudden warnings are issued.

Results and Discussion

LMDrive, particularly when using a LLaVA-v1.5 backbone, achieved a top Driving Score of 36.2 on the LangAuto benchmark. In safety-critical scenarios (LangAuto-Notice), the model reached an Infraction Score of 0.87, proving that real-time linguistic feedback drastically improves driving safety. Ablation studies confirmed that both the BEV spatial context and the Q-Former's data bottlenecking are essential for performance.

Limitations and Future Work

While promising, LMDrive currently operates within the CARLA simulator. Transitioning to real-world environments involves overcoming challenges like sensor noise and hardware latency. Additionally, the computational demand of running a 7B-parameter LLM in real-time remains a hurdle for edge deployment. Future research may focus on model distillation and fine-tuning the LLM specifically for driving nuances.

Summary updated

BibTeX
@inproceedings{shao2023lmdrive,
  author = {Hao Shao and Yuxuan Hu and Letian Wang and Guanglu Song and Steven L. Waslander and Yu Liu and Hongsheng Li},
  title = {{LMDrive: Closed-Loop End-to-End Driving with Large Language Models}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure