EconoJax: A Fast & Scalable Economic Simulation in Jax

Koen Ponse, Aske Plaat, Niki van Stein, Thomas M. Moerland

TL;DR

EconoJax is a high-performance, multi-agent economic simulation framework built entirely in JAX. By transitioning from traditional 2D grid-worlds to a GPU-accelerated vector-based environment, it achieves a staggering >2400x speedup over previous implementations, enabling complex economic experiments with 100+ agents to complete in minutes rather than days.

What Problem Does This Paper Address?

Simulating economies using Multi-Agent Reinforcement Learning (MARL) is a powerful tool for policy design, but it is notoriously slow. The "AI Economist," a landmark framework in this field, often requires days of training on massive CPU clusters to reach convergence, even for tiny populations of four agents.

This computational bottleneck creates a "research tax": it prevents researchers from scaling to realistic population sizes, exploring large action spaces, or iterating quickly on environment design. The authors identify a gap in the JAX ecosystem—which has already revolutionized physics and robotics simulations—specifically for agent-based economic modeling.

Methods

The authors introduce EconoJax, a simulation environment modeled after the AI Economist but redesigned for the JAX ecosystem.

Key technical choices include:

  • Vector-Based State: Unlike the original 2D grid-world where agents move to collect resources, EconoJax uses a 1D vector representation. Agents perform abstract "gather," "craft," and "trade" actions. This simplification significantly reduces computational overhead without sacrificing economic complexity.
  • JAX Integration: The entire pipeline—environment, agents, and training loop—is written in JAX. This allows for just-in-time (JIT) compilation via XLA and seamless execution on GPUs.
  • Agent Architecture: The simulation features two agent types:
  • Population Agents: Optimize for individual utility (a function of wealth minus labor).
  • Government Agent (Planner): Optimizes for social welfare, defined as the product of total productivity and equality (1 - Gini index).
  • Action Masking: To accelerate training, the authors implement masking to prevent agents from attempting invalid actions, such as selling resources they don't possess.
Figure 1: Overview of EconoJax and its different components, actions- and observation spaces. Population agents act via gathering resources, converting these into coin, and trading on the marketplace. The government agent acts by setting tax rates at specific intervals. The escrow inventories are used as a temporary inventory for items that are used in active market orders. Observations marked with "stats", indicate that the government does not observe the state for each individual agent, but rather the mean, standard deviation, and median of the population.

Datasets

The paper does not use external datasets; instead, it utilizes EconoJax as a synthetic benchmark. The environment is initialized with agents assigned varying skill levels (via a Pareto distribution with added noise) to encourage specialization. The authors have open-sourced the code to allow the community to use EconoJax as a foundation for more data-driven economic research.

Key Insights and Ideas

  • Emergent Realism in 1D: The most significant "aha moment" is that spatial movement isn't strictly necessary for complex economic behavior. Even in a non-spatial vector environment, agents naturally specialized in tasks (e.g., gathering vs. crafting) based on their skill sets.
  • The Equality-Productivity Tradeoff: The simulation successfully captured the classic economic tension where redistributive taxation increases equality but can slightly dampen total productivity as high-earners face diminishing returns on labor.
  • Method Neutrality: In experiments comparing centralized training (parameter sharing) vs. independent training (iPPO), the authors found surprisingly little difference in the diversity of agent behaviors. This suggests that private observations and heterogeneous skill levels are sufficient drivers for specialization, even when agents share the same underlying neural network weights.
  • Natural Progressivity: Without being programmed to do so, the government agent learned to implement a progressive tax system—taxing higher income brackets at higher rates—to maximize social welfare.

Key Results

  • Massive Speedup: EconoJax trained a 4-agent population >2400x faster than the original AI Economist implementation.
  • Scalability: A population of 100 agents reached convergence in roughly 13 minutes on a single NVIDIA A100 GPU. For context, the original framework often failed to complete similar runs after a full week of training on 32 CPU cores.
  • Policy Emergence: The government agent successfully improved social welfare by finding tax schedules that balanced equality and productivity.
Productivity and equality metrics during training, showing the impact of taxes vs. a free market.
Average tax rates produced by the government agent, demonstrating an emergent progressive tax system.

Limitations and Future Work

While EconoJax is a significant step forward in speed, the authors acknowledge several limitations:

  • Parameter Tuning: Many environment constants (like labor costs and utility function shapes) are currently set manually. A key next step is to calibrate these parameters using real-world economic data.
  • Model Complexity: The current economy is simplified. Future iterations could include more complex entities like firms, banks, or multi-stage supply chains.
  • Diversity Metrics: The authors noted that while returns were similar across MARL methods, better metrics are needed to truly quantify behavioral diversity in large-scale simulations.

EconoJax serves as a high-speed "stepping stone" for researchers to build more sophisticated, data-aligned simulations that were previously computationally out of reach.

Summary updated

Abstract

Accurate economic simulations often require many experimental runs, particularly when combined with reinforcement learning. Unfortunately, training reinforcement learning agents in multi-agent economic environments can be slow. This paper introduces EconoJax, a fast simulated economy, based on the AI economist. EconoJax, and its training pipeline, are completely written in JAX. This allows EconoJax to scale to large population sizes and perform large experiments, while keeping training times within minutes. Through experiments with populations of 100 agents, we show how real-world economic behavior emerges through training within 15 minutes, in contrast to previous work that required several days. We additionally perform experiments in varying sized action spaces to test if some multi-agent methods produce more diverse behavior compared to others. Here, our findings indicate no notable differences in produced behavior with different methods as is sometimes suggested in earlier works. To aid further research, we open-source EconoJax on Github.
BibTeX
@inproceedings{ponse2025econojax,
  author = {Koen Ponse and Aske Plaat and Niki van Stein and Thomas M. Moerland},
  title = {{EconoJax: A Fast \& Scalable Economic Simulation in Jax}},
  booktitle = {AAMAS},
  year = {2025},
}
Figure