What Matters in Hierarchical Search for Combinatorial Reasoning Problems?

## Abstract

Abstract Efficiently tackling combinatorial reasoning problems, particularly the notorious NP-hard tasks, remains a significant challenge for AI research. Recent efforts have sought to enhance planning by incorporating hierarchical high-level search strategies, known as subgoal methods. While promising, their performance against traditional low-level planners is inconsistent, raising questions about their application contexts. In this study, we conduct an in-depth exploration of subgoal-planning methods for combinatorial reasoning. We identify the attributes pivotal for leveraging the advantages of high-level search: hard-to-learn value functions, complex action spaces, presence of dead ends in the environment, or using data collected from diverse experts . We propose a consistent evaluation methodology to achieve meaningful comparisons between methods and reevaluate the state-of-the-art algorithms.

## 1 Introduction

Many real-world tasks involve underlying abstract structures that capture their complexity. For example, robotic navigation can be efficiently modeled as a graph search problem, enabling optimal path planning and execution within complex environments [, ]. Similarly, sequence alignment in bioinformatics can be effectively modeled as a graph of alignment positions and pathways, facilitating the identification of similarity regions [, ]. Hence, addressing these problems in discrete environments, which demand intricate reasoning and include numerous NP-hard problems, is crucial for advancing AI [].

Tackling these challenges requires efficient planning strategies []. A recent, promising approach to planning uses subgoals to decompose complex tasks into sequences of simpler steps, drawing inspiration from how humans plan their actions [, , ]. Hierarchical planning was successfully applied to tasks with high combinatorial complexity by Subgoal Search (kSubS) [], followed by other algorithms, including Adaptive Subgoal Search (AdaSubS) [], Hierarchical Imitation Planning with Search (HIPS) [], and HIPS-$\varepsilon$ []. These methods take high-level steps, which are commonly believed to scale better to longer horizons [, ], bypass errors in value approximations [] and reduce complexity by decomposing the problem into subtasks [, ].

*While subgoal methods have demonstrated strong results in the literature, our findings reveal that classical, low-level search algorithms can perform at least equally well in certain domains*. Thus, it remains an open question in which settings subgoal-based methods should be applied to leverage their advantages.

In this work, we present a comprehensive study exploring how the choice of environments and training data impacts subgoal-based methods for combinatorial reasoning problems. To the best of our knowledge, this is the first systematic study to investigate this relationship. We identify key attributes that enable leveraging the advantage of high-level search: *hard-to-learn value functions*, *complex action spaces*, *the presence of dead ends in the environment*, and *the use of data collected from diverse experts*. Additionally, our experiments reveal several evaluation pitfalls that are easy to overlook but can lead to misleading conclusions. To address these issues, we propose a consistent evaluation methodology that allows meaningful comparisons between various methods.

In summary, our contributions are as follows:

- •
We identify the key properties of environments and datasets that impact the performance of subgoal-based methods.
- •
We analyze the suitability of Hierarchical Reinforcement Learning (HRL) algorithms for combinatorial reasoning and list the necessary attributes.
- •
We highlight critical points for reporting reliable results in this domain, such as reporting success rates for the entire search budget.

## 2 Related Work

Classical reinforcement learning (RL) algorithms, such as Proximal Policy Optimization (PPO) [] and Deep Q-Network (DQN) [], are designed to solve problems modeled as Markov Decision Processes (MDPs) []. Recently, there has been a surge in research leveraging large datasets of demonstrations [, , , ] to learn and solve complex real-world decision-making tasks using Imitation Learning (IL) techniques. These methods, including Behavioral Cloning (BC) [, , ], Inverse Reinforcement Learning [], and DAgger [], aim to mimic expert actions provided in datasets.

Subgoal-based methods decompose complex tasks into manageable subgoals, streamlining the solution of complex MDPs. HIRO [] leverages offline data by relabeling past transitions. HAC [] learns a hierarchy of high-level policies using hindsight []. Graph-based search methods, such as SoRB [] or DHRL [], construct a high-level graph of the state space, enabling fast searches for arbitrary goals. Hierarchical Diffuser [] generates action plans at various timescales using a diffusion model []. HIPS [] employs Policy-guided Heuristic Search [] to navigate between subgoals generated by VQ-VAE models []. HIPS-$\epsilon$ [] combines high-level and low-level planning to ensure completeness of the search.

Recently, kSubS [] was introduced as a hierarchical search algorithm for combinatorial domains. To solve the given task, it iteratively constructs a search tree consisting of achievable subgoals. In each iteration, the $k$-subgoal generator predicts states that are $k$ steps closer to the solution, after which the low-level policy computes paths to these subgoals. Nodes are expanded based on a best-first strategy guided by the value function predictions. All components of kSubS are trained on offline datasets using imitation learning.

AdaSubS [] builds on kSubS by adding multiple subgoal generators trained to output subgoals at various distances. During the planning phase, AdaSubS prioritizes long-distance subgoal generators, retracting to shorter if the search becomes locally stuck. This way, AdaSubS dynamically adjusts its planning strategy based on the difficulty of the current search region.

Classical search algorithms are widely used to solve hard decision-making problems [, , , , , , ]. Best-First Search (BestFS) prioritizes states with the highest predicted values, often using policy to select actions based on top-ranked choices or cumulative confidence thresholds []. A* improves upon BestFS by combining value estimates with distances from the root state, enabling more efficient exploration. MCTS [] builds an asymmetric tree to estimate action values through random simulations, precisely choosing the most promising action. Monte Carlo Tree Search (MCTS) [] builds an asymmetric tree to estimate action values through random simulations, selecting the most promising actions precisely. Combining MCTS with deep neural networks has led to breakthroughs like AlphaGo and AlphaZero [, ].

## 3 Preliminaries

### 3.1 Combinatorial environments and algorithmic desiderata

The abstract structure of real-world tasks captures the essence of reasoning. Therefore, our study targets solving discrete combinatorial reasoning environments, a category that includes many NP-hard problems, such as the Traveling Salesman Problem [], the Knapsack Problem [], the Rubik’s Cube [], or the Sudoku []. Specifically, in our experiments, we use the Rubik’s Cube, Sokoban, N-Puzzle, and Inequality Theorem Proving (INT) []. These are classical benchmarks, explored in various planning works [, ], and are known to be NP-hard [, , ]. Descriptions of these environments are in Appendix A.

The combinatorial reasoning environments are typically characterized by an enormous space of possible configurations, making learning without priors or handcrafted dense rewards prohibitively challenging(^1^11For instance, we trained a PPO [] agent to solve the Rubik’s Cube, but, unsurprisingly, it failed to make any progress due to never reaching the goal in the haystack of $4.3\times 10^{19}$ states, hence never observing a positive reward. This would be the case for any algorithm that learns goal-reaching.) Similarly, the space complexity usually limits the number of configurations that can be observed in training. Hence, the solver cannot expect that it will eventually visit a closely located state again, which is essential for methods like [, , ]. Therefore it follows that the following conditions are necessary for an algorithm to be efficient in solving combinatorial problems:

- 1.
Learning from offline demonstrations Finding a solution through exploration is prohibitively hard in combinatorial environments. Thus, the algorithm has to be able to learn from demonstrations.
- 2.
Generalization The algorithm will typically visit a given state only once, so it needs to generalize well across the state space.
- 3.
Planning The algorithm needs a planning module as it cannot scale in solving NP-hard problems [] within a fixed computation budget.

Standard hierarchical methods have not been specifically designed for combinatorial problems and, thus, fail to meet the necessary conditions for effective application. For instance, [, ] require continuous state or action space, [] learns from online interactions, [, , ] assume a good coverage of the whole state space, and [, ] do not use planning to determine actions.

### 3.2 Subgoal methods

Subgoal methods perform planning with high-level steps composed of multiple actions.
This high-level guidance may take various forms. We consider subgoal methods characterized by the following components:

- •
Subgoal generator that, given a state, outputs subgoals to achieve. That may be a future state, a class of desired outcomes, or any other form of high-level guidance.
- •
Low-level policy that determines low-level paths between subgoals. It may be a trained goal-reaching policy [, ], a local search [, ], a stored path from previous episodes [, ].
- •
Planner that determines the order of generating subgoals. Usually, standard planners, e.g., BestFS [], PHS [], or their modified forms [], are repurposed for this goal.
- •
Value function that estimates the distance to the solution.

In this work, we will study kSubS and AdaSubS as subgoal methods suitable for combinatorial problems. We also considered HIPS, HIPS-$\varepsilon$, but found them impractical (see Appendix I for details). For reporting, we use the notation kSubS-$n$ to indicate that the subgoal generator was trained for distance $n$. Similarly, AdaSubS-$a$+$b$+$c$ indicates using a set of generators trained for distances $a$, $b$, and $c$.

We compare the performance of subgoal search methods with three widely used low-level algorithms: BestFS, A*, and MCTS. Detailed description, analysis, and pseudocode for each of those low-level algorithms are provided in Appendix F.

## 4 Analysis

