Abstract: We consider machine learning in a comparison-based setting where we are given a set of points in a metric space, but we have no access to the actual distances between the points. Instead, we can only access an oracle that provides triplet comparisons: "Is point A closer to B than it is to C?" We propose a simple, randomized data structure called the Comparison Tree that achieves logarithmic search time and competitive accuracy, even outperforming some traditional methods that have access to full coordinate data.
Introduction
Most nearest neighbor (NN) search algorithms, such as KD-Trees, rely on knowing the exact coordinates of points or the numerical distances between them. However, in many real-world scenarios—especially in crowdsourcing or psychology—we only have relative information. For example, a human might easily say that a "husky" looks more like a "wolf" than a "poodle," but they cannot assign a precise numerical distance to those relationships.
The challenge addressed in this work is building an efficient data structure for NN search using only these relative triplet comparisons. We aim to prove that such a structure can be both fast (logarithmic height) and accurate without needing to embed the data into a Euclidean space first.
Methodology: The Comparison Tree
The authors focus on a data structure called the Comparison Tree. Its construction is elegantly simple and follows a recursive partitioning strategy:
- Pivot Selection: For a given set of points, randomly select two "pivot" points, $x_1$ and $x_2$.
- Partitioning: Split all other points into two sets: those closer to $x_1$ and those closer to $x_2$. This only requires asking the oracle triplet comparisons of the form $d(x, x_1) \le d(x, x_2)$.
- Recursion: Repeat this process for each subset until the number of points in a leaf is below a threshold $n_0$.
To find a neighbor for a new query point, the algorithm performs a "defeatist search": it starts at the root, compares the query to the two pivots, moves to the closer side, and repeats until it hits a leaf, where it performs an exhaustive search. The paper's major theoretical contribution is proving that if the metric space satisfies a "strong expansion rate" condition, the tree remains balanced with high probability, leading to $O(\log n)$ search complexity.
Empirical Evaluation
The authors evaluated the Comparison Tree (Comp-Tree) on a diverse set of datasets, including Euclidean metrics (MNIST, Gisette, CoverType, Corel) and non-Euclidean metrics (Chess, CoAuth, MSC).
Accuracy vs. Traditional Trees
Despite having significantly less information than Euclidean trees (like KD-Trees or PA-Trees), the Comparison Tree's accuracy was surprisingly competitive. In several cases, it exhibited less error than the RP-Tree and KD-Tree, which utilize full coordinate information.
Efficiency vs. Comparison-Based Baselines
Compared to the Rank Cover Tree (RCT), the Comparison Tree is essentially a "metric version" of Quicksort. While the RCT is complex to build, the Comp-Tree requires $O(n \log n)$ triplet comparisons to build and $O(\log n)$ to search. In experiments, the Comp-Tree required orders of magnitude fewer triplet comparisons during the construction phase than the RCT while maintaining comparable distance error.
Key Insights and Discussion
- Simplicity and Randomness: By picking pivots uniformly at random, the algorithm avoids complex geometric heuristics while ensuring the tree doesn't become too deep.
- The Defeatist Trade-off: The search is "defeatist" because it never backtracks, making it incredibly fast ($O(\log n)$) at the cost of a small probability of error. This error decreases as the leaf size ($n_0$) increases.
- No Embedding Needed: This approach demonstrates that one can skip the expensive step of ordinal embedding into $\mathbb{R}^d$ and work with comparisons directly.
Limitations and Future Work
The theoretical proofs rely on the "strong expansion rate" condition, which may be restrictive for some high-dimensional datasets. Additionally, because the algorithm doesn't backtrack, it can get "stuck" in the wrong branch early on. Future work could explore "spill trees" or forests to increase accuracy. Finally, the current model assumes triplet comparisons are always correct; investigating robustness to "noisy" human comparisons is a vital next step.
Summary updated