NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

pyRDDLGym: From RDDL to Gym Environments

Ayal Taitler, Michael Gimelfarb, Jihwan Jeong, Sriram Gopalakrishnan, Martin Mladenov, Xiaotian Liu, Scott Sanner · DOI

Abstract

pyRDDLGym is an open-source Python framework that automatically converts Relational Dynamic Influence Diagram Language (RDDL) model descriptions into standard OpenAI Gym environments. By bridging the gap between symbolic planning and reinforcement learning, it allows researchers to easily scale complex environments and leverage explicit model knowledge for hybrid learning-planning approaches. We describe the technical challenges of automated grounding and level reasoning, and introduce JAXPlanner, a built-in model-based planner that utilizes differentiable relaxations of RDDL logic.

Introduction

Historically, the fields of Probabilistic Planning and Reinforcement Learning (RL) have operated in silos. Planning researchers use declarative languages like RDDL to describe world dynamics (state transitions, rewards) as explicit mathematical models. Conversely, the RL community treats environments as "black boxes" through interfaces like OpenAI Gym, where the agent learns solely through trial and error without knowing the underlying equations.

This separation creates several challenges: hard-coding environments in pure Python is brittle and time-consuming, scaling lifted models to specific instances is manually intensive, and the "ground truth" model is often buried in code, making it nearly impossible to use model-based planning techniques or verify the environment's correctness.

The pyRDDLGym Framework

The authors introduce pyRDDLGym, which automates the generation of Gym environments from RDDL descriptions, effectively treating the environment as a declarative logic file rather than a black-box script.

The pyRDDLGym architecture: converting RDDL descriptions into interactive Gym environments.

Key Technical Contributions

  • Automated Grounding: RDDL uses "lifted" descriptions (templates for objects). pyRDDLGym "grounds" these templates into concrete state and action spaces (e.g., converting a general "UAV" template into specific variables for UAV_1, UAV_2, etc.).
  • Automatic Level Reasoning: In RDDL, variables often depend on one another within a single time step. pyRDDLGym uses topological sorting to automatically determine the correct evaluation order, removing the need for users to manually define "levels."
  • Language Extensions: To make RDDL fully compatible with RL, the authors added support for terminal states (e.g., ending a simulation when a pole falls) and action preconditions.
  • JAXPlanner: A built-in model-based planner that uses the JAX library. It employs "differentiable relaxations"—using t-norms to approximate Boolean logic and sigmoids for relational operators—allowing the system to calculate gradients through the RDDL model for optimization.

Benchmarks and Environments

While not a dataset paper in the traditional sense, pyRDDLGym introduces a suite of 15 built-in environments ranging from classic control to complex industrial problems. These differ from standard Gym benchmarks because their transition dynamics are explicitly defined in RDDL files, making them fully transparent and verifiable.

Summary of built-in benchmark domains in pyRDDLGym, categorized by action and state space types.

These benchmarks include:

  • Classic: Cart-pole (continuous and discrete), Mountain Car.
  • Industrial/Logistics: Power Unit Commitment, Supply Chain, Traffic control.
  • Robotics/Navigation: UAV (continuous, discrete, and mixed), Mars Rover, Elevators.
  • Social/Web: Recommender Systems.

Key Insights and Results

  • Model-as-Logic: By treating the environment as a declarative RDDL file, it becomes a "first-class citizen" that can be analyzed, verified, and shared across different research communities.
  • Trivial Scaling: Because RDDL is "lifted," scaling an environment from 2 agents to 200 is often as simple as changing a single line in an instance file, rather than refactoring an entire Python class.
  • Differentiable Planning: The inclusion of JAXPlanner shows that symbolic models and gradient-based learning can be unified. By relaxing discrete logic into continuous functions, we can "backpropagate" through the world model to find optimal actions.
  • Framework Versatility: The framework successfully maps RDDL's complex conditional probability functions (CPFs) into Gym’s Box and Discrete spaces, supporting both MDPs (full observability) and POMDPs (partial observability).

Limitations and Future Work

Some older RDDL features, like derived-fluents and manual fluent levels, are being phased out in favor of automated reasoning. Additionally, while action preconditions are supported, strict enforcement is currently optional to avoid interrupting simulations. The authors aim to establish pyRDDLGym as a "verified benchmark" for the community, ensuring that RL agents are tested against mathematically sound models rather than potentially buggy hard-coded scripts.

Summary updated

BibTeX
@misc{taitler2022pyrddlgym,
  author = {Ayal Taitler and Michael Gimelfarb and Jihwan Jeong and Sriram Gopalakrishnan and Martin Mladenov and Xiaotian Liu and Scott Sanner},
  title = {{pyRDDLGym: From RDDL to Gym Environments}},
  year = {2022},
  eprint = {2211.05939},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.05939},
}
Figure