Researchers proposed a fast two-stage approximate Top-K algorithm to address the Top-K selection problem, where the goal is to identify the largest-K elements from an array.
The algorithm involves partitioning the input array, selecting the top-1 element from each partition, sorting the smaller subset, and returning the top K elements.
A generalized version of the algorithm was considered, allowing the selection of top-K' elements from each partition, where 1 ≤ K' ≤ K.
Implementing the algorithm on Cloud TPUv5e resulted in around an order of magnitude speedups over the original algorithm on real-world tasks while maintaining the same expected recall.