In this work, we aim to establish a solid empirical foundation for developing subgoal-based search algorithms tailored to combinatorial reasoning problems. To this end, we pose the following fundamental questions:

- Q1.
Are hierarchical search algorithms indeed proficient in solving combinatorial problems?
- Q2.
In which environments do hierarchical search algorithms offer an advantage over traditional low-level search strategies? Can we identify specific properties that make an environment amenable to high-level search?
- Q3.
How should we select the baselines for a fair comparison? What common mistakes should be avoided when reporting experimental results?

To address these questions, we extensively analyze the algorithms and combinatorial reasoning environments. Each experiment is described starting with its motivation, followed by the presentation of our experimental results, and concluding with concise takeaways.(^2^22The code used to run the experiments can be accessed via the following link: [github.com/subgoal-verification/what-matters-in-hierarchical-search](github.com/subgoal-verification/what-matters-in-hierarchical-search).)

##### Experimental setup

For each experiment, we generate a dataset of approximately $5\times 10^{5}$ solving trajectories. We train the components for each method through imitation learning. Whenever possible, components are shared between algorithms; for instance, all tested algorithms use the same value function. For clarity, we present only the best-performing variants of each method. Tuning the parameters is discussed in Appendix F.

Our primary metric, success rate, is the percentage of solved instances calculated across a set of $500$ instances in a given environment. The success rate depends on the search budget, which is the total number of states visited during the search, including both the subgoals and the low-level steps.

The costs associated with this metric arise from two main sources: generating subgoals and filling low-level paths, each requiring network calls. Therefore, we argue that reporting all search nodes is essential. For instance, a generator might produce a subgoal that is 10 steps ahead of the current state, but reaching this subgoal could be highly costly due to the associated reaching expenses. However, it would be hidden by the other metric only for subgoal methods. A further discussion of this decision is presented in Section 4.3.1.

### 4.1 Rubik’s Cube

#### 4.1.1 Verifying experimental outcomes

##### Motivation

Learning to solve the Rubik’s Cube is hard, even for humans. [, ] report that both kSubS and AdaSubS can solve it, while the low-level BestFS struggles. We want to verify these claims and understand the reasons behind them.

##### Experimental Results

Following [], each method was trained on trajectories obtained by shuffling the cube with $20$ random moves and reversing it. As shown in Figure 2, every tested method solves the environment nearly perfectly. AdaSubS is the most effective when using smaller search budgets, while BestFS takes the lead for larger budgets. A* performs similarly to BestFS, but MCTS is not effective. Thus, using subgoals in this setting is not helpful.
This contrasts with the results presented in [, ]. Firstly, the low-level algorithms successfully solve the task. Secondly, each subgoal method requires about three times smaller computational budget than reported in [].

For this study, we reimplemented and trained the components from scratch, with some technical modifications, such as model size, architecture, and hyperparameters, and using up-to-date libraries. We also noticed that BestFS is very sensitive to the quality of its components and hyperparameters (see Appendix F for details). That may explain the substantial difference in performance.

##### Takeaway

##### Takeaway

#### 4.1.2 Learning from diverse experts

##### Motivation

Subgoal methods are considered more effective for long-horizon planning problems [] and are believed to reduce noise in training data []. To verify these properties, we trained the algorithms to solve the Rubik’s Cube using a dataset composed of various sources: human-oriented Beginner and CFOP, computational Kociemba, and the random solutions used in Section 4.1.1. The first two solvers solve the cube layer by layer; hence, their trajectories are long and composed of high-level subroutines. The remaining two usually find much shorter solutions (see Appendix B.2 for examples).

##### Experimental Results

When training on data from diverse experts, the subgoal methods (particularly AdaSubS) outperform the low-level search by a wide margin (see Figure 2). Notably, despite using strongly suboptimal and diverse data, AdaSubS and kSubS can solve the most challenging instances within an even smaller budget than in the previous experiment. On the other hand, all low-level methods perform much worse than in the previous experiment. Additionally, we observe that given lengthy demonstrations, increasing the subgoal distance for kSubS improves performance, unlike in Section 4.1.1 with short trajectories.

We attribute the observed performance gap to the noise in the value function estimates. Specifically, it fails to consistently assign low values to fully scrambled cubes and nearby states. This issue arises because both Beginner and CFOP yield solutions that are even five times longer than those of the other solvers. Subgoal algorithms are, to some degree, robust to this noise, as claimed by []. By taking longer steps, they can leap over the faulty value function. A detailed analysis of this behavior is provided in Appendix B.2.

##### Takeaway

Figure: Figure 1: Solving the Rubik’s Cube. Components are trained on reversed random shuffles.
Refer to caption: x1.png

##### Takeaway

#### 4.1.3 Structure in demonstrations

##### Motivation

While Section 4.1.2 showcases an advantage of subgoal methods, it is still unclear which property of the environment contributes the most to it. We conjecture that the key factor is the diversity of training data, which makes the value estimation problem hard. To verify this, we use training data collected from a single algorithmic solver – Beginner.
Unlike in the previous experiment, no other expert is used.
Therefore, the training data, although not optimal, becomes unambiguous.

Figure: Figure 3: Solving the Rubik’s Cube. Components are trained on the Beginner algorithmic solver.
Refer to caption: x3.png

##### Experimental Results

After removing the variance from demonstrations by switching to Beginner, the performance of AdaSubS and BestFS becomes nearly identical, as illustrated in Figure 4. Similarly, the performance of A* closely matches that of kSubS. MCTS shows significant improvement over previous experiments, though it still lags behind other methods. Longer subgoals continue to outperform shorter ones, but extending them beyond a distance of four offers no additional benefits. Furthermore, a comparison with the results in Section 4.1.2 reveals that the performance of subgoal methods remains consistent whether using single or multiple sources of demonstrations.

Importantly, we found that in order to achieve good performance, BestFS requires careful tuning. It achieves its best results when, at each expansion, we select actions that collectively exceed $70\%$ confidence. Additionally, we found that its performance is highly sensitive to this hyperparameter (see Appendix F). Adopting the approach recommended by [, ] of selecting a fixed number of actions leads to highly suboptimal outcomes, as demonstrated by the poorly performing agent in Figure 4, BestFS-top-2.

##### Takeaway

##### Takeaway

#### 4.1.4 Robustness to noisy value function

##### Motivation

The advantage of subgoal methods observed in Section 4.1.2 does not primarily come from long or structured demonstrations. However, high-level algorithms show surprisingly consistent performance regardless of the training data, as demonstrated in Sections 4.1.1-4.1.3. That observation hints that the subgoal methods are resilient to noise in the training data. To verify that proposition, we take the components trained as in Section 4.1.1 and add artificial Gaussian noise to each output of the value function.

##### Experimental Results

As shown in Figure 4, while the standard BestFS can solve nearly all instances, its performance heavily depends on the quality of the learned value function. In a similar way, the noisy values strongly impact the performance of A* and MCTS. However, kSubS is much more resilient when using subgoals longer than a single step. Even with completely random values ($\sigma=100$), it successfully solves about $40\%$ instances. Moreover, AdaSubS is barely affected by the noise at all.
That confirms the claim of [] that subgoals successfully leap over value noise.

As noted in [], the search performed by the subgoal methods is strongly guided by the subgoal generators, which considerably reduces the reliance on the value function. A more detailed analysis of this experiment can be found in Appendix B.3.

##### Takeaway

##### Takeaway

### 4.2 INT

#### 4.2.1 Scaling to complex mathematical reasoning

##### Motivation

We aim to explore whether subgoal methods can more effectively scale to complex real-world applications than low-level methods, as suggested in [, ]. To this end, we consider the INT environment [], which involves solving inequalities. It is the most challenging among the environments studied in [, , , ], both in terms of observations and actions complexity.

##### Experimental Results

Our experiments show a clear advantage of subgoal methods compared to low-level search on INT, as shown in Figure 6. We note that we use the proofs length of $25$, which is a more challenging setup than typically used.

##### Takeaway

##### Takeaway

#### 4.2.2 Complex action space

##### Motivation

We conjecture that the result of the previous experiment is due to the high complexity of the action space compared to the state space. This suggests that state-based subgoals may be more effective in such settings than action-based policy guidance. To further investigate this in a controlled setting, we inflate the action space of the Rubik’s Cube by a factor of $100$ by creating $100$ copies of each original action.

##### Experimental Results

As shown in Figure 6, the low-level search methods stuck below $30\%$ success rate, while the subgoal methods perform comparably to the standard cube case from Section 4.1.1. We could expect that since, given so many similar actions, the low-level search nearly trivializes. Although the subgoal methods also use a low-level policy for connecting the subgoals, it always follows a single path towards the subgoal, so it is barely affected. A more detailed analysis can be found in Appendix B.4.

##### Takeaway

Figure: Figure 5: Solving INT. Components are trained on randomly generated proofs of length $25$.
Refer to caption: x5.png

##### Takeaway

### 4.3 Sokoban

#### 4.3.1 Importance of budget measures

##### Motivation

