CarDreamer: Open-Source Learning Platform for World-Model-Based Autonomous Driving

Dechen Gao, Shuangyu Cai, Hanchu Zhou, Hang Wang, Iman Soltani, Junshan Zhang

TL;DR

CarDreamer is the first open-source learning platform specifically designed for developing and evaluating world model-based reinforcement learning algorithms in autonomous driving. By seamlessly bridging the CARLA simulator with standard Gymnasium interfaces, it allows researchers to easily swap world model backbones, configure complex driving tasks, and analyze multi-modal observations.

What Problem Does This Paper Address?

Reinforcement learning (RL) holds immense promise for autonomous vehicles (AVs), but traditional model-free RL suffers from high sample complexity and struggles to generalize to rare, safety-critical events. World models (WMs) offer a compelling alternative: by learning a compact latent representation of environment dynamics, they allow an agent to "imagine" future trajectories and train entirely within its own mental simulation.

However, researching WMs in autonomous driving has been bottlenecked by a lack of standardized tooling. High-fidelity simulators like CARLA are built for general traffic simulation rather than RL training, making tasks like extracting Bird's-Eye View (BEV) data or setting up standardized Gym interfaces cumbersome and time-consuming. CarDreamer fills this void by providing a highly modular, out-of-the-box platform tailored for world model-based AV research.

Methods

The CarDreamer architecture is split into three decoupled components to maximize flexibility:

CarDreamer Architecture
  1. World Model Backbone: Strategically isolated from the environment, this component communicates via a unified Gym interface. CarDreamer comes with state-of-the-art world models pre-integrated, including DreamerV2, DreamerV3, and Planning2Explore.
  2. Built-in Tasks: It features a suite of highly customizable driving scenarios (e.g., lane merging, overtaking, roundabouts) with adjustable traffic density, observation modalities (RGB cameras, LiDAR, Radar, BEVs), and communication settings.
  3. Task Development Suite: For custom scenarios, this suite provides automated traffic spawning, route planning (using $A^*$ or random roaming), and a web-based visualization server to monitor agent imagination and performance metrics in real time.

A key contribution of the platform is its empirically optimized reward function. Standard RL setups often reward absolute position, but the authors found this causes driving agents to exploit the system: they move slightly forward and then freeze to avoid collision penalties. To combat this, CarDreamer rewards incremental speed parallel to the goal ($v_{\text{parallel}}$). Furthermore, to prevent the erratic, zigzagging trajectories often induced by standard RL exploration mechanics, they introduced a penalty for velocity perpendicular to the goal ($v_{\text{perp}}$):

$$r = \alpha v_{\text{parallel}} - \beta v_{\text{perp}} - \gamma \mathbb{I}_{\text{collision}}$$

Datasets

CarDreamer does not rely on static datasets; instead, it serves as a dynamic data generation and training environment built on top of the CARLA simulator. It automates the collection and alignment of multi-modal observation data, allowing agents to train on raw sensor streams or synthetic abstractions like semantic BEV masks.

Key Insights and Ideas

  • The "Freezing" Problem: Rewarding an agent for its absolute position creates a local optimum where the safest action is to stand still. Rewarding velocity forces the world model to continuously plan forward.
  • Smoothing out Exploration: Standard RL exploration terms (like entropy maximization) incentivize erratic driving because zigzagging generates higher entropy. Penalizing perpendicular velocity effectively smooths out the vehicle's path without crushing exploration.
  • V2V Communication is Crucial for WMs: While world models are excellent at predicting the future, they fail catastrophically under partial observability (e.g., when a building blocks the camera's view of an intersection). Vehicle-to-Vehicle (V2V) communication—sharing either Field-of-View data or planned waypoints—drastically restores the predictive power of the world model.

Key Results

The authors evaluated a small DreamerV3 model (18M parameters) on a single NVIDIA 4090 GPU across various tasks:

Reward curves of different tasks
  • Convergence Speed: Simpler tasks with light traffic (like lane merge) converged within 50k steps (~1 hour). Complex scenarios with aggressive background traffic required 150k–200k steps (~3 to 4 hours).
  • High Success Rates: Under full observability, the DreamerV3 agent achieved a 100% success rate in overtaking and a 99.58% success rate in the challenging Right turn hard task.
  • The Impact of Observability: In the Right turn hard task, limiting the agent to its own Field of View (FOV) caused the success rate to plummet to 12.44%, as the agent hesitated or suffered collisions from unobserved cross-traffic. Enabling Shared FOV (SFOV) brought the success rate back up to 29.52%, while full observability yielded 99.58%.
  • Intention Sharing: When full observability was granted but vehicles did not share their planned trajectories (intentions), the collision rate jumped from 0.42% to 8.94%, proving that communicating intent is vital for navigating aggressive traffic flows.

Limitations and Future Work

While CarDreamer successfully standardizes world model benchmarking, the authors note that training agents in highly complex environments from scratch remains challenging. They point to several promising future directions to integrate into the platform:

  • Curriculum and Continual Learning: Gradually increasing traffic complexity to ease the training process and prevent agents from forgetting basic skills when introduced to harder tasks.
  • Transfer and Meta-Learning: Improving the platform's capabilities for few-shot adaptation, allowing a world model trained on one city map to quickly adapt to entirely new environments.

Summary updated

BibTeX
@article{gao2025cardreamer,
  author = {Dechen Gao and Shuangyu Cai and Hanchu Zhou and Hang Wang and Iman Soltani and Junshan Zhang},
  title = {{CarDreamer: Open-Source Learning Platform for World-Model-Based Autonomous Driving}},
  journal = {IEEE Internet of Things Journal},
  year = {2025},
  doi = {10.1109/jiot.2024.3479088},
}
Figure