TerraZero: Zero-Demonstration Self-Play for Autonomous Driving at Scale

TerraZero: Zero-Demonstration Self-Play for Autonomous Driving at Scale

Zhouchonghao Wu, Akshay Rangesh, Weixin Li, Wei-Jer Chang, Zachary Lee +2 more

6 min readJul 15, 2026

Researchers built TerraZero, a high-speed driving simulator that trains autonomous driving policies entirely through self-play — no human demonstrations needed. By procedurally generating millions of traffic scenarios from real-world maps, it produces policies that jointly control vehicles, pedestrians, and cyclists. The system achieves among the highest throughput reported for object-level driving simulators while supporting multiple data sources.

What the Researchers Built

TerraZero is a closed-loop driving simulator purpose-built for reinforcement learning (RL) with self-play at scale. It combines a fast C simulation engine with a procedural scenario generator that turns a single real-world map into thousands of unique training episodes. The simulator ingests map data from Waymo, nuPlan, and CARLA, converting each into a compact binary format that the engine reads directly.

The system models heterogeneous traffic: cars (with jerk-level control), pedestrians (unicycle model), cyclists (compact-bicycle model), and trucks (bicycle model with tire forces). A single shared neural network controls all agent types through per-type action masking. Rule-based non-player characters (NPCs) enrich the traffic mix and help break symmetry in self-play.

Training uses distributed data parallelism across multiple GPUs and nodes. Gradients are all-reduced across ranks, and key normalization statistics (advantage, value rescaling, priority sampling) remain globally consistent. The entire stack runs on PufferLib, a vectorization and training framework.

Architecture diagram showing CPU-GPU split and data pipeline components

Key Results

TerraZero’s key claim is enabling zero-demonstration self-play for driving — policies learn from scratch using only map geometry and procedurally generated scenarios, without any human driving logs. The heterogeneous self-play policy (called the sim agent) was trained on 32 A100 GPUs using Waymo map geometry alone.

The system achieves “among the highest reported throughput for object-level, self-play-enabled driving simulators.” While the paper does not publish exact numerical throughput comparisons, it emphasizes that the architecture resolves the typical tension between simulation speed and scenario fidelity. Prior simulators either ran fast but lacked realistic traffic interactions, or were feature-rich but orders of magnitude slower.

By training entirely through self-play, the policy is exposed to an automatic curriculum: as it improves, the traffic it interacts with becomes proportionally more competent. This avoids manual scenario design and directly addresses the long-tail problem in autonomous driving.

How It Works

TerraZero partitions work between CPU and GPU. Object-level dynamics, observation construction, reward computation, and traffic-light logic run in C (compiled as a CPython extension). Policy inference and learning run in PyTorch on the GPU. Environments execute in parallel worker processes over shared memory buffers, and the trainer consumes the full batch in a single device transfer.

Procedural scenario generation starts with logged trajectories and map geometry. At each episode, randomized mechanisms expand the seed scenario: - Agent placement: Count and positions are sampled randomly, often exceeding the density of the original recording. - Goal assignment: Navigation goals are sampled via a forward walk on the lane-topology graph, with configurable dropout to encourage robust behavior. - Actor diversification: Bounding-box dimensions are sampled from type-specific ranges, exposing the policy to cars, trucks, buses, and more. - Kinematic parameter randomization: Four coefficients (max velocity, max acceleration, min velocity, min acceleration) are sampled per agent per episode, forcing the policy to adapt online.

Distributed self-play uses data parallelism. Each rank runs its own environments and computes local gradients. Normalization statistics (advantage, PopArt value rescaling, joint priority sampling) are synchronized globally across ranks to maintain a single consistent scale.

Rule-based NPCs (e.g., vehicles that stop at red lights, pedestrians crossing at crosswalks) provide structured behaviors without learned models, helping the self-play policy encounter varied and realistic interactions.

Procedural generation diagram showing how seed scenarios are expanded into diverse training episodes

Why This Matters for Robotics

Autonomous driving is one of the hardest challenges in embodied AI. Traditional RL approaches rely on human demonstration data, which is expensive to collect and limited in coverage of rare events. TerraZero shows that self-play — paired with a sufficiently rich procedural simulator — can produce capable policies without any driving logs. This dramatically lowers the barrier to entry for organizations developing autonomous vehicle software.

The architecture is also modular: supporting a new dataset requires only a converter to the common representation. This makes TerraZero adaptable to different geographic regions and sensor configurations.

For the broader robotics community, the techniques — CPU/GPU partitioning, procedural scenario generation, and distributed self-play with synchronized normalization — transfer directly to other domains where simulation is used for policy learning, such as warehouse robots or industrial manipulators. The ability to train without demonstrations is especially valuable for tasks where human teleoperation is impractical.

Limitations and Open Questions

TerraZero relies on high-definition maps with lane-level topology, traffic signal phase information, and intersection geometry. Regions without such maps cannot be used for training or evaluation, limiting geographic scalability.

The simulator operates at the object level — it provides ground-truth structured features, not raw sensor data. This means TerraZero cannot directly train end-to-end perception-to-control pipelines. Policies trained here still need a perception stack to bridge the gap from camera or lidar inputs to the structured features the policy expects.

Finally, while kinematic parameter randomization improves robustness, the sim-to-real gap for physical vehicle dynamics (tire friction, suspension, aerodynamics) remains an open challenge. Randomization alone does not fully close that gap.

Frequently Asked Questions

Does TerraZero require human driving data for training? No. The sim agent is trained entirely through self-play using only map geometry and procedurally generated scenarios — zero demonstrations are used.

What types of road users can TerraZero simulate? It simulates vehicles (cars, trucks, buses), pedestrians, and cyclists, each under their own dynamics model and controlled by a shared policy.

How does TerraZero achieve high simulation throughput? By carefully partitioning work: cheap, branchy simulation logic runs in C on the CPU, while dense tensor math runs in PyTorch on the GPU. Parallel workers and batched transfers keep both saturated.

Can I use TerraZero with my own map data? Yes. The system currently supports Waymo, nuPlan, and CARLA, and adding a new dataset requires only a converter to the common binary format.

Conclusion

TerraZero demonstrates that zero-demonstration self-play can produce capable driving policies when paired with a fast, feature-rich procedural simulator. Its architecture resolves the longstanding tension between simulation speed and scenario fidelity, enabling training at meaningful scale. The modular design and heterogeneous traffic support make it a practical tool for autonomous driving research and development.

🍪 Cookie preferences

We use cookies to measure performance. Privacy Policy