A Super Fast K-means for Indexing Vector Embeddings
This provides a faster clustering solution for indexing vector embeddings, which is incremental as it builds on existing k-means methods with optimizations.
The paper tackles the problem of slow k-means clustering for high-dimensional vector embeddings by introducing SuperKMeans, which achieves up to 7x faster clustering than FAISS and Scikit-Learn on CPUs and up to 4x faster than cuVS on GPUs while maintaining centroid quality for similarity search.
We present SuperKMeans: a k-means variant designed for clustering collections of high-dimensional vector embeddings. SuperKMeans' clustering is up to 7x faster than FAISS and Scikit-Learn on modern CPUs and up to 4x faster than cuVS on GPUs (Figure 1), while maintaining the quality of the resulting centroids for vector similarity search tasks. SuperKMeans acceleration comes from reducing data-access and compute overhead by reliably and efficiently pruning dimensions that are not needed to assign a vector to a centroid. Furthermore, we present Early Termination by Recall, a novel mechanism that early-terminates k-means when the quality of the centroids for retrieval tasks stops improving across iterations. In practice, this further reduces runtimes without compromising retrieval quality. We open-source our implementation at https://github.com/cwida/SuperKMeans