Abstract
Realistic traffic simulation is crucial for developing self-driving software in a safe and scalable manner prior to real-world deployment. Typically, imitation learning (IL) is used to learn human-like traffic agents directly from real-world observations collected offline, but without explicit specification of traffic rules, agents trained from IL alone frequently display unrealistic infractions like collisions and driving off the road. This problem is exacerbated in out-of-distribution and long-tail scenarios. On the other hand, reinforcement learning (RL) can train traffic agents to avoid infractions, but using RL alone results in unhuman-like driving behaviors. We propose Reinforcing Traffic Rules (RTR), a holistic closed-loop learning objective to match expert demonstrations under a traffic compliance constraint, which naturally gives rise to a joint IL + RL approach, obtaining the best of both worlds. Our method learns in closed-loop simulations of both nominal scenarios from real-world datasets as well as procedurally generated long-tail scenarios. Our experiments show that RTR learns more realistic and generalizable traffic simulation policies, achieving significantly better tradeoffs between human-like driving and traffic compliance in both nominal and long-tail scenarios. Moreover, when used as a data generation tool for training prediction models, our learned traffic policy leads to considerably improved downstream prediction metrics compared to baseline traffic agents.
Introduction
Simulating human driving behavior is a cornerstone of autonomous vehicle (AV) development. However, existing models often fall into two distinct traps. The Imitation Trap occurs when models trained purely on human data (Imitation Learning) fail in closed-loop settings; because they are often trained to predict the next step based on fixed recordings, they suffer from compounding errors and cannot recover once they drift off-track. Conversely, the Reinforcement Trap involves models trained solely to maximize safety rewards (Reinforcement Learning), which often results in "unhuman" behaviors such as driving at a crawl or stopping unnaturally to avoid any potential risk.
To bridge this gap, we present Reinforcing Traffic Rules (RTR), a framework that combines the stylistic realism of IL with the safety constraints of RL.
Methodology
The core of RTR is a holistic objective function derived using a Lagrangian formulation. The problem is framed as matching expert behavior as closely as possible while adhering to a traffic compliance constraint (i.e., not breaking the rules).
Key technical components of the RTR framework include:
- Closed-loop Training: Unlike standard behavior cloning, RTR agents are trained in a simulator where their actions influence future states, forcing the model to learn recovery behaviors.
- Joint IL + RL Objective: The loss function decomposes into an IL term (minimizing distance to expert trajectories) and an RL term (penalizing infractions like collisions).
- Factorized Multi-agent RL: To handle dense traffic, the authors utilize a factorized version of Proximal Policy Optimization (PPO), assigning individual rewards to agents to solve the credit assignment problem.
- Differentiable Dynamics: The IL component employs a differentiable kinematic bicycle model, allowing gradients to flow directly from trajectory errors back to the policy.
Experimental Results
The model was evaluated on two datasets: Nominal (465 real-world highway logs) and Long-tail (333 procedurally generated scenarios involving aggressive cut-ins and hard braking).
As shown in the performance metrics, RTR achieves the best of both worlds:
- Safety: In long-tail scenarios, RTR reduced the collision rate to 3.61%, a significant improvement over pure IL (12.13%) and standard Behavior Cloning (17.00%).
- Realism: RTR maintained a Final Displacement Error (FDE) of 5.16m on nominal data—nearly matching the 4.98m of pure IL while offering vastly superior safety.
- Downstream Impact: Motion prediction models trained on RTR-generated data performed significantly better on real-world test data than those trained on baseline simulators, proving the high fidelity of the learned agents.
Conclusion
RTR demonstrates that a joint objective for style and rules is essential for creating realistic traffic simulations. By training in closed-loop on both nominal and long-tail data, RTR reaches a new Pareto frontier of performance. Future work will focus on automating the generation of long-tail scenarios and scaling the framework to city-wide simulations with thousands of agents.
Summary updated