Introduction
Reinforcement Learning (RL) has achieved remarkable success in virtual environments, from mastering Atari games to defeating world champions in Go. However, applying RL to the domain of Autonomous Driving (AD) remains a formidable challenge. The primary obstacle is the "sim-to-real" gap: most synthetic simulators rely on hand-coded, rule-based traffic models that fail to capture the unpredictable and reactive nature of human drivers. Furthermore, training agents directly on public roads is both prohibitively expensive and inherently dangerous.
DriverGym is a new open-source, OpenAI Gym-compatible environment designed to bridge this gap. By leveraging over 1,000 hours of real-world driving data, it provides a standardized platform for training and validating autonomous driving policies in realistic, reactive, closed-loop simulations. Its goal is to democratize AD research, allowing the broader RL community to contribute to self-driving technology without requiring access to a physical vehicle fleet.
The DriverGym Framework
DriverGym is built to be immediately accessible to RL researchers by utilizing the standard obs, reward, done, info = env.step(action) interface. This compatibility allows for seamless integration with popular libraries such as Stable Baselines3 (SB3) and Ray RLlib.
The environment is defined by several core technical pillars:
- State Representation: The world is represented as a 3D tensor—specifically, a Birds-Eye-View (BEV) raster image. This image encodes semantic map data (lanes, crosswalks), traffic light states, and the bounding boxes of surrounding agents.
- Reactive Simulation: To move beyond static log-replay, DriverGym supports reactive agents controlled by pre-trained neural networks. These agents can respond realistically to the RL agent’s maneuvers, creating a more dynamic and challenging training environment.
- Closed-Loop Evaluation (CLE): The framework includes a modular protocol for defining custom metrics (e.g., displacement error) and "validators" (e.g., collision detection) to rigorously test policy performance.
Dataset and Realism
At the heart of DriverGym is the Level 5 Prediction Dataset from Woven Planet. Containing over 1,000 hours of expert driving data, it is one of the largest public datasets available. This represents a significant leap in scale compared to previous simulators like TORCS or Highway-Env, which often rely on zero real-world expert data. By grounding the simulation in massive amounts of human driving logs, DriverGym ensures that the learned policies are exposed to the complexities of real-world traffic patterns.
Experimental Evaluation
The authors evaluated three primary strategies: standard Supervised Learning (SL), SL with synthetic perturbations (SL+P), and Proximal Policy Optimization (PPO).
Key Insights
One of the most significant findings was the "Passivity Trap." Agents trained via PPO became overly cautious. While they successfully reduced front and side collisions compared to SL baselines, they suffered from a high rate of rear collisions (27 for PPO vs. 7 for SL+P). The agents learned that the safest way to avoid hitting objects in front was to stop or move very slowly, which frequently led to them being rear-ended by other simulated drivers.
Additionally, the study confirmed that simple SL fails due to "distribution shift." Without perturbations, an agent cannot recover once it drifts slightly from the expert's path. Introducing synthetic perturbations (SL+P) significantly improved performance, allowing the model to achieve the lowest Average Displacement Error (13.4m).
Performance Summary
- Accuracy: SL+P was the most accurate at mimicking human expert paths.
- Safety: PPO was superior at avoiding active collisions (Front: 4.3, Side: 6), but struggled with passive safety (Rear collisions).
Conclusion and Future Work
DriverGym successfully provides a high-fidelity, standardized environment for AD research, yet several challenges remain. The computational complexity of generating high-resolution BEV rasters makes policy rollouts slower than typical arcade-style RL environments. Future work will focus on improving inter-process communication for better scaling and developing more granular evaluation scenarios, such as unprotected left turns or heavy-traffic merging, to further refine autonomous policy behavior.
Summary updated