Given that Sokoban is PSPACE-complete [], it presents a challenging testbed for AI planning algorithms. [] reports that AdaSubS outperforms BestFS in Sokoban. They also report that kSubS surpasses BestFS only, given a relatively high search budget. Some works use the number of high-level nodes visited during the search as the search budget []. This contrasts with the total number of visited nodes (the main metric in this paper). We aim to show how this difference affects the interpretation of the results and propose recommendations for reporting the search budget. For these experiments, each method was trained on a dataset containing trajectories collected by an external RL agent.

##### Experimental Results

Figure 8 shows that reporting only the high-level nodes excessively enhances subgoal methods’ scores. AdaSubS and kSubS seem absolutely superior to BestFS despite the last two algorithms visiting a similar number of states during the search. Hence, that way of reporting the results would lead to erroneous conclusions about the strong primacy of subgoal methods, and we recommend using the total number of visited states as the search budget.

##### Takeaway

Figure: Figure 7: Comparison of the fraction of dead-ends encountered during the problem-solving process between subgoal-based and low-level searches.
Refer to caption: x7.png

##### Takeaway

#### 4.3.2 Dead-ends

##### Motivation

We call a state a dead-end if it is impossible to reach the goal from it. They pose an additional challenge as an algorithm must quickly recognize dead-ends to abandon the search in hopeless state-space regions. We investigate how the subgoal and low-level methods handle dead-ends.

##### Experimental Results

Table 8 indicates that subgoal methods, especially those involving longer subgoals, notably reduce the likelihood of stacking in dead-ends. We conjecture that this effectiveness stems mainly from relying less on value function guidance than low-level methods, as detailed in Section 4.1.4 and supported by []. For further analysis, refer to Appendix B.1.

##### Takeaway

##### Takeaway

### 4.4 N-Puzzle

##### Motivation

The N-puzzle, also known as the Sliding Tile Puzzle, is a classic benchmark in the search literature [, , ] and is known to be NP-hard []. It was used to evaluate subgoal methods in [, ]. Despite its large state space, the N-puzzle is highly structured, allowing for solving very simple suboptimal strategies. We aim to determine whether subgoal techniques offer an advantage over low-level search methods in this environment.

##### Experimental Results

To generate the training dataset for this experiment, we employed a sub-optimal algorithm that orders the tiles in ascending order, starting with "$1$" and continuing through "$2$", "$3$", and so on (details in Appendix A).

Figure: Figure 9: Solving the N-Puzzle. The success rates of BestFS, A*, and BC policy throughout all budgets match nearly perfectly.
Refer to caption: x8.png

A simple policy trained with behavioral cloning (BC) perfectly solves the environment, even without using search, see Figure 9. This indicates that learning from structured demonstrations is relatively straightforward. Notably, AdaSubS surpassed BC, indicating that this subgoal approach improved the cloned sub-optimal behavior. Furthermore, kSubS, BestFS, and A* perform similarly to the BC policy, showcasing no computational waste.

##### Takeaway

##### Takeaway

## 5 Open questions and future directions

While we identified several features that facilitate the performance of subgoal methods, that list is not exhaustive. Thus, it is essential to study this topic further, expand the analysis to more subgoal-based and low-level algorithms, and include even more types of environments. Additionally, our work provides mostly experimental validation of the claims. Finding theoretical foundations for the observed properties would also be a valuable direction.

## 6 Conclusions

We conducted a thorough comparison of subgoal-based and low-level search algorithms for combinatorial reasoning tasks. Our experiments indicate that hierarchical approaches excel in environments where value estimation is challenging and learned estimates face significant uncertainty, particularly when learning from various suboptimal experts. Furthermore, subgoal methods demonstrate better scalability in complex action spaces and are more effective at avoiding dead ends than low-level methods. Thus, in environments characterized by those properties, it is advisable to consider subgoal-based methods.

According to our experiments, the best-performing low-level search was usually BestFS with a confidence threshold. Although it is rather sensitive to the threshold value, which has to be optimized for each domain separately, we advocate using it as a standard baseline for further research in hierarchical search.

Finally, we identified a few easy-to-overlook mistakes in reporting the results that may lead to misleading conclusions. Most importantly, the reported search budget of the hierarchical methods must include all the visited states and not only the high-level nodes as used in some prior works.

## Acknowledgement

We gratefully acknowledge Polish high-performance computing infrastructure PLGrid (HPC Center: ACK Cyfronet AGH) for providing computer facilities and support within computational grant no. PLG/2023/016604.

## Appendix A Environments

Sokoban Sokoban is a classic puzzle game where the objective is to push boxes onto target locations within a confined space. It is a popular testing ground for classical planning methods and deep-learning approaches due to its combinatorial complexity and difficulty in finding solutions. Recognized as a PSPACE-hard problem, Sokoban is used to evaluate different computational strategies. Our experiments use 12 × 12 Sokoban boards with four boxes to assess the performance of our proposed models. An illustrative example of a simple Sokoban search tree with a solving path is shown in Figure 10.

Figure: Figure 10: Hierarchical Search applied to solving Sokoban. This tree, depicted in figures, employs bolded green arrows to highlight selected subgoals within a hierarchical search framework earmarked for subsequent exploration. The illustration demonstrates that these intermediate goals exhibit variability in terms of both their spatial distance and the methodology by which a planning algorithm may leverage them.
Refer to caption: extracted/5790240/images/sokoban_search_tree.png

Rubik’s Cube The Rubik’s Cube, a renowned 3D puzzle, has over $4.3\times 10^{19}$ possible configurations, highlighting the huge search space and the computational challenge it poses. Recent advancements in solving the Rubik’s Cube with neural networks underscore the potential of deep learning methods in navigating complex, high-dimensional puzzles. For the exact representation of the Rubik’s Cube state, see Figure 11.

Figure: Figure 11: Example trajectory of Rubik starting from initial state $s_{0}$ leading to the final solution $s_{n}$.

N-Puzzle The N-Puzzle, a classic sliding puzzle game, comes in various sizes, including the 3x3 (8-puzzle), 4x4 (15-puzzle), and 5x5 (24-puzzle). The goal is to rearrange a frame of numbered square tiles into a specific pattern, a task that tests the algorithm’s ability to plan and execute a sequence of moves efficiently. Figure 12 shows a visualization of a trajectory in 24-puzzle.

Figure: Figure 12: Example trajectory of n-puzzle starting from initial state $s_{0}$ leading to the final solution $s_{n}$. Red arrows indicate low-level actions.
Refer to caption: extracted/5790240/images/n_puzzle_trajectory.png

INT INT (INequality Theorem proving) is an automated theorem-proving benchmark for high school algebraic inequality proofs. [] provides a generator of mathematical inequalities and a proof verification tool. Each action in INT maps to a proof step, which specifies a chosen axiom and its input entities - which makes action space very high-dimensional, enabling up to a million valid actions at a step. This large action space makes INT a desirable but challenging environment for expanding HRL paradigms to vast action spaces.

We used 25-step proofs for this paper, representing an uplift from 15 considered in [, ] (the latter used longer proofs, but only for evaluating 15-trained models). Each step is an application of an axiom to an axiom-specific number of entities (entities are bracketed or bracketable parts of the theorem’s goal).

Figure: Figure 13: A comprehensive representation of theorems pertaining to goal achievement in mathematical expressions, showcasing the logical structure and underlying premises leading to the formulated goals.

## Appendix B Key factors for Hierarchical Search

According to our experiments, the attributes pivotal for leveraging the advantages of high-level search include:

- •
presence of dead ends,
- •
learning from diverse experts,
- •
hard-to-learn value function,
- •
complex action space

In Section 4, we show our main experiments that support our findings. In this appendix, we present an extended analysis of each property.

### B.1 Dead ends

In this paper, we conceptualize the environment $\mathcal{E}$ as a Markov Decision Process (MDP), where the environment, for any given state $s\in\mathcal{S}$ and action $a\in\mathcal{A}$, transitions to a subsequent state $s^{\prime}\in\mathcal{S}$. Within this framework, we define a dead-end state $s_{d}$ as a specific type of state with two defining characteristics:

- 1.
The state $s_{d}$ does not represent a solution state.
- 2.
From state $s_{d}$, there exists no feasible sequence of actions leading to a trajectory $(s_{d},s_{d+1},s_{d+2},\dots,s_{d+n})$ that culminates in a solution state $s_{d+n}$.

Dead-end states pose significant challenges in reinforcement learning, as they represent points from which no further learning or progress toward a solution can be made. Identifying and addressing these states is crucial for improving the efficiency and effectiveness of learning algorithms in navigating complex state spaces. Figure 14 shows an illustrative example of a dead-end state.

Figure: Figure 14: An example dead-end in Sokoban – a box that is pushed to the corner cannot be moved anymore, so the objective is not possible to achieve.
Refer to caption: extracted/5790240/images/sokoban_deadend.png

##### Examples of dead-ends in kSubS vs. BestFS

In this subsection, we present examples of how each method handles dead-end situations during the search process.

