IPCGRL: Language-Instructed Reinforcement Learning for Procedural Level Generation

In-Chang Baek, Sung-Hyun Kim, Seo-Young Lee, Dong-Hyeon Kim, Kyung-Joong KimCoG 2025

Introduction

Procedural Content Generation via Reinforcement Learning (PCGRL) has traditionally relied on rigid, numerical parameters to guide the creation of game environments. While effective for optimization, these "hard-coded" inputs—such as specifying a path length of exactly 50 units—do not align with the intuitive, descriptive way human designers communicate. IPCGRL (Instruction-conditioned PCGRL) introduces a framework that bridges this gap, allowing reinforcement learning agents to interpret and execute natural language instructions like "Many blocks scattered sparingly" to generate functional game levels.

The Challenge of Natural Language in PCGRL

Integrating natural language into Deep Reinforcement Learning (DRL) presents a significant dimensionality challenge. Natural language is inherently high-dimensional and ambiguous, making it difficult for an agent to map a complex sentence directly to the discrete tile-placing actions required to satisfy a reward function. Existing PCGRL methods often bypass this by using predefined reward functions that limit the flexibility and creative range of the generator. The core problem addressed by IPCGRL is how to translate human-intuitive text into a mathematical objective that an RL agent can reliably optimize.

Methodology: The IPCGRL Framework

The authors propose a two-phase training pipeline designed to filter linguistic noise and focus on task-relevant information.

1. Instruction Encoding Phase

Rather than feeding raw text or high-dimensional BERT embeddings directly to the agent, the system employs a Conditional Instruction Encoder. This component takes a standard BERT embedding and compresses it into a 64-dimensional task-specific representation ($z_{enc}$). To ensure this compressed vector retains game-relevant meaning, an auxiliary decoder is trained to predict a "fitness value"—a metric representing how well a given game state matches the specific text instruction. This bottleneck forces the model to discard "linguistic fluff" and prioritize the quantitative requirements of the task.

2. Instruction-Conditioned RL Phase

The DRL agent, trained using Proximal Policy Optimization (PPO), receives two primary inputs: the current state of the game board and the compressed $z_{enc}$ vector. The agent’s reward structure is tied directly to its ability to modify the level to match the conditions extracted from the text. The framework was evaluated across five specific generation tasks: Region (number of distinct areas), Path Length, Wall Count, Bat Count, and Bat Direction.

Experimental Setup

The researchers utilized a modified version of the Dungeon environment, a 2D grid-based benchmark for level generation. The study involved:

  • Instruction Dataset: A custom dataset comprising 80 single-task instructions (e.g., "A few regions are present") and 256 multi-task instructions (e.g., "Extended path length, a substantial number of monsters").
  • Offline State Buffer: A collection of 86,000 game states used to pre-train the instruction encoder’s fitness-prediction capabilities.

Key Results and Insights

Enhanced Controllability and Generalization

IPCGRL demonstrated significant performance gains over baseline models using standard BERT embeddings ($z_{bert}$):

  • Controllability: The use of $z_{enc}$ resulted in a 21.4% improvement in progress toward target goals.
  • Generalization: On "Near Out-of-Distribution" (Near-OOD) instructions—sentences the model had not seen during training but which utilized similar logic—the task-specific model achieved a 17.2% performance boost.

Parity with Scalar Inputs

One of the most notable findings was that the text-based IPCGRL performed nearly as well as traditional models receiving direct numerical targets. This suggests that natural language can serve as a precise control mechanism for PCG, provided the encoding process effectively filters the input for task-specific relevance.

Limitations and Future Directions

While IPCGRL excels at single-task instructions, multi-tasking (e.g., simultaneously optimizing for path length and enemy density) remains a challenge. The current architecture's reliance on a single output node for the encoder limits its ability to resolve competing objectives. Future work may involve moving toward multi-label decoders to handle complex, overlapping instructions.

Additionally, the current scope is limited to 2D grid worlds. Scaling the framework to 3D environments or more complex genres, such as RPGs or FPS levels, represents the next frontier for language-instructed generation. The authors also envision expanding the system into a multi-modal "creator assistant" that incorporates visual sketches and icons alongside text instructions.

Summary updated

BibTeX
@inproceedings{baek2025ipcgrl,
  author = {In-Chang Baek and Sung-Hyun Kim and Seo-Young Lee and Dong-Hyeon Kim and Kyung-Joong Kim},
  title = {{IPCGRL: Language-Instructed Reinforcement Learning for Procedural Level Generation}},
  booktitle = {CoG},
  year = {2025},
}
Figure