TL;DR
Jumanji is a new open-source suite of 22 reinforcement learning (RL) environments implemented in JAX, specifically designed for high-speed, hardware-accelerated experimentation. By focusing on industry-relevant combinatorial optimization problems and providing a highly flexible, scalable API, Jumanji aims to bridge the gap between academic RL research and complex real-world applications.
What Problem Does This Paper Address?
Reinforcement learning has seen massive success in games, but transitioning that success to industrial applications remains difficult. The authors identify three major bottlenecks in current RL benchmarking:
- Speed: Most environments run on CPUs, creating a sequential bottleneck that hinders large-scale experimentation.
- Flexibility: Existing suites often have hard-coded initial states, making it difficult to study how agents generalize to different data distributions.
- Real-world Relevance: Popular benchmarks like Atari or MuJoCo are often disconnected from the NP-hard combinatorial optimization problems (COPs) found in logistics, manufacturing, and routing.
Jumanji addresses these by providing a suite of environments that are natively hardware-accelerated, highly customizable via "generators," and focused on practical problem categories like routing and packing.
Methods
The core of Jumanji is its implementation in JAX. This allows the environments to leverage XLA compilation for device-agnostic optimization across CPUs, GPUs, and TPUs.
Key technical features include:
- Stateless Design: Environments are functionally pure, meaning the
stepandresetfunctions don't maintain internal state. This makes them perfectly suited for JAX transformations likevmap(vectorization for running thousands of environments in parallel) andpmap(parallelization across multiple hardware devices). - Anakin Architecture: The library is designed to support the "Anakin" training flow, where the entire RL loop—inference, environment stepping, and learner updates—stays on the accelerator. This eliminates the costly data transfer overhead between the host (CPU) and the device (GPU/TPU).
- Composition-based API: Unlike the standard OpenAI Gym, Jumanji uses "Generators" to define initial state distributions. This allows researchers to easily swap out how a problem is initialized (e.g., changing how cities are distributed in a Traveling Salesman Problem) without changing the environment dynamics.
Datasets
Jumanji introduces a diverse suite of 22 environments divided into three categories:
- Routing: Including Traveling Salesman (TSP), Capacitated Vehicle Routing (CVRP), and Robot Warehouse.
- Packing: Including 3D Bin Packing, Job Shop Scheduling, and Knapsack.
- Logic Games: Including Rubik’s Cube, Sudoku, and Minesweeper.
For evaluation, the authors also utilize the VLSI TSP Benchmark Dataset, a collection of real-world problem instances, to test the generalization capabilities of their trained agents.
Key Insights and Ideas
- The Power of Parallelization: By moving environments to the accelerator, Jumanji achieves massive throughput. For simple environments like Maze, it can process nearly $10^8$ steps per second on a single TPU-v4.
- Generalization requires Distributional Diversity: A key experiment showed that an agent trained on a single uniform distribution for TSP performed poorly on real-world VLSI instances. However, an agent trained using a mix of custom generators (cluster, linear compression, and explosion) generalized significantly better to unseen real-world data.
- Scalability as a Benchmark: Jumanji allows users to arbitrarily scale problem complexity (e.g., increasing the number of items in Bin Packing or the grid size in Connector). The authors show that as complexity increases, standard RL baselines like A2C struggle, highlighting a clear "optimality gap" that provides a fertile ground for future research.
Key Results
- Throughput Scaling: The library demonstrates near-linear scaling of environment steps per second as the number of parallel instances increases.
- Training Speedup: On the "Connector" environment, increasing the hardware from 8 TPU cores to 128 cores reduced the time to reach 92% optimal performance from 12.8 hours to just 1.4 hours.
- Baseline Performance: The authors provide A2C baselines for all 22 environments. While the agents successfully learn in most cases, they often fall short of optimal performance in complex combinatorial tasks, establishing a challenging benchmark for the community.
Limitations and Future Work
While Jumanji is a significant step forward, the authors note several areas for growth:
- Action Spaces: Currently, all implemented environments use discrete actions, though the API is designed to support continuous actions in the future.
- Multi-Agent RL (MARL): Several environments (like Robot Warehouse or MultiCVRP) are inherently multi-agent, but the current baselines treat them as single-agent problems with centralized control. Future work will include dedicated MARL implementations.
- Domain Expansion: The team plans to expand the suite into other fields like life sciences, agriculture, and more complex logistics scenarios.
Jumanji is released under the Apache 2.0 license and is available on GitHub.
Summary updated