For this presentation, we analyzed 128 search trees initiated from identical starting boards for both algorithms. The kSubS algorithm encountered dead-ends in 3 instances. To resolve these, it navigated through 13 high-level nodes and 105 low-level nodes within the corresponding subtrees. In contrast, the BestFS algorithm encountered dead-ends in 18 instances, requiring the traversal of 4431 nodes. Note that BestFS does not distinguish between high-level and low-level nodes in its search.

Examples of dead-end handling are shown in Figure 15 for kSubS and Figure 16 for BestFS. Observe that in the case showed in Figure 15 expanding the parent node resulted in adding two more dead-ends to the search tree. Because they have higher values, they were immediately expanded. However, the subgoal generator understood that the only way to reach solution is to make an invalid transition of releasing the blocked box. Such subgoals cannot be achieved by the conditional policy, hence no more subgoal was created in that branch. On the other hand, low-level search is unable to propose invalid transitions, so it stays in dead-end until the value estimates are higher than for other branches.

Figure: Figure 15: We illustrate a scenario where the kSubS algorithm encounters dead-ends, hindering the search process. The figure shows a case where the algorithm generates two subgoals at an expected distance (k=8), but both lead to dead-ends, wasting a portion of the search budget (18 nodes). As a result, the kSubS algorithm backtracks from this subtree and continues searching elsewhere within the tree.
Refer to caption: extracted/5790240/images/ksubs_deadend.png

Figure: Figure 16: The figure shows BestFS expanding two nodes from a dead-end. This resulted in the exploration of over 300 additional nodes from that state, ultimately failing to find a solution within the given search budget.
Refer to caption: extracted/5790240/images/bestfs_deadend.png

### B.2 Learning from diverse experts

Usually broad datasets of offline demonstrations contain data from various sources [, , ]. Because of that, the demonstrations may be diverse in terms of length, structure, quality, skills, strategy, etc. We want to answer the question whether such setting is handled better by high-level or low-level search algorithms.

Experiment setup
For this experiment, we choose the Rubik’s cube environment. We collected a dataset of $500\,000$ trajectories, computed with four different solvers for the Rubik’s cube:

- •
Beginner – the simplest human-oriented solving algorithm. It aims to order the cube layer by layer with a few primitive tactics. Because of that the solutions are structured, but also very long (typically between 150 and 200 moves).
- •
CFOP – an algorithm designed for speedcubers. It is based on the same principle as Beginner, but employs many advanced tactics that make the solutions faster (typically about 100 moves).
- •
Kociemba – a computational solver that finds near-optimal solutions (usually between 20 and 40 moves) in short time. It is heavily optimized based on the algebraic properties of the Rubik’s cube.
- •
Random – solutions obtained by scrambling an ordered cube with random moves and reversing the trajectory.

Figure 27 shows example solutions generated with each solver. Clearly, the algorithmic solvers (Beginner and CFOP) generate much longer solutions that the other methods. They are also more structured, as they are based on building patterns. The computational solver Kociemba on the other hand go directly towards the solution because its moves are carefully optimized to ensure maximal advantage. Because of that, this dataset represent a truly diverse set of demonstrations.

Results As shown in Figure 2, the subgoal methods outperform the low-level methods by a wide margin. While BestFS is comparable on small budgets, it struggles with solving most of the instances. Also, it should be noted that the performance of the subgoal methods changes only slightly compared to training on a single Random solver (Figure 2) while the low-level searches are heavily affected.

Learned values To find the sources of that outcome, we checked the values learned by the heuristic function. Because of the diversity introduced by combining the experts, we should expect that the estimates are subject to high uncertainty and possibly high variance.

Figure 17 shows the distribution of the learned heuristic for random fully shuffled cubes. Although most instances can be solved optimally within 20-26 moves, the estimates range from 14 to 90 steps. Furthermore, the distribution is clearly bimodal – one mode correspond to a typical length of Kociemba solution, the other to CFOP.

Figure: Figure 17: Value distribution for fully scrambled cubes, learned on data coming from diverse experts. The values are rescaled so that the x-axis represent the estimated number of steps to the solution. The values represent the mean of each interval.
Refer to caption: extracted/5790240/images/initial_estimates.png

Furthermore, Figure 22 shows the distribution of value estimates throughout the solutions for each solver. We observe that for the algorithmic solvers the initial distance is considerably underestimated. After about $20\%$ moves the value network recognizes the pattern of layers built by the solvers and expect a long solution by assigning values close to $100$. On the other hand, the values learned for the states visited by the computational solvers start as overestimated, but steadily decrease towards 0.

Figure: Figure 18: Beginner solver
Refer to caption: extracted/5790240/images/beginner_values.png

While it is a reasonable strategy for the value to fit to the provided dataset, it creates a challenge for the search. If a search algorithm aims to imitate Beginner or CFOP, it has to reach the layer pattern, characteristic of those solvers. However, the random states tend to have very low distance estimate, compared to the initial layer patterns. Because of that, for tens of steps the heuristic estimates would be actually increasing, making the reached states less and less probable to expand.

In practice, the low-level searches usually fail to cross this gap. On the other hand, the high-level methods are partially guided by the subgoal generators that ignore the values. The value gap that spans across about 30 steps can be crossed with as few as 5 subgoals of length 6. Because of that both kSubS and AdaSubS can successfully leverage the schematic algorithmic solutions.

To finally confirm that conclusion, we must answer the question whether the performance of low-level searches would increase if they could leverage the algorithmic solutions as well. For that purpose, we trained the components for each method using data only from the Beginner solver. This way we remove the challenge of noisy initial values. As shown in Figure 4, the low-level searches indeed perform much better. BestFS even matches the performance of AdaSubS. That confirms our observation that low-level searchas fail to utilize multimodal data because they rely too much on the value function and seek monotonic slopes.

At the same time we observe that since BestFS and AdaSubS show nearly identical performance on Beginner solutions, it is questionable that hierarchical methods handle long-horizon tasks better, which is a common belief [, , ].

Figure: Figure 23: Beginner

### B.3 Noisy value function

Accurate learning of value function presents a significant challenge in offline reinforcement learning, where the agent’s training is conducted on a fixed dataset of pre-collected trajectories. Section B.2 hints that when value estimates are subject to high uncertainty, subgoal methods should outperform low-level searches.

To confirm that intuition, we run an experiment in a Rubik’s cube environment (Section 4.1.4). This time, the training setup is the same as in Section 4.1.1. However, during inference, we add additional noise to the value estimates. That is, whenever a node is added to the search tree and its value estimate equals $\hat{v}$, we add it with the value of $\hat{v}+\mathcal{N}(0,\sigma)$ instead.

Figure 4 shows that as the amount of noise increases, each low-level method gets less and less efficient. On the extreme, when using fully random values ($\sigma=100$), they struggle to solve any instance.

On the other hand, subgoal methods are much more resilient to noise in the value. Adaptive Subgoal Search is nearly not affected by the presence of noise. For subgoal distances longer than 1, kSubS retains as much as $40\%$ success rate, even with completely random values. The kSubS-1 variant behaves similarly to BestFS, for they are, in fact, equivalent.

Observe that the search performed by low-level methods is guided mainly by the value function. Hence, if the computed estimates are subject to high variance, low-level search struggles to make any progress. On the other hand, the subgoal search is guided both by the value function and the subgoal generator. Both the subgoal generator and the conditional policy that connects subgoals do not depend on the values. Hence, the value function is used only in the high-level nodes, which is only a fraction of the search tree.

An extreme case of that behavior is demonstrated by Adaptive Subgoal Search. Because in our configuration each generator outputs a single subgoal, the value is nearly not used at all for search. Only when the search is stuck, the secondary generators select the highest-ranked node to expand, which in this case is simply a random node of the tree. To summarize, given random value estimates, AdaSubS reduces to the following strategy:

- 1.
Start from the root node,
- 2.
Move from the current node to the subgoal until possible,
- 3.
If the search is stuck, expand a random node in the search tree with a secondary generator and return to (2).

The experiments show that this simple strategy is surprisingly competitive to the greedy best-first approach, even without noise. Interestingly, it could be implemented in low-level search as well. We leave that promising experiment for future work.

### B.4 Complex action spaces

The primary difference between low-level methods and subgoal methods is that the former predicts the next action, and the latter – the next state. In many environments, the action space is as simple as a few bits, allowing for iterating over all possible actions, and sampling them. At the same time, states may be considerably larger, up to the extreme of image observations. However, in some environments, the action space is comparable to the state space, or even more complex. A classic example is the AntMaze environment, in which actions are 8-dimensional, while the goal space is only 2-dimensional [].

Among the combinatorial reasoning environments we consider, INT has the most complex action space. In INT, actions correspond to proof steps and are represented as the chosen axiom, specification of its input entities, and the required premises []. Thus, the complexity of the action is at least comparable to the states. Moreover, solving the INT inequalities is based on constant simplification of the given expression, so the state is getting even smaller with each step.

