← Latest papers
🤖 machine learning

Prof-K: Probabilistic One-Pass Filtering for Efficient Top-k Selection

The paper introduces Prof-K, a fast, scalable, and distribution-agnostic one-pass algorithm for top-k selection that uses probabilistic sampling to guarantee correctness with high probability while achieving significant speedups over existing methods, particularly in large-scale scenarios.

Original authors: Tadeusz Dziarmaga, Witold Sikora, Łukasz Struski, Jacek Tabor, Marcin Mazur

Published 2026-08-14
📖 4 min read☕ Coffee break read

Original authors: Tadeusz Dziarmaga, Witold Sikora, Łukasz Struski, Jacek Tabor, Marcin Mazur

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are standing in front of a massive, chaotic library containing billions of books. You don't need to read them all; you just need to find the top 100 most interesting ones to put on a special display shelf. In the world of computer science, this is called "Top-k selection." It's a fundamental task that happens everywhere, from organizing search results on the internet to helping artificial intelligence decide which thoughts to focus on and which to ignore. As our digital data grows into mountains of information, the computers tasked with finding these "top" items are getting overwhelmed. Traditional methods try to sort through every single book to be absolutely sure, which is slow and exhausting. Other methods try to guess which books are good based on patterns, but they can get tricked by weird or tricky data. The big question for scientists is: How can we find the best items quickly without getting lost in the noise or making mistakes?

Enter Prof-K, a new method introduced by researchers Tadeusz Dziarmaga and his team at Jagiellonian University. Think of Prof-K as a clever, super-fast librarian who doesn't try to read every book. Instead, the librarian grabs a tiny, random handful of books from the shelves to get a "vibe" of the library. Based on this small sample, they set a "cutoff line"—a threshold of quality. Then, they do a single, lightning-fast pass through the entire library, only picking up books that are clearly above that line and tossing the rest. Finally, they do a careful, exact check only on the small pile of books they actually picked up. The magic of Prof-K is that it uses math to prove that, with very high probability, the true "top 100" books will almost certainly be in that small pile, even if the library contains books with weird, unpredictable, or "adversarial" content.

The researchers found that this approach is incredibly efficient. In their tests, Prof-K was 1.5 to 10 times faster than the highly optimized standard tools currently used by computers (like PyTorch's topk and a tool called RadiK). The biggest wins happened when the library was huge (billions of items) but the number of items needed to keep was relatively small. Unlike older methods that might fail if the data was messy or skewed, Prof-K's guarantees hold true regardless of how the data is distributed. It's like having a filter that works just as well whether the books are neatly organized or thrown in a pile.

Furthermore, the team showed that this speed doesn't come at the cost of quality. When they used Prof-K to train a specific type of AI model called a "Sparse Autoencoder" (which helps AI learn efficient ways to represent data), the model learned just as well as it did with the slower, exact methods. The AI's ability to reconstruct information and its "sparsity" (how focused it is) remained unchanged. In fact, by using Prof-K, the training process became slightly faster overall, shaving off about 4.25% of the total time needed for a long training run. While that might sound small, in the world of training massive AI models, that time adds up to hours of saved computing power.

The paper also provides a mathematical "recipe" for how to set up this filter. The researchers calculated that the ideal size for that initial random sample of books grows slowly—specifically, it scales with the cube root of the total number of items multiplied by the number of items you want to keep. This means even for a library with a billion books, you only need to peek at a tiny fraction (around 4,600 books in their example) to set a reliable cutoff. If the filter accidentally lets in too many or too few books, the system has a safety net: it can instantly switch back to the slow, exact method to ensure nothing is missed.

In short, Prof-K offers a way to make AI and data processing systems faster and more robust without sacrificing accuracy. It turns a problem that usually requires checking everything into a problem that only requires checking a smartly selected few, proving that sometimes, a little bit of randomness and a single pass through the data is all you need to find the best of the best.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →