Learning to Top-K Search using Pairwise Comparisons

Brian ErikssonAISTATS 2013

Abstract

Identifying the top-$k$ items in a large dataset is a fundamental task in recommendation systems and data analysis. However, obtaining a full ranking is often computationally expensive or practically impossible due to the $O(N^2)$ complexity of exhaustive pairwise comparisons. This paper presents two novel approaches: PathRank, a graph-based algorithm for passive, random sampling, and a Robust Adaptive Search strategy for active, noisy environments. Our methods significantly reduce the required number of comparisons while maintaining high accuracy, even when up to 40% of comparison results are incorrect.

Introduction

In many real-world fields—from tuning recommender systems to analyzing protein structures—ranking items is essential. Standard sorting algorithms like Quicksort can rank $N$ items in $O(N \log N)$ steps, but they typically assume "active" control over comparisons and "perfect" accuracy. In practice, researchers often face two major hurdles:

  1. Passive Observation: Access may be limited to a random, pre-existing subset of comparisons.
  2. Noisy Data: Human judges or automated sensors frequently provide incorrect comparison results (e.g., claiming item A > B when B > A).

This research explores how to efficiently find the top-$k$ items under these constraints, focusing on minimizing query complexity while maximizing robustness.

Methodology

PathRank: Pruning via Passive Sampling

When given a random subset of correct comparisons, we can model the items and their relationships as nodes and edges in a directed acyclic graph (DAG).

PathRank utilizes the length of paths in a comparison DAG to prune items that cannot be in the top-k.

The core logic of PathRank is simple: if there exists a path of length greater than $k$ starting from item $i$, then there are at least $k$ items ranked higher than $i$. Consequently, $i$ cannot be in the top-$k$. The algorithm performs a depth-first search from every node; if no path exceeds length $k$, the item remains in the candidate set. This allows for efficient pruning even with very sparse random samples.

Robust Adaptive Search: Handling Noisy Comparisons

For scenarios where we can choose which items to compare but expect errors, we introduce adaptiveReduce, a two-stage voting algorithm designed to be mathematically robust against high error rates (up to nearly 50% noise):

  • Stage 1 (Finding Pivots): We select "candidate voting items" and compare them against the entire set. Items at the extreme ends of the ranking are discarded as they lack discriminative power. The "middle" items are retained as a reliable voting bloc.
  • Stage 2 (Voting): These "middle" pivots vote on every other item. An item is retained if a majority of pivots rank it as "high." This process iterates, pruning the set until only the top $O(\log N)$ items remain. The adaptive method requires $O(N \log^2 N)$ comparisons to find the top $O(\log N)$ items, a significant improvement over exhaustive $O(N^2)$ searching.

Experimental Results

The proposed methods were validated using synthetic datasets with $N$ ranging from 1,000 to 1,000,000 items and error rates ($q$) of 10% and 40%.

Experimental results demonstrating the efficiency and noise tolerance of the adaptive search algorithm across different scales and error rates.

As shown in the table above, the robustAdaptiveSearch algorithm is highly efficient. For a set of 1,000,000 items with a 10% error rate, the top items were identified using only approximately 0.05% of all possible pairwise comparisons. Even with a 40% error rate, the algorithm successfully identified the top-ranked items, demonstrating significant robustness to noise.

Discussion and Future Work

A key insight of this work is the "Informative Middle": average items often provide more discriminative power and robustness than top-ranked items when used as pivots. Comparisons against "average" items provide more discriminative power and are more robust to noise than comparisons against outliers.

However, limitations remain. PathRank currently assumes zero errors; a single incorrect comparison could lead to the erroneous pruning of a top item. Additionally, the adaptive voting method relies on statistical concentration inequalities (like Hoeffding’s) that require large $N$ for reliability. Future research will focus on handling noise in passive sampling regimes and exploring non-uniform noise models where certain item pairs are inherently harder to compare.

Summary updated

BibTeX
@inproceedings{eriksson2013learning,
  author = {Brian Eriksson},
  title = {{Learning to Top-K Search using Pairwise Comparisons}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2013},
}
Figure