Our experiments, shown in Figure 6, clearly confirm the advantage of using subgoal methods in the INT environment. To further verify the source of that advantage, we conducted another experiment, in a modified Rubik’s cube environment. Recall that the experiment presented in Section 4.1.1 shows that subgoals offer no significant advantage in the original Rubik’s cube. Now, we want to check whether the outcome would be different if the action space were more complex. For that purpose, we extended the action space 100 times. That is, the new action space consists of 1200 possible moves to choose from – 100 copies of each original action.

As shown in Figure 6, the subgoal methods are barely affected by the change, while the low-level searches are unable to exceed $20\%$ success rate. That result confirms our proposition that when facing a complex action space, hierarchical methods offer considerably better performance.

According to our analysis, the primary issue with low-level searches in the augmented Rubik’s cube is the lack of diversity of visited states. When for each state there are hundreds of actions that lead to a similar outcome, they are rated similarly by the policy. Hence, all the top actions essentially lead to the same outcome, which strongly limits the branching factor and trivializes the search trees. On the other hand, subgoal methods are not affected because subgoal generation does not depend on the action space. The conditional policy that connects the generated subgoals does not build a search tree, but always follows the single best action. Because of that, subgoal methods maintain their performance, even though the action space is much more complex.

It is also important to note that even though some state spaces may seem complex, the underlying manifold of possible configurations is in fact low-dimensional. For instance, we use 12x12 Sokoban boards, where each square is encoded as one-hot of 7 possible items, so technically the state space is 1008-dimensional, while there are only 4 actions. However, in practice the subgoal is defined by the positions of agent and boxes, which is at most 10-dimensional, hence rather simple to generate.

## Appendix C Network architectures & training details

We used BART [] and BERT [] architectures from HuggingFace Transformers for all components. Subgoal generators and INT’s policies (CLLP and baseline policy) use BART. The remaining policies and value functions use BERT. Following the practice in [], we’ve reduced model size parameters, as detailed in Table 2.

INT
As states in INT are complex objects, we prefer to use their string representations and avoid mapping arbitrarily generated strings into complex states. Requisite modifications to the component definition are best illustrated analogously to Section D.1. A generator is redefined as follows:

$$ $\mathcal{G}_{\text{int}}:\underbrace{\mathcal{S}}_{\text{state to expand}} \rightarrow\underbrace{P(\mathcal{T})}_{\text{set of {proposed} subgoals (in string format)}}$ $$

and conditional level policy:

$$ $\mathcal{P}_{\text{int}}:\underbrace{\mathcal{S}}_{\text{current state}}\times \underbrace{\mathcal{T}}_{\text{subgoal {representation}}}\rightarrow \underbrace{\mathcal{A}}_{\text{action}}$ $$

Sokoban
Unlike prior work [, ], which used convolutional networks for all components, we work on tokenized representations of Sokoban boards and use BERT/BART architectures instead. This modification did not adversely impact our ability to replicate AdaSubS and kSubS results.

Training pipeline We trained our models from scratch using the HuggingFace Transformer pipeline. Detailed training parameters, which varied across environments, can be found in Table 1.

Infrastructure For training, we used a single NVIDIA A100 40GB GPU node, and each component’s training took up to 48 hours. Because we used pre-trained trajectories, we did not need to use more than one core during training. We ran an evaluation using 24-core CPU jobs on Xeon Platinum 8268 nodes with 192GB of memory.

**Table 1: Training-related hyperparameter values**
| Environment | Hyperparameter | Generator | CLLP | Value | Policy |
| --- | --- | --- | --- | --- | --- |
| INT | learning rate | 0.0001 | 0.0001 | 0.0003 | 0.0001 |
| learning rate scheduling | linear | linear | linear | linear |  |
| warmup steps | 4000 | 4000 | 2000 | 4000 |  |
| batch size | 32 | 32 | 128 | 32 |  |
| weight decay | 1e-05 | 1e-05 | 1e-05 | 1e-05 |  |
|  | dropout | 0.1 | 0.1 | 0 | 0.1 |
| Rubik’s Cube | learning rate | 0.0001 | 0.0005 | 3e-7 | 0.0001 |
| learning rate scheduling | linear | linear | linear | linear |  |
| warmup steps | 5000 | 50000 | 50000 | 1000 |  |
| batch size | 512 | 5000 | 5000 | 2048 |  |
| weight decay | 0.0001 | 0.001 | 0.00001 | 0.0001 |  |
|  | dropout | 0.1 | 0 | 0 | 0 |
| Sokoban | learning rate | 0.00001 | 0.0001 | 0.0001 | 0.0001 |
| learning rate scheduling | linear | linear | linear | linear |  |
| warmup steps | 2500 | 1000 | 1000 | 1000 |  |
| batch size | 512 | 2048 | 2048 | 2048 |  |
| weight decay | 0.0001 | 0.0001 | 0.0001 | 0.000001 |  |
|  | dropout | 0 | 0.1 | 0 | 0 |
| N-Puzzle | learning rate | 0.0001 | 0.0001 | 0.0001 | 0.0001 |
| learning rate scheduling | linear | linear | linear | linear |  |
| warmup steps | 5000 | 2000 | 2000 | 2000 |  |
| batch size | 4096 | 4096 | 512 | 4096 |  |
| weight decay | 0.00001 | 0.00001 | 0.00001 | 0.0001 |  |
|  | dropout | 0.1 | 0 | 0 | 0 |

**Table 2: Model-related hyperparameter values**
| Environment | Hyperparameter | Generator | CLLP | Value | Policy |
| --- | --- | --- | --- | --- | --- |
| INT | d model | 512 | 512 | - | 512 |
| decoder layers | 6 | 6 | - | 6 |  |
| intermediate size | - | - | 256 | - |  |
| encoder attention heads | 8 | 8 | - | 8 |  |
| hidden size | - | - | 128 | - |  |
|  | num hidden layers | - | - | 2 | - |
|  | decoder ffn dim | 2048 | 2048 | - | 2048 |
|  | encoder ffn dim | 2048 | 2048 | - | 2048 |
|  | encoder layers | 6 | 6 | - | 6 |
|  | decoder attention heads | 8 | 8 | - | 8 |
| Sokoban | d model | 256 | - | - | - |
| decoder layers | 3 | - | - | - |  |
| intermediate size | - | 512 | 128 | 512 |  |
| encoder attention heads | 4 | - | - | - |  |
| hidden size | - | 512 | 128 | 512 |  |
|  | num hidden layers | - | 6 | 1 | 6 |
|  | encoder ffn dim | 2048 | - | - | - |
|  | decoder ffn dim | 1024 | - | - | - |
|  | encoder layers | 3 | - | - | - |
|  | decoder attention heads | 4 | - | - | - |
| N-Puzzle | d model | 64 | - | - | - |
| decoder layers | 3 | - | - | - |  |
| intermediate size | - | 128 | 128 | 256 |  |
| encoder attention heads | 4 | - | - | - |  |
| hidden size | - | 128 | 128 | 256 |  |
|  | num hidden layers | - | 2 | 1 | 3 |
|  | encoder ffn dim | 64 | - | - | - |
|  | decoder ffn dim | 64 | - | - | - |
|  | encoder layers | 3 | - | - | - |
|  | decoder attention heads | 4 | - | - | - |
| Rubik’s Cube | d model | 256 | - | - | - |
| decoder layers | 3 | - | - | - |  |
| intermediate size | - | 512 | 128 | 512 |  |
| encoder attention heads | 4 | - | - | - |  |
| hidden size | - | 512 | 128 | 512 |  |
|  | num hidden layers | - | 2 | 1 | 6 |
|  | encoder ffn dim | 2048 | - | - | - |
|  | decoder ffn dim | 1024 | - | - | - |
|  | encoder layers | 3 | - | - | - |
|  | decoder attention heads | 4 | - | - | - |

## Appendix D Offline pretraining

Models are pretrained using an offline imitation learning approach. Specifically, given a set of solution trajectories $\{(s_{0},s_{1},\dots,s_{n_{i}})\}_{i=1}^{N}$ produced by an expert $\mathcal{M}$, or multiple experts $\{\mathcal{M}_{j}\}_{j=1}^{M}$ in cases where offline trajectories are collected from multiple experts, the objective is to learn from these trajectories. It is important to note that these trajectories are not required to be optimal; they may include loops or numerous redundant actions. Description of all components can be found in section D.1 and supervised training objectives in section D.2.

### D.1 Components

During the pretraining phase, models undergo an offline imitation learning process. Specifically, they are trained on a set of solution trajectories $\{(s_{0},s_{1},\dots,s_{n_{i}})\}_{i=1}^{N}$, which are collected to facilitate the learning of decision-making strategies.

Generator The generator component is responsible for generating subgoal propositions upon receiving a state. These propositions are designed to facilitate progress toward the solution by suggesting intermediate steps that direct the search process more efficiently.

$$ $\mathcal{G}:\underbrace{\mathcal{S}}_{\text{state to expand}}\rightarrow \underbrace{P(\mathcal{S})}_{\text{set of subgoal propositions}}$ $$

Conditional Low-Level Policy The Conditional Low-Level Policy (CLLP) plays a crucial role in node expansion by evaluating each subgoal proposition. For a given current state and a subgoal, the CLLP recommends actions that lead toward achieving the subgoal. A path from the current node to the subgoal is constructed through the iterative execution of these actions. Subgoals reached within a predefined number of steps, $k$, are incorporated into the graph, while those that are not are discarded.

$$ $\mathcal{P}:\underbrace{\mathcal{S}}_{\text{current state}}\times\underbrace{ \mathcal{S}}_{\text{subgoal state}}\rightarrow\underbrace{\mathcal{A}}_{\text{ action}}$ $$

Value The value function estimates the distance from a current state to the final solution. This estimation is used to guide the selection and expansion of nodes, influencing the overall search strategy.

$$ $\mathcal{V}:\underbrace{\mathcal{S}}_{\text{state to evaluate}}\rightarrow \underbrace{\mathbb{R}}_{\text{value of the state}}$ $$

Behavioral Cloning Policy The policy $\Pi_{\text{BC}}$ is a decision-making function that maps the current state to an action. It encapsulates the strategy derived from the learning process, guiding the agent’s actions towards achieving the final goal.

$$ $\Pi_{\text{BC}}:\underbrace{\mathcal{S}}_{\text{current state}}\rightarrow \underbrace{\mathcal{A}}_{\text{action}}$ $$

### D.2 Supervised Objectives

Each expert trajectory is defined as a sequence of states and corresponding actions $(s_{0},a_{0}),\ldots,(s_{n-1},a_{n-1}),s_{n}$ that delineate a path to a solution. The training methodology leverages this data through several key self-supervised imitation mappings:

- •
A $k$-subgoal generator that maps a state $s_{i}$ to a future state $s_{i+k}$, simulating the achievement of intermediate goals.
- •
A value function that estimates the remaining steps to the solution by mapping state $s_{i}$ to a numerical value $(i-n)$, representing the estimated distance from the goal.
- •
A policy that maps each state-action pair $(s_{i},s_{i+d})$, with $d\leq k$, to the corresponding action $a_{i}$, thereby guiding the decision-making process towards the solution.

## Appendix E Offline pretraining: trajectories

### E.1 Rubik’s Cube

#### E.1.1 Random

To construct a random successful trajectory, we performed 20 random permutations on an initially solved Rubik’s Cube and took the reverse of this sequence, replacing each move with its reverse. Such solutions are usually sub-optimal since random moves are not guaranteed to increase the distance from the solution. They can even make loops in the trajectories. However, a cube scrambled with 20 moves is usually close to a random state, so such trajectories give a decent space coverage.

#### E.1.2 Beginner, CFOP

Beginner and CFOP are algorithms commonly used by humans. They solve the cube by ordering the stickers layer by layer. Because of that, the solutions are highly structured and long – usually between 100 and 200 moves. Both algorithms are composed of several subroutines that help building the consecutive layers. Thus, the structure of such solutions highly resembles the subgoal search.

#### E.1.3 Kociemba

The Kociemba two-stage solver leverages the algebraic structure of the Rubik’s Cube. In the first stage, its goal is to enter a specific subgroup. Since that subgroup is much smaller than the whole space, completing the solution may be done efficiently. Kociemba finds reasonably short solutions (usually between 20 and 40 moves) and works reasonably fast.

#### E.1.4 Size of datasets

For training the components on a dataset collected by a single solver, we generate $100\,000$ trajectories. For the experiment with diverse experts, each solver generates $25\,000$ trajectories for a total of $100\,000$.

### E.2 INT

Trajectories are constructed from sequences of axiom applications, similarly to [], who followed []. A set of up to 15 (out of 18) axioms is first selected, and then a random axiom order is set and validated. Finally, a proof is converted to a relevant trajectory. Approximately 500,000 trajectories were generated for model pre-training.

We capped the number of axioms at 15 because some pairs of axioms (eg. terminal axioms) cannot be in one trajectory.

### E.3 N-Puzzle

To collect data for N-puzzles, we utilized an algorithm that initially arranges block number $1$, followed by block number $2$, and so forth, as depicted in Figure 12. The training set comprises approximately $10,000$ trajectories.

### E.4 Sokoban

To collect trajectories for Sokoban, we used a trained MCTS agent that gathered approximately $100,000$ trajectories.

## Appendix F Algorithms

### F.1 Best-First Search

##### Overview

Best-First Search greedily prioritizes node expansions with the highest heuristic estimates, aiming for paths that likely lead to the goal. While not ensuring optimality, BestFS provides a simple yet efficient strategy for navigating complex search spaces. The high-level pseudocode for BestFS is outlined in Algorithm 1, and the detailed pseudocode is presented in Algorithm 2.

Figure: Algorithm 1 Pseudocode for Best-First Search

##### Heuristic

In our implementation, we adhere to the Best-First Search principle by utilizing the learned value function, a common practice in the planning domain [, , , ]. It should be noted that in each of our experiments, all the compared algorithms use the same value function network. This way we ensure that the differences come solely from the algorithmic part.

##### Selecting children

When expanding a node during search, the standard BestFS algorithm adds all its children. However, in our implementation, we aimed to reduce the search tree size by selecting only the most promising children. We achieve this by sorting the children according to their probability distribution predicted by the policy network. For choosing the final subset of children, we employ two approaches. In the simpler variant, we always select the top $k$ actions. In the second variant, we add top children until their cumulative probability exceeds a fixed threshold $t_{conf}$.

This pruning does not adversely affect the standard algorithm, as nodes are still chosen based on their heuristic values, while the threshold sets a practical limit on the search space. Our results demonstrate that BestFS tends to perform much better with a confidence threshold (Figure 28). However, its performance is highly sensitive to this threshold as it balances exploration and exploitation, illustrating the impact of different confidence thresholds on success rates.

Figure: Figure 28: Comparison of success rates for the BestFS algorithm on the Rubik’s Cube with various confidence threshold values. BestFS-X represents the BestFS algorithm with the confidence threshold set to X. Left: The plot displays the achieved success rate relative to the graph size. Right: The plot illustrates the success rate for a budget of 500 nodes.
Refer to caption: extracted/5790240/images/threshold_4.png

##### Completeness

In the Rubik’s Cube environment with random trajectories, the subgoal methods solve more instances than BestFS given a low search budget, but with more resources, BestFS takes the lead (see Figure 2). Also, in other experiments, we may observe that BestFS typically requires higher computational budget to solve the simplest instances, but its performance increases considerably with more resources.

That behavior is related to the fact that the search trees built by hierarchical methods are much sparser because the branching occurs only in the high-level nodes. On the other hand, the low-level algorithms can cover a higher fraction of the space. On the extreme, if we used all the available actions for every expansion, the low-level search would be guaranteed to find a solution if one exists. Our mechanism of selecting the actions removes that guarantee. However, at the same time, it drastically improves performance (compare BestFS-0.7 with BestFS-0.99 which is complete), which makes it a much better choice for our study.

We note that the high-level algorithms could be made complete, as proposed in [, ]. However, to maximize the efficiency we choose to keep the tested algorithms in their original form. The ability to search with sparse trees not only lets the methods advance fast, but also withdraw quickly if the branch does not lead to the solution (is a dead end).

Hyperparameters To identify the most suitable solving parameters, we used grid search. Initially we grid over coarse values (namely $0.1$, $0.2$, $0.3$, $0.4$,$0.5$, $0.6$, $0.7$, $0.8$, $0.9$, and $0.99$). Then we check finer values (with precision of $0.05$) around the best-performing threshold. The best-performing thresholds range from $0.6$ to $0.85$, depending on the environment and the components that are used.

For determining the best number of top actions $k$ for the simpler variant, we simply check every possible number of actions. Usually selecting $2$ actions is by far the best choice.

Details regarding hyperparameters of the networks are listed in Appendix D.1.

Figure: Algorithm 2 Complete pseudocode for Best-First Search

### F.2 Monte Carlo Tree Search

##### Overview

Our Monte Carlo Tree Search (MCTS) solver, designed for a single-player setting, is based on the AlphaZero framework []. The high-level workflow of MCTS is illustrated in Figure 29, and detailed pseudocode is provided in Algorithm 3.

The algorithm’s operation consists of four primary stages:

- •
Selection: The most promising node is selected using Polynomial Upper Confidence Trees (PUCT), augmented with an exploration weight to strike a balance between exploiting known strategies and investigating new pathways.
- •
Expansion: The selected node is expanded, generating new child nodes that correspond to prospective future actions. This expansion widens the search tree and enables the exploration of various outcomes.
- •
Simulation: Following the AlphaZero approach [], policy and value networks replace traditional simulations. The policy network suggests favorable moves, while the value network predicts their probability of success, directing the algorithm towards beneficial trajectories.
- •
Backpropagation: The insights derived from the networks are used to update node values, improving future decision-making.

Figure: Figure 29: Schematic diagram of the MCTS algorithm in our implementation. Arrows show policy network probabilities and node values are valued network predictions. Q values, calculated via PUCT, integrate these with exploration-exploitation balance.
Refer to caption: x10.png

##### Hyperparameters

In the MCTS algorithm, the parameters were set as follows: sampling temperatures were chosen from [0, 0.5, 1]. The number of steps varied between 200 and 1000, and the number of simulations ranged from 5 to 300. The discount factor and exploration weight were consistently set at 1.

Figure: Algorithm 3 MCTS Solver

### F.3 A ∗ Search

##### Overview

Like Best-First Search, A* prioritizes the exploration of promising nodes. However, A* strategically guides its search by incorporating both the actual cost to reach a node and a heuristic estimate of the remaining distance to the goal. This way it balances the greedy exploitation and conservative exploration. The high-level pseudocode for A* is outlined in Algorithm 4, and the detailed pseudocode is presented in Algorithm 5.

Figure: Algorithm 4 Pseudocode for A*

##### Heuristic

A* guidance is achieved through the following cost function:

$$ $f(node)=\lambda g(node)+h(node)$ $$

where:

- •
$g(node)$: The cost to reach $node$ from the start state, in our case its depth in the search tree.
- •
$h(node)$: A heuristic estimate of the cost from $node$ to the goal state.
- •
$\lambda$: A scaling factor balancing the influence of actual cost and heuristic estimate.

For heuristic $h$, we used a value network, like for BestFS (see Appendix F.1). If the heuristic used for A* is admissible, i.e. it never overestimates the cost of reaching the goal, A* is guaranteed to find an optimal solution. For instance, if we used $h(node)\equiv 0$, A* would reduce to the Dijkstra algorithm. The heuristic that we learn is not guaranteed to be admissible. Firstly, it estimates the distance according to the demonstrations, which is always an upper bound for the optimal distance. Secondly, the approximation errors introduce additional uncertainty. However, our main focus is on finding any solution, not necessarily an optimal one.

##### Selecting children

During the search, A* maintains a priority queue of nodes to be explored. Similarly to BetsFS (Appendix F.1) for reducing the search tree size, we select the most promising children. At each iteration, the node with the lowest $f(node)$ value is selected for expansion. The algorithm proceeds until the goal state is reached or the computational budget is exceeded.

Figure: Figure 30: Figures presented above illustrate the impact of depth cost scaling on the overall success rate of the A* algorithm on Sokoban, employing a confidence threshold of 0.85. In most experiments, the smaller the depth scaling factor is, the better is the final success rate. The left figure shows the success rate curves for different choices of cost weight $\lambda$, while the right plot compares those variants for a fixed budget of 500 computation nodes.
Refer to caption: extracted/5790240/images/astar_scaling_factor_3.png

##### Hyperparameters

The key parameter for A* is the cost weight $\lambda$. On the extreme, setting $\lambda=0$ reduces A* to greedy BestFS, while setting $\lambda=\infty$ makes it equivalent to Breadth-First Search. By tuning that parameter, we control the trade-off between exploration and exploitation of the search.

To tune the depth parameter for our experiments, we grided over values $[0.1,0.2,0.5,1,2,5,10]$. However, usually the best choice was to keep the cost weight low ($0.1$ or $0.2$, see Figure 30). While conservative search allows A* avoid more dead-ends than BestFS (see Table 8), usually greedy steps lead to finding the solution much faster.

Figure: Algorithm 5 Complete pseudocode for A*

### F.4 kSubS

kSubS can be seen as a special case of Adaptive Subgoal Search, but with just one generator $\rho_{k}$. For details see Algorithm 6. Both methods are introduced and studied in [, ].

### F.5 AdaSubS

Figure: Algorithm 6 Complete pseudocode for Adaptive Subgoal Search

### F.6 HIPS and HIPS- ε 𝜀 \varepsilon italic_ε

Here we show a pseudocode for HIPS and HIPS-$\varepsilon$ methods. For details see Alg. 7

Figure: Algorithm 7 Complete pseudocode for HIPS with BestFS-PHS* and VQ-VAE

## Appendix G Statistical analysis of high-level and low-level algorithms

**Table 3: Average values of tree size, number of leaves, branching factor (average number of children), and solution length were calculated for 100 boards solved by all presented algorithms. Additionally, for the subgoal method, the average number of subgoals on the winning path was determined.**
| Environment | Algorithm | Tree size | Number of leaves | Branching factor | Solution length | Solution length (subgoals) |
| --- | --- | --- | --- | --- | --- | --- |
| N-Puzzle | BestFS | $354.43$ | $1.34$ | $1.0$ | $354.08$ | - |
| A* | $354.09$ | $1.34$ | $1.0$ | $353.56$ | - |  |
| MCTS | $742.04$ | $371.52$ | $2.0$ | $347.43$ | - |  |
| kSubS-8 | $353.66$ | $1.0$ | $1.0$ | $353.66$ | $45.67$ |  |
| Sokoban | BestFS | $185.24$ | $36.88$ | $1.22$ | $48.98$ | - |
| A* | $85.04$ | $12.22$ | $1.43$ | $45.68$ | - |  |
| MCTS | $255.0$ | $128.0$ | $2.0$ | $45.1$ | - |  |
| kSubS-8 | $101.92$ | $6.6$ | $1.06$ | $46.88$ | $7.23$ |  |
| Rubik’s Cube | BestFS | $152.25$ | $58.02$ | $1.65$ | $48.92$ | - |
| A* | $185.23$ | $69.57$ | $1.64$ | $45.46$ | - |  |
| MCTS | $716.46$ | $358.73$ | $2.0$ | $33.32$ | - |  |
| kSubS-4 | $303.52$ | $133.44$ | $1.12$ | $73.58$ | $26.65$ |  |

Figure: Figure 31: The distribution of solution length in Sokoban. The right part of each plot illustrates the distribution for the methods that we used. The left part corresponds to the optimal solutions for the tested instances obtained using Breadth-First Search. These algorithms were evaluated on 494 commonly solved instances.
Refer to caption: extracted/5790240/images/solution_length_violin.png

## Appendix H Hierarchical search

Figure: Figure 33: Overview of the search methods under consideration, accompanied by illustrative examples depicted in various plots for each method. Specifically, straight blue lines are utilized to represent low-level actions that occur within the search space. In contrast, long skip connections are used to symbolize subgoals within the search process.
Refer to caption: x12.png

## Appendix I Further discussion on HIPS results

HIPS and HIPS-$\varepsilon$ [, ] are recent hierarchical search algorithms proposing to generate subgoals with variational autoencoders. We attempted to use HIPS and HIPS-$\varepsilon$ in greedy and prior-informed variations, and for all HIPS methods, the cost of inference was prohibitively high.

To compare these methods, we used A*-generated data from HIPS papers, in contrast to all other experiments (which use data generated by us).

Our evaluation, illustrated in Figure 34, shows that HIPS uses 100x more low-level nodes in search than comparable subgoal search methods and baselines - despite relatively similar subgoal efficiency as calculated in relevant papers. These findings informed our decision not to evaluate HIPS in the rest of the paper.

Figure: Figure 34: A comparison of high-level and low-level node budgets for considered methods: HIPS, subgoal search methods, and baselines on N-Puzzle. The low-level node budget represents the number of all states that have ever been visited during the search. The bimodal distribution indicates that HIPS methods use disproportionately (over 100x) more low-level nodes than comparable subgoal search methods and baselines. This directly translates to prohibitively slow solving time.
Refer to caption: x13.png

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 5
presentation: 2
questions: 1.	Is my depiction above of the setup – no domain-specific heuristic, but yes data, is correct?
2.	Are the methods for detecting subgoals domain independent, i.e., only based on the given dataset, or do they also include domain-specific hard coded procedures. 
3.	In Section 3, the use of “planning” in the third bullet is not clear to me (and I’ve experience in planning). 
4.	Where you use the term value function, I think you mean state value heuristic? My guess is that if any, the term reward would be more accurate e(as per reward shaping)
soundness: 3
strengths: 1.	The problem is interesting, the evaluation is extensive. 
2.	The conclusions drawn from the evaluation are useful for future research and implementer. 
3.	Some interesting insights into the nature of combinatorial search problems.
summary: This paper reports on an empirical evaluation of two types of algorithms for solving combinatorial search problems: “standard” graph search algorithms and “hierarchical search” algorithm. Worth noting that, unlike the classical literature on combinatorial search, here the main setup is that the algorithm does not have a given domain-specific heuristic. Instead the algorithm is  given a dataset of solutions to problems in the same domain, and can learn from this dataset how to solve other problems in the same domain. The “standard” graph search algorithms considered in this work learn a heuristic function (referred to as a value function here) and the “hierarchical search” algorithms considered in this work also learn a method to generate subgoals in this domain and performs a higher-level planning in the space of subgoals. 
The results show that hierarchical search methods are often much better. The purpose of this work is to dig deeper and analyze why and when they are better. This is done by adding noise to the heuristic, considering test problems significantly different from those used for training, domains with dead-ends, and analyzing domains with particularly many actions. The results, very concisely show that hierarchical search is better in general, and in particular when the heuristic is weak, the training is very different from the test, and when there are many dead-ends or many actions.
weaknesses: The paper is far from being self-contained. This can be viewed by the large number of appendices. To me, this work is more fitting for a journal than a conference paper. A major example for this is Theorem 1, which one cannot fully understand without reading the appendices. 
In addition, the scope is maybe not a perfect fit for a top conference, as they mainly studied the existing algorithms and the conclusions are not ground breaking.

Post-rebuttal: the authors provided some interesting theory in the discussion, I wish it was there in the paper when submitted. At this point, I am not sure if the addition of significant theory is reasonable during a rebuttal.

---

confidence: 5
contribution: 2
initial_rating: 5
presentation: 4
questions: 1. How adaptable are hierarchical search methods to other complex domains outside the specific NP-hard problems tested, such as real-time decision-making environments? 
2. How do computational constraints affect the performance of hierarchical search methods compared to low-level search methods in real-world applications? 
3. What improvements do the authors foresee or recommend for hierarchical search methods to handle larger datasets or more variable environments effectively? 
4. Could the authors elaborate on the standardized evaluation guidelines proposed? How do these guidelines compare to existing benchmarks in AI research?
soundness: 4
strengths: 1. The paper offers a novel analysis of hierarchical versus low-level search methods in NP-hard problem domains, a less frequented area of research with significant implications for AI optimization tasks (Section 1). 
2. The paper's structure is logical and well-articulated. It presents complex methodologies and findings in a manner that is accessible to readers with a background in AI and machine learning. The diagrams and tables effectively illustrate key points and comparisons. 
3. Robust empirical analysis supports the claims, with extensive testing across various scenarios to demonstrate the superior performance of hierarchical methods under specific conditions. 
4. The findings contribute valuable insights into applying hierarchical search methods, particularly their resilience to value function noise and their efficiency in environments with complex action spaces, which are critical for advancing AI capabilities in real-world applications.
summary: This paper examines the efficacy of hierarchical search methods in combinatorial reasoning problems compared to low-level search methods. It identifies specific conditions where hierarchical search excels due to the handling value function approximations and complex action spaces. The paper proposes standardized evaluation guidelines for search methods and reassesses state-of-the-art algorithms. The research highlights how hierarchical search methods can mitigate the challenges of large action spaces and variable training data.
weaknesses: 1. The study’s focus on specific NP-hard problems may limit the generalizability of the findings. Additional studies could help determine if the advantages of hierarchical methods hold across a broader range of combinatorial problems (General Discussion). 
2. The performance advantages of hierarchical methods heavily depend on the diversity and quality of training data. The paper could delve deeper into the effects of lower-quality or less diverse data sets (Section 5.1). 
3. While the paper addresses the effectiveness of hierarchical search methods, it underplays their computational complexity and resource demands, which could be a significant drawback in practical applications (Section 4). 
4. The robustness of hierarchical methods to training data variability could lead to overfitting if not adequately managed. The paper could discuss strategies to mitigate this risk (Section 5.2).
5. A missing comparison with other foundation models in combinatorial problems, such as DeepCubeA, which are trained in an unsupervised setting.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 2
questions: Other Comments:

- Line 52: "low-level" likely refers to hierarchical algorithms.

- Line 59: The phrase "hard-to-learn value functions" requires clarification.

- Line 83: There is a reference error.

- Line 175: The description “Planner that determines the order in which subgoals are generated” seems to refer to the "Subgoal generator."

- Figure 7: Since both AdaSubS and kSubS rely on value functions, why do they not experience a significant drop in performance with high noise levels? For instance, kSubS in Sokoban (2 to 100 noise) shows better results.
  
- Figure 7: What is the value scale (minimum and maximum) for the value function, given that A* and BestFS tolerate a 0.5 error in the Rubik’s Cube test?

- Figures: Some figures should be adjusted to enhance readability by increasing font sizes and displaying full labels, such as “Step” and “Subgoal” in Figures 8 and 9.
soundness: 2
strengths: Strengths:

- The paper includes numerous experiments examining various factors that could impact the performance of algorithms.
summary: This paper answers two primary questions: 1. Will hierarchical search outperform classical search under the same heuristic function and other settings? 2. In what situations do hierarchical search methods significantly outperform classical search? The authors conduct experiments to compare the performance of hierarchical search with classical search, finding that hierarchical search performs better in instances with complex action spaces and less guided heuristic functions. Additionally, data with high diversity also favors hierarchical search.

I am uncertain whether the authors have addressed all possible influencing factors to arrive to the final conclusion. Since hierarchical search relies on a subgoal generator, which functions as another form of heuristic, this additional generator could significantly influence the improved performance of hierarchical search compared to classical search, especially in tests involving noisy value functions. This reliance on a subgoal generator may also be a critical factor that warrants further investigation.

And the motivation behind this paper is also unclear. After answering these two questions, what potential impact could this research have on future algorithm design or other related fields?
weaknesses: Weaknesses:

- The motivation for the study is unclear.

- The presence of a subgoal generator could heavily influence the analysis of the experiments.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 2
questions: I don't have any specific questions about the paper -- but there are likely parts of it I did not fully understand.
soundness: 3
strengths: The paper summarizes hierarchical reasoning methods and performs experiments to show their desirable properties. 

The insights regarding robustness to noisy value functions are quite useful and seem to be well supported by the experiments.

Similarly, the breakdown of claims regarding complex action spaces, ergodicity, and data diversity is useful, but I am less certain about the validity of these claims, given that there are theoretical reasons why they may not be true.
summary: This paper reviews hierarchical approaches to reasoning tasks, in particular comparing hierarchical search to low-level search. 

While the paper has no serious flaws, I am not entirely sure what to make of it. The insights the paper provides may be useful, but I am somewhat worried if they are contrived or overstated. In general, I think many would agree subgoal methods are worth pursuing, so arguing for this alone may not be entirely useful. At the same time, there are theoretical reasons why subgoal methods are imperfect, namely the upwards refinability property, e.g. that an optimal solution can be expressed in terms of abstractions. In general, subgoal methods may not be as flexible as a method which can use low-level actions (for an arbitrary problem at least), and to retain completeness a system needs to be able to use both abstract and primitive actions. Accordingly, I am somewhat skeptical of the takeaways, which seem to be based on limited empirical evaluation compared to what they claim. Regardless, I think the breakdown of benefits into the four separate takeaways is useful and overall think the paper is headed in the right direction.
weaknesses: I believe the related work section could be better organized, it didn't seem to flow with the rest of the paper so maybe it could be at the very end instead? e.g. Section 1 seems to better flow into Section 3. 

I think the paper could better distinguish between planning and learning -- many of the problems discussed are amenable to classical algorithms, so where does learning come in best and why?

I think the paper would benefit from more theory -- while subgoal methods may have benefits in the experiments performed, their theoretical properties are not entirely discussed. In particular, issues such as the upwards refinability property make me skeptical of the second takeaway (line 417). In other sections, I think the paper would benefit from contrasting theory and experiment. 

In general, the writing was somewhat difficult to follow and clarity could be improved.

Meta-review: The paper attempts to identify properties that make combinatorial reasoning problems more amenable to hierarchical rather than low-level state-space search. Via empirical studies, it identifies 4 such factors: hard-to-learn value functions, complex action spaces, presence of dead ends in the environment, and data collected from diverse sources.

Strengths:
- Interesting insights about combinatorial reasoning and properties of combinatorial reasoning problems.
- Extensive empirical study

Weaknesses:
- Clarity: the paper tries to deliver many distinct points, which makes it hard to digest.
- The implications and potential for this work's impact aren't very clear. The paper has a lot of interesting information, but how should it translate to algorithm design?
- The validity of the takeaways isn't obvious, since they depend on the subgoal proposer and other factors that experiments didn't evaluate extensively (see below).

Overall, the metareviewer finds that, despite its merits, this work's drawbacks are more severe than the reviews imply. In particular, the paper evaluates fairly vanilla versions of the low-level search algorithms as baselines. In reality, e.g., the PDDL planning community long ago introduced methods that make search much faster than basic A* by efficiently identifying landmarks (Richter, Westphal, "Guiding Cost-Based Anytime Planning with Landmarks", JAIR-2010), dead-ends (Kolobov, Mausam, Weld, "SixthSense: Fast and reliable recognition of dead ends in MDPs", AAAI-2010), and using many other tricks. These methods weren't designed for learning-to-search scenarios like those in this paper but can be quickly adapted to them by being combined with A* -- actually, many of them are heavily modified versions of A* and other fundamental search algorithms. Comparing to these stronger low-level search baselines can change the outcome of the paper's empirical study significantly, undermining the paper's key contribution. Hierarchical approaches may still win in general, but factors like dead ends may turn out to play a negligible role in this. The metareviewer joins reviewer *sWxG* in suggesting that the authors make the authors solidify the paper's contribution by turning the paper's empirical insights into algorithmic innovations: it will make the paper's merits more tangible and harder to argue against

Decision: Reject