C-MinHash: Rigorously Reducing K Permutations to Two

Xiaoyun Li, Ping LiarXiv 2021

Abstract

Minwise Hashing (MinHash) is a foundational technique for estimating Jaccard similarity in large-scale datasets. Traditionally, achieving high accuracy requires $K$ independent random permutations, which imposes significant computational and memory overhead. This paper introduces C-MinHash (Circulant MinHash), a novel approach that reduces the required number of permutations to just two. By employing a circulant shifting mechanism, C-MinHash is rigorously proven to be unbiased and to achieve strictly lower variance than classical MinHash across all similarity ranges.

Introduction

In massive data processing, identifying similar items—such as duplicate web pages or related news articles—is critical. MinHash has long been the standard for estimating Jaccard similarity without exhaustive pairwise comparisons. However, the "MinHash tax"—the need for hundreds or thousands of independent permutations—creates bottlenecks in memory and computation, especially on hardware like GPUs where memory is at a premium. While previous attempts have sought to reduce this overhead, they often sacrificed accuracy or failed to maintain essential mathematical properties like the triangle inequality. C-MinHash addresses these challenges by proving that only two permutations are necessary for superior performance.

Methods: The Circulant Trick

C-MinHash operates through a two-step process that leverages the properties of circulant matrices to generate $K$ hash values from only two initial permutations, $\sigma$ and $\pi$.

  1. Initial Shuffle ($\sigma$): The data vector is first permuted by $\sigma$. This step ensures "location independence," breaking any inherent structure in the dataset and making the algorithm robust across diverse data types.
  2. Circulant Shifting ($\pi$): A second permutation $\pi$ is applied. Instead of generating $K-1$ additional permutations, the algorithm circulantly shifts $\pi$ to produce $K$ correlated hashes.
Figure 1: Illustration of the circulant shift mechanism used in C-MinHash to generate multiple hash values from a single permutation.

Although the resulting hashes are correlated, the authors use combinatorial proofs to demonstrate that this specific correlation structure is a feature rather than a bug. It leads to a more stable and accurate estimate than independent samples.

Results and Discussion

The theoretical core of the paper is the proof of "Uniform Superiority." Theorem 3.4 establishes that the variance of the C-MinHash estimator is always lower than that of standard MinHash for any Jaccard similarity $J \in [0, 1]$.

Figure 3: Variance comparison between standard MinHash (dashed line) and C-MinHash (solid blue lines) for different values of K. C-MinHash consistently achieves lower variance across the entire range of Jaccard similarity.

Empirical evaluations on datasets like MNIST, CIFAR, NIPS, and BBC News confirm these findings. C-MinHash consistently yields lower Mean Absolute Error (MAE) compared to classical MinHash. Furthermore, the reduction from $K$ permutations to 2 significantly decreases memory requirements—for instance, reducing the storage of 1024 permutation vectors to just 2—which is a major advantage for high-performance computing environments.

Conclusion

C-MinHash represents a significant theoretical and practical advancement in similarity estimation. By proving that $K$ independent permutations are redundant and that a circulant correlation structure actually improves accuracy, the authors provide a more efficient and precise tool for big data analytics. Future work may extend this circulant approach to other hashing families, such as SimHash, and explore its impact on real-time large-scale search systems.

Summary updated

BibTeX
@misc{li2021c,
  author = {Xiaoyun Li and Ping Li},
  title = {{C-MinHash: Rigorously Reducing K Permutations to Two}},
  year = {2021},
  eprint = {2109.03337},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.03337},
}
Figure