Abstract
The emerging field of "Algorithms with Predictions" offers a powerful framework for combining traditional worst-case algorithms with modern machine learning. However, the vast majority of work in this space assumes that predictions are non-probabilistic single points. This is a poor fit for modern machine learning models, particularly neural networks, which naturally generate probability distributions. This paper initiates the study of algorithms with distributional predictions, focusing on the fundamental problem of binary search. The authors demonstrate that reducing distributions to point predictions is fundamentally flawed and propose a novel algorithm achieving an optimal query complexity of $O(H(p) + \log \eta)$, where $H(p)$ is the entropy of the true distribution and $\eta$ is the Earth Mover's Distance between the true and predicted distributions.
Introduction: The Problem with Point Predictions
Traditional algorithms are designed to handle worst-case scenarios, whereas machine learning (ML) excels at optimizing for the average case. "Algorithms with Predictions" attempts to bridge this gap by providing classical algorithms with "advice" from an ML model.
Until now, most research has assumed these predictions are single points (e.g., "the target key is at index 42"). However, modern ML naturally outputs distributions (e.g., "there is a 40% chance the key is near index 42 and a 30% chance it's near index 100").
The authors tackle a core algorithmic challenge: How do you perform binary search in a sorted array when your prediction is a probability distribution? Simply picking the most likely point (Maximum Likelihood Estimation) or sampling from the distribution can lead to terrible performance. If a distribution has two peaks that are far apart, picking one peak as a point prediction will result in $O(\log n)$ queries if the target is actually at the other peak—even if the model was highly confident the target was in one of those two locations. The challenge is to design an algorithm that is both "consistent" (performs perfectly if the prediction is right) and "robust" (does not fail catastrophically if the prediction is wrong).
Methodology: The Learned BST
To avoid the pitfalls of point-reduction, the authors propose an algorithm called the Learned Binary Search Tree (Learned BST). This algorithm interleaves two distinct phases in each iteration $i$ to balance exploiting the prediction and hedging against errors:
- Bisection Phase: The algorithm performs a "median" search based on the predicted distribution $\hat{p}$. It probes the element that splits the predicted probability mass in half and recurses. It executes this for $2^i$ steps.
- Binary Search at the Endpoints: To ensure robustness, the algorithm simultaneously checks small windows at the edges of the current search range using standard binary search. This prevents the algorithm from getting trapped in a low-probability region of the predicted distribution if the true key is located elsewhere.
Earth Mover’s Distance (EMD)
A key mathematical innovation in this work is using the Earth Mover’s Distance (EMD) to measure prediction error. Unlike $\ell_1$ distance or KL-divergence, EMD accounts for the geometry of the array. It recognizes that a prediction at index 10 is "closer" to a target at index 11 than a target at index 100. For sorted arrays, the cost of a mistake depends heavily on spatial distance, making EMD the ideal metric.
Key Findings and Results
Theoretical Optimality
By leveraging EMD, the authors prove that the Learned BST achieves a query complexity of $O(H(p) + \log \eta)$, where $H(p)$ is the entropy of the true distribution $p$ and $\eta$ is the EMD between $p$ and the predicted distribution $\hat{p}$.
Crucially, they complement this with a lower bound of $\Omega(H(p) + \log \eta)$, demonstrating that their algorithm's query complexity is essentially optimal up to constant factors. This breakthrough also yields the first distributionally-robust algorithm for the classical problem of computing an optimal binary search tree given a distribution over target keys.
Empirical Gains and Robustness
The researchers evaluated their approach using both synthetic data (with introduced "shift" errors) and real-world temporal network data from the Stanford Large Network Dataset Collection (StackOverflow, AskUbuntu, and SuperUser).
- Efficiency: On the AskUbuntu and SuperUser datasets, the Learned BST saved 20-25% of comparisons compared to classical binary search and other baselines.
- Robustness: Unlike naive bisection methods that blindly follow predictions, the Learned BST never performed significantly worse than classical binary search, even when the provided predictions were highly inaccurate.
Limitations and Future Directions
While asymptotically optimal, the Learned BST involves interleaving phases that add constant overhead. Improving these constants for practical implementation remains an open challenge. Furthermore, the current analysis focuses strictly on "query complexity" (the number of comparisons). In high-performance systems, the computational cost of calculating medians of a distribution at each step might outweigh the savings in comparisons unless the distribution is represented highly efficiently (e.g., as a piecewise linear function).
Finally, this paper focuses on a 1D sorted array. A natural and exciting next step is extending the framework of distributional predictions to more complex data structures, such as multi-dimensional spatial indexes or nearest-neighbor search algorithms.
Summary updated