Jumanji: a Diverse Suite of Scalable Reinforcement Learning Environments in JAX

Clément Bonnet, Daniel Luo, Donal John Byrne, Shikha Surana, Sasha Abramowitz, Paul Duckworth, Vincent Coyette, Laurence Illing Midgley, Elshadai Tegegn, Tristan Kalloniatis, Omayma Mahjoub, Matthew Macfarlane, Andries Petrus Smit, Nathan Grinsztajn, Raphael Boige, Cemlyn Neil Waters, Mohamed Ali Ali Mimouni, Ulrich Armel Mbou Sob, Ruan John de Kock, Siddarth Singh, Daniel Furelos-Blanco, Victor Le, Arnu Pretorius, Alexandre Laterre

Open-source reinforcement learning (RL) environments have played a crucial role in driving AI progress. However, modern RL research demands simulated environments that are performant, scalable, and modular to bridge the gap between academic benchmarks and real-world applications.

Enter Jumanji, a new open-source suite of 22 RL environments written entirely in JAX. By moving the simulation logic directly onto hardware accelerators like GPUs and TPUs, Jumanji eliminates traditional CPU bottlenecks, enabling massive parallelization and rapid iteration for industrial-scale combinatorial problems.

The "Speed Gap" in Reinforcement Learning

Historically, reinforcement learning has been hampered by a significant "speed gap." Most popular benchmarks, such as the Arcade Learning Environment (Atari), run on CPUs. This creates a massive communication bottleneck: the agent trains on a high-speed GPU, but it must wait for the CPU to simulate the next environment step and transfer the data over.

Furthermore, existing benchmarks are often rigidly static. Researchers cannot easily change the difficulty of an Atari game or the distribution of its starting states. This rigidity makes it difficult to test how well an agent generalizes to real-world industrial problems—like bin packing or vehicle routing—where the fundamental "rules" stay the same, but the scale and complexity vary wildly.

High-Performance Architecture and Methods

To solve these bottlenecks, the authors built Jumanji using JAX, a high-performance numerical computing library. Because JAX treats functions as pure and stateless, the entire environment can be JIT-compiled and vectorized. Key technical highlights include:

  • Anakin Architecture: Jumanji follows an architecture where the entire training loop—including environment transitions and the agent's policy updates—resides on the hardware accelerator. This completely removes the need to transfer data between the host (CPU) and the device (GPU/TPU).
  • Stateless Design: Environments are functionally pure. The step function takes a state and an action and returns a new state, making it trivial to use JAX transformations like vmap (for massive parallelization) and pmap (for multi-device scaling).
  • Customizable Generators: Instead of fixed starting points, Jumanji uses "Generators." This allows researchers to define specific distributions for initial states, such as clustering cities in a Traveling Salesman Problem (TSP) to mimic real-world logistics.

A Diverse Suite of Environments

Jumanji introduces a diverse suite of 22 environments categorized into three primary domains:

  1. Routing: Includes the Traveling Salesman Problem (TSP), Capacitated Vehicle Routing (CVRP), and Maze.
Traveling Salesman Problem (TSP) environment in Jumanji.
  1. Packing: Includes 3D Bin Packing, Knapsack, and Job Shop Scheduling.
  2. Logic Games: Includes Sudoku, Rubik’s Cube, and Minesweeper.
Rubik's Cube environment, representing the Logic Games domain.

For evaluation, the authors also utilize the VLSI TSP Benchmark Dataset, which contains real-world problem instances, to test the generalization of their agents beyond simple random distributions.

Key Insights and Results

Jumanji's architecture yields impressive performance metrics and opens new avenues for RL research:

  • Unprecedented Throughput: On an 8-core TPU-v4, Jumanji reaches staggering speeds. Some environments, like Maze, exceed 100 million steps per second.
  • Linear Hardware Scaling: Jumanji environments scale almost linearly with hardware. In a head-to-head scaling test on the "Connector" environment, a TPU-128 reached 92% of optimal performance in just 1.5 hours, compared to 11.5 hours on a TPU-8.
  • The Power of Diversity in Training: By using multiple Generators to create varied problem instances (e.g., "clustered" vs. "exploded" city layouts in TSP), agents become significantly more robust. An agent trained on a diverse set of generators performed better on real-world VLSI data than one trained on a standard uniform distribution.
  • Complexity as a Variable: Jumanji allows researchers to treat problem complexity (e.g., the number of items to pack or the size of a Rubik's Cube) as a tunable parameter. This enables "scaling laws" research for RL, identifying exactly when current algorithms like A2C fail as the NP-hard nature of the problems intensifies.

The authors provide A2C (Actor-Critic) baselines for all 22 tasks. While the agents successfully solve simpler versions of the tasks, the results highlight significant "optimality gaps" in complex combinatorial problems, providing a clear benchmark for future algorithmic improvements.

Limitations and Future Directions

While Jumanji is a powerful step forward, the initial release has a few limitations. Currently, all 22 environments use discrete action spaces; although the API supports continuous actions, none are included yet. Additionally, while some environments (like RobotWarehouse) are inherently multi-agent, the provided baselines treat them as single-agent problems with centralized control.

Moving forward, the team plans to expand the suite into new domains such as life sciences and agriculture, and to incorporate more multi-agent and continuous-control tasks to further challenge and empower the RL community.

Summary updated

BibTeX
@inproceedings{bonnet2024jumanji,
  author = {Clément Bonnet and Daniel Luo and Donal John Byrne and Shikha Surana and Sasha Abramowitz and Paul Duckworth and Vincent Coyette and Laurence Illing Midgley and Elshadai Tegegn and Tristan Kalloniatis and Omayma Mahjoub and Matthew Macfarlane and Andries Petrus Smit and Nathan Grinsztajn and Raphael Boige and Cemlyn Neil Waters and Mohamed Ali Ali Mimouni and Ulrich Armel Mbou Sob and Ruan John de Kock and Siddarth Singh and Daniel Furelos-Blanco and Victor Le and Arnu Pretorius and Alexandre Laterre},
  title = {{Jumanji: a Diverse Suite of Scalable Reinforcement Learning Environments in JAX}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=C4CxQmp9wc},
}
Figure