Abstract
Nested Rollout Policy Adaptation (NRPA) has proven effective for solving complex combinatorial optimization problems and single-player games. However, its standard formulation lacks the flexibility to incorporate domain-specific heuristics and lacks a mechanism to tune the sharpness of the probability distribution during move selection. This paper introduces Generalized Nested Rollout Policy Adaptation (GNRPA), which generalizes the NRPA framework by adding a temperature parameter ($\tau$) and a heuristic bias ($\beta$). We provide a theoretical derivation of the gradient descent update rule for GNRPA and introduce memory-efficient optimizations. Our evaluation on SameGame and the Traveling Salesman Problem with Time Windows (TSPTW) shows that GNRPA achieves superior performance and faster convergence compared to the original NRPA.
Introduction
In the realm of combinatorial optimization and puzzle-solving, finding an optimal sequence of moves in a vast search space is a fundamental challenge. Nested Rollout Policy Adaptation (NRPA) has emerged as a powerful Monte Carlo search algorithm for these tasks, particularly in domains like RNA folding and logistics. NRPA works by iteratively learning a policy—represented as a set of weights for possible moves—that converges toward the best sequence discovered during the search.
Despite its success, NRPA faces two primary hurdles. First, it typically begins with a "blank slate," ignoring potential domain-specific heuristics that could guide the search in highly constrained environments. Second, it utilizes a fixed softmax function for move selection, which prevents researchers from adjusting the balance between exploration and exploitation. This paper addresses these limitations through the Generalized Nested Rollout Policy Adaptation (GNRPA) framework.
The GNRPA Framework
GNRPA modifies the core probability formula used by NRPA to select moves. In the standard algorithm, the probability of choosing a move is determined by the exponent of its weight. GNRPA introduces two critical parameters:
- Temperature ($\tau$): The probability of selecting a move is calculated using $e^{weight/\tau}$. By adjusting $\tau$, the algorithm can control the "softness" of the probability distribution. A higher temperature encourages broader exploration by flattening the distribution, while a lower temperature makes the selection more "greedy," focusing on moves with higher weights.
- Bias ($\beta$): A heuristic bias term is added to the exponent. This allows the integration of external knowledge—such as "preferring larger groups" in a puzzle or "shorter distances" in a routing problem—directly into the selection process.
Theoretical and Algorithmic Contributions
A key contribution of this work is the theoretical derivation of the gradient descent update rule for this generalized policy. This ensures that the learning process remains mathematically sound despite the added complexity of temperature and bias.
Furthermore, the paper introduces an optimized version of the "Adapt" algorithm. In standard NRPA, updating the policy often involves copying large arrays, which can become a significant computational bottleneck in memory-intensive domains. GNRPA optimizes this by batching updates and reducing redundant memory operations, allowing for a higher number of rollouts within the same time constraints.
Experimental Evaluation
The efficacy of GNRPA was tested on two distinct benchmarks: SameGame and the Traveling Salesman Problem with Time Windows (TSPTW).
SameGame
SameGame is a tile-matching puzzle where the objective is to maximize points by clearing groups of adjacent blocks of the same color. In this domain, GNRPA utilized a bias ($\beta$) based on color dominance and the size of the block groups. The results indicated that GNRPA with bias (GNRPA.beta) consistently outperformed the standard NRPA. When combined with memory optimizations (GNRPA.beta.opt), the algorithm achieved even higher scores, as the increased efficiency allowed for a more thorough exploration of the state space.
Traveling Salesman Problem with Time Windows (TSPTW)
TSPTW is a complex logistics problem where a salesman must visit a set of cities within specific time constraints. This problem is notoriously difficult for standard NRPA, which often fails to find valid tours, resulting in heavy penalties. By applying a distance-based bias and tuning the temperature to $\tau = 1.4$, GNRPA was able to find high-quality, valid tours much more reliably. The finding that $\tau = 1.4$ performed better than the standard $\tau = 1.0$ suggests that the original NRPA may be too prone to getting stuck in local optima.
Discussion
The research provides several important insights into the behavior of Monte Carlo search algorithms:
- Bias as Initialization: Mathematically, adding a bias term is equivalent to initializing the weights of the moves. However, in games with massive or dynamic state spaces, implementing a dynamic bias formula is often more practical than attempting to initialize a near-infinite weight table.
- The Importance of Tuning: The success of the temperature parameter highlights that the "one-size-fits-all" approach of standard softmax is suboptimal for many complex problems.
- Efficiency and Search Depth: The performance gains from the optimized Adapt algorithm underscore that algorithmic efficiency is as crucial as the search strategy itself, especially when dealing with large-scale optimization.
Conclusion
Generalized Nested Rollout Policy Adaptation represents a significant step forward for Monte Carlo search techniques. By providing a framework to incorporate heuristics and tune exploration, GNRPA offers a more robust and flexible tool for solving difficult combinatorial problems. While the design of effective bias formulas remains a domain-specific challenge, the results on SameGame and TSPTW demonstrate the clear advantages of this generalized approach. Future work will focus on automating the discovery of these heuristics and exploring the application of GNRPA to even broader classes of optimization problems.
Summary updated