NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Tree Search With Predictions

Bob Dong, Michael DinitzNeurIPS 2026

TL;DR

If someone gives you a slightly wrong hint about where an item is in a sorted array, a classic trick lets you find it in $O(\log \eta)$ steps, where $\eta$ is how far off the hint was. This paper asks what happens when we move from flat arrays to branching trees: while general trees break this speedup completely, trees that are structurally "path-like" allow us to rescue it. By decomposing trees into a hierarchy of "spines," the authors design an optimal search algorithm that beats traditional methods whenever machine-learned predictions are reasonably close.

What Problem Does This Paper Address?

Traditional algorithms optimize for worst-case guarantees, while machine learning shines in the typical case but can failspectacularly out-of-distribution. The "algorithms with predictions" (or learning-augmented) framework bridges the two: use a potentially flawed ML prediction to go fast when the hint is accurate, without losing your shirt when it's terrible.

The textbook example is searching a sorted array of $n$ items. Standard binary search takes $O(\log n)$ queries. With a predicted index, doubling binary search (exponentially expanding your search radius around the hint) finds the target in $O(\log \eta)$ queries, where $\eta$ is the distance between the prediction and the target.

Notice that a sorted array is really just a path graph: querying an index tells you whether to go left or right. What happens if we generalize from paths to trees? In the Search on Trees problem, you look for a hidden target node $t$ given a predicted node $s$. Querying any node $x$ acts like a signpost—an oracle tells you either "you found $t$!" or points to the exact neighbor of $x$ that steps closer to $t$ (useful for finding faulty nodes in noisy tree-like data structures or software testing). Without predictions, repeatedly querying the tree's centroid takes $O(\log n)$ queries. The authors ask: given a prediction $s$ at graph distance $\eta = \text{dist}(s,t)$, can we still find $t$ in $O(\log \eta)$ queries?

Methods

To handle trees, the authors introduce $k$-Spine Exponential Search, combining classic 1D exponential search with a graph-theoretic metric called pathwidth ($k$). Pathwidth measures how "path-like" a graph is: a simple path or a "caterpillar" tree (a central path with leaves fuzzing off it) has $k=1$, while a bushy complete binary tree has $k = \Theta(\log n)$.

Here is how the algorithm works:

  • Offline $k$-Spine Decomposition: Drawing on existing graph theory, any tree of pathwidth $k$ contains a "main path" (a $k$-spine) whose removal shatters the tree into disconnected subtrees, each guaranteed to have pathwidth at most $k-1$. Recursively stripping these spines creates a hierarchy of paths at most $k$ levels deep.
  • Project and Search: Starting at the current component and prediction $s_{\text{cur}}$, the algorithm projects $s_{\text{cur}}$ onto the closest node $a$ on the component's spine. It then runs standard 1D doubling binary search along the spine starting from $a$.
  • Descend and Repeat: Because trees have unique paths, spine nodes act just like a sorted array, pointing along the spine toward the exit vertex $x$ closest to the target $t$. Once the search hits $x$, the oracle either reveals $t$ or points off-spine into a neighbor $y$. The algorithm updates $s_{\text{cur}} = y$, drops into that smaller subtree (whose pathwidth is strictly $\le k-1$), and repeats.

Because each step off a spine moves strictly closer to $t$, the search distance on every spine never exceeds the original error $\eta$, bounding the total work to at most $k$ searches of $O(\log \eta)$ queries each.

Datasets

The authors evaluate their algorithm on four large-scale graphs from the Network Repository, converted into low-pathwidth ($k=5$ or $6$) spanning trees via depth-first search (DFS) rooted at low-degree peripheral vertices:

  • Luxembourg road network ($114,599$ nodes, $k=5$)
  • sc-msdoor scientific-computing graph ($404,785$ nodes, $k=6$)
  • soc-orkut-dir and soc-orkut social networks ($\sim 3\text{ million}$ nodes each, $k=5$)

Prediction–target pairs are uniformly sampled at fixed tree distances $d$ to measure average query counts across all error regimes.

Key Insights and Ideas

  • General trees shatter the $O(\log \eta)$ dream: On a complete binary tree with $n$ leaves, if your prediction is a leaf, $\Omega(n)$ other leaves sit at distance $\Omega(\log n)$ away. Information theory dictates you need $\Omega(\log n)$ queries to distinguish them—meaning you end up doing $\Omega(\eta)$ work, no better than blindly walking step-by-step from the prediction!
  • Pathwidth is the exact right knob: You cannot avoid paying a penalty for bushiness, and the authors prove a matching lower bound using "stretched" binary trees: no deterministic or randomized algorithm can beat $\Omega(k \log \eta)$ expected queries across all pathwidth-$k$ trees.
  • "Free" worst-case robustness: In many learning-augmented problems, protecting against terrible predictions degrades good-case performance. Here, you can simply interleave queries between $k$-Spine Search and prediction-agnostic Centroid Search, strictly capping worst-case queries at $O(\min(\log n, k \log \eta))$.

Key Results

  • Theoretical Bounds: $k$-Spine Exponential Search deterministically locates the target in $O(k \log \text{dist}(s,t))$ queries, which is existentially optimal.
  • Empirical Sweet Spot: Across all four real-world trees, $k$-spine search carves out a clear winning zone between Naive Trace (walking directly from the hint, costing $d+1$ queries) and Centroid Search (ignoring the hint). It beats both baselines simultaneously for prediction errors of $d = 10\text{–}22$ (Luxembourg), $d = 10\text{–}43$ (sc-msdoor), $d = 10\text{–}53$ (soc-orkut-dir), and $d = 10\text{–}67$ (soc-orkut).
  • Outperforming Theory in Practice: Rough worst-case math suggests centroid search should overtake $k$-spine search around $d \approx |V|^{1/k}$ (roughly $8.6$ to $20$ across datasets). Empirically, $k$-spine search holds off the actual centroid baseline much longer—crossing over at $d = 23.0$, $43.6$, $53.7$, and $68.0$, respectively.

Limitations and Future Work

  • Small-Error Overhead: For tiny prediction errors ($d < 10$), naive trace is tough to beat because $k$-spine search pays a small initial setup overhead before spine searching kicks in.
  • Tree-Specific: The approach relies on unique paths and tree-specific spine decompositions, leaving more general cyclic graphs out of reach for now. Also, the experiments evaluate synthetic DFS spanning trees of real networks rather than natively occurring tree structures.
  • Future Work: The authors focus on single-point location hints; they highlight extending tree search to distributional predictions (where ML outputs a probability distribution over target nodes) as an exciting open problem.

Summary updated

BibTeX
@inproceedings{dong2026tree,
  author = {Bob Dong and Michael Dinitz},
  title = {{Tree Search With Predictions}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=V2S3XOjOz5},
}
Figure