Introduction
State-of-the-art reinforcement learning (RL) agents, such as AlphaZero and MuZero, have demonstrated remarkable capabilities in complex domains. However, these systems often function as "black boxes" where various components—neural network models, search algorithms, policies, and loss functions—are tightly coupled. This complexity introduces significant hurdles for researchers, primarily in the form of "silent failures" where bugs do not trigger explicit errors, and a lack of flexibility that makes swapping components difficult.
To address these challenges, this research introduces a modular software architecture for model-based reinforcement learning (MBRL). This framework allows for "plug-and-play" experimentation, enabling a systematic study of how different combinations of planning, policy, and loss functions perform across diverse environments.
The Modular Architecture
The core contribution of this work is a framework that decomposes an RL agent into six independent modules. This separation of concerns allows researchers to isolate the effects of specific algorithms and reduces technical debt by decoupling search logic from learning objectives.
The six modules are:
- Environment: The specific task or simulation.
- Model: The agent's internal representation of world dynamics, rewards, and legal action masks.
- Planning: The search algorithm (e.g., MCTS, Minimax) used for look-ahead.
- Policy: The mechanism for selecting the final action based on the generated plan.
- Data: The infrastructure for experience storage and transport.
- Loss: The mathematical objective used to optimize the model.
Averaged Minimax
A notable addition to the planning module is the averaged minimax algorithm. Unlike traditional minimax, which focuses solely on the optimal branch, averaged minimax calculates state values by averaging all legal successor states. This approach provides a smoother value representation during the search process, which can be more robust in certain environments.
Experimental Methodology
The architecture was evaluated across three distinct benchmarks, each presenting unique RL challenges:
- Cartpole: A continuous state-space control problem with dense rewards.
- Minigrid: A partially observable grid world characterized by sparse rewards.
- Tictactoe: A discrete two-player game requiring the learning of "legal action masks" to avoid illegal moves.
Key Results and Analysis
The experiments revealed that there is no universal "best" configuration; rather, the optimal combination of modules is highly environment-dependent.
Performance Highlights
- Cartpole: Surprisingly, the simple Averaged Minimax algorithm outperformed the more complex Monte Carlo Tree Search (MCTS), achieving a mean score of 429.6 compared to 311.5 for MCTS. The best configuration utilized Offline Temporal Difference (TD) learning and an $\epsilon$-value greedy policy.
- Minigrid: MCTS remained the superior choice for this environment, likely due to its effectiveness in navigating sparse reward structures. The optimal setup combined MCTS with a Monte Carlo loss.
- Tictactoe: The agent achieved near-perfect play against an expert bot using a combination of Best First Minimax (BFMMS), Offline TD, and a Visit Distribution policy.
The Importance of Action Masking
A critical finding was the effectiveness of the "base agent" in learning to predict legal actions directly. By incorporating a "mask" for legal moves, search algorithms can immediately prune illegal branches, significantly enhancing efficiency in discrete games like Tictactoe.
Conclusion
This research underscores the necessity of problem-specific tuning in reinforcement learning. By providing a modular framework, the authors have created a tool that simplifies the debugging process and accelerates the exploration of novel algorithm combinations. Future work will focus on extending this architecture to stochastic environments and integrating more advanced classical search algorithms like A* into the planning module.
Citation: Oliveira, T. G., & Oliveira, A. L. (2022). Assessing Policy, Loss and Planning Combinations in Reinforcement Learning using a New Modular Architecture. arXiv:2201.02874v1 [cs.LG].
Summary updated