Sliding Puzzles Gym: A Scalable Benchmark for State Representation in Visual Reinforcement Learning

Bryan Lincoln Marques de Oliveira, Bruno Brandão, Murilo Lopes da Luz, Luana Guedes Barros Martins, Telma Woerle de Lima Soares, Luckeciano Carvalho Melo

TL;DR

This paper introduces the Sliding Puzzles Gym (SPGym), a novel benchmark designed to isolate and evaluate the visual representation learning capabilities of reinforcement learning (RL) agents. By decoupling visual complexity from task dynamics, SPGym allows for a more precise assessment of how well agents can extract meaningful information from raw pixel inputs, revealing limitations in current methods when faced with increasingly complex visual environments.

What Problem Does This Paper Address?

Reinforcement learning agents often need to learn from raw visual inputs, like images from a camera. This requires them to first learn to "see" and understand what's in the image – a process called representation learning – before they can learn how to act to achieve a goal. However, most existing RL benchmarks entangle representation learning with other learning tasks, like policy optimization (learning to act) and dynamics modeling (learning how the world works). This makes it difficult to pinpoint how well an agent is specifically learning good visual representations, independent of its other learning abilities. The authors aim to solve this by creating a benchmark that specifically targets and scales the visual representation learning challenge.

Methods

The core of the paper is the introduction of the Sliding Puzzles Gym (SPGym). SPGym is an extension of the classic 15-tile sliding puzzle. The key innovation is that it allows for:

  • Scalable Visual Complexity: Instead of using simple numerical states, SPGym uses image-based tiles. The complexity can be increased by using larger "pools" of diverse images (e.g., from ImageNet) that are overlaid onto the puzzle tiles. This means the underlying puzzle mechanics remain simple and fixed, but the visual input becomes progressively harder to interpret.
  • Fixed Environment Dynamics: The rules of the puzzle (how tiles slide) and the reward structure are kept constant, ensuring that any performance differences are attributable to representation learning, not changes in the task itself.
  • Variable Grid Sizes: While the paper focuses on 3x3 grids, the framework supports variable grid sizes, further increasing the potential for scaling difficulty.

The authors evaluate both model-free (like PPO) and model-based (like DreamerV3) RL agents on SPGym. They also test variants of these agents, including PPO agents with pretrained encoders and DreamerV3 agents with their decoder's gradients turned off, to specifically assess the impact of representation learning components.

Datasets

The paper uses images from the validation split of the ImageNet-1k dataset for creating the visual observations in SPGym. The SPGym benchmark itself is dataset-agnostic, meaning it can be used with any image dataset, including procedurally generated images, for future research.

Key Insights and Ideas

  • SPGym effectively isolates representation learning: The benchmark successfully differentiates agents based on their ability to learn visual representations, showing a clear performance gap between agents with and without strong representation learning components.
  • Model-based agents generally excel: Agents like DreamerV3, which incorporate explicit mechanisms for representation learning (like autoencoders), tend to outperform simpler model-free agents like PPO, especially as visual complexity increases.
  • Current methods still struggle with high visual complexity: Even advanced agents like DreamerV3 show a decline in sample efficiency as the image pool size grows, indicating that current representation learning techniques are not yet fully robust to highly diverse and complex visual inputs.
  • Pretraining is beneficial for model-free agents: Using pretrained encoders significantly boosts the performance of PPO agents, even if the pretraining was on different image pools, highlighting the value of transferable visual features.

Key Results

The paper presents results showing that as the image pool size increases, the number of environment samples required to solve the puzzle generally increases for all tested agents. Specifically:

  • DreamerV3 consistently outperforms PPO: In most scenarios, DreamerV3 agents achieve higher success rates with fewer samples compared to PPO agents.
  • Increasing image pool size degrades performance: Figure 4 shows a clear trend where larger image pools lead to lower success rates for a given number of steps for both PPO and DreamerV3. For instance, with an image pool size of 100, both agents require significantly more steps to reach a comparable success rate compared to a pool size of 1.
  • No single algorithm consistently excels at the highest difficulty: The authors note that SPGym reaches difficulty levels where no tested algorithm consistently achieves top performance, underscoring the challenge.

Limitations and Future Work

Limitations: * The experiments did not include agents specifically designed for representation learning (e.g., DARLA, CURL, RAD, DrQ, CBM, CycAug). Future work should evaluate how SPGym ranks these specialized agents. * Due to computational costs, a higher number of seeds was not used, which might affect the statistical robustness of the results, especially given the potential stochasticity of the environment and image sampling.

Future Work: * Extend SPGym to other data modalities beyond visual inputs, such as text, to study how agents handle diverse input types. * Investigate in- and out-of-distribution generalization by training agents and encoders on specific image pools and testing them on unseen or novel data classes. * Integrate curriculum learning into SPGym, starting with simpler puzzles and gradually increasing difficulty, to facilitate more systematic learning. * Explore the use of diffusion models to generate new image datasets on the fly, further enhancing SPGym's scalability and utility.

Summary updated

Abstract

Learning effective visual representations is crucial in open-world environments where agents encounter diverse and unstructured observations. This ability enables agents to extract meaningful information from raw sensory inputs, like pixels, which is essential for generalization across different tasks. However, evaluating representation learning separately from policy learning remains a challenge in most reinforcement learning (RL) benchmarks. To address this, we introduce the Sliding Puzzles Gym (SPGym), a benchmark that extends the classic 15-tile puzzle with variable grid sizes and observation spaces, including large real-world image datasets. SPGym allows scaling the representation learning challenge while keeping the latent environment dynamics and algorithmic problem fixed, providing a targeted assessment of agents' ability to form compositional and generalizable state representations. Our experiments with both model-free and model-based RL algorithms, with and without explicit representation learning components, show that as the representation challenge scales, SPGym effectively distinguishes agents based on their capabilities. Moreover, SPGym reaches difficulty levels where no tested algorithm consistently excels, highlighting key challenges and opportunities for advancing representation learning for decision-making research.
BibTeX
@inproceedings{oliveira2025sliding,
  author = {Bryan Lincoln Marques de Oliveira and Bruno Brandão and Murilo Lopes da Luz and Luana Guedes Barros Martins and Telma Woerle de Lima Soares and Luckeciano Carvalho Melo},
  title = {{Sliding Puzzles Gym: A Scalable Benchmark for State Representation in Visual Reinforcement Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=vlF9bZHrJg},
}
Figure