TL;DR
When comparing massive datasets, CMinHash saves memory and boosts accuracy by recycling a single random shuffle through circular shifts, rather than generating hundreds of new ones. However, the original math proving why it works was an intimidating tangle of combinatorics that couldn't easily be adapted to newer hashing algorithms. This paper reframes the problem as simple "marbles-in-a-bag" sampling, yielding clean, accurate variance formulas that unlock the circular-shift trick for a much wider family of similarity estimators.
What Problem Does This Paper Address?
Suppose you want to know how similar two massive sets are—say, all the words on two giant webpages. Computing their exact Jaccard similarity (the intersection divided by the union) is too slow when the universe of possible items ($D$) is enormous.
For decades, the standard shortcut has been MinHash: shuffle the universe using $K$ independent random permutations, check if both sets hit their first item at the same index, and average the results. Recently, CMinHash improved on this. Instead of storing $K$ independent permutations, it uses just two ($\sigma$ and $\pi$). It pre-shuffles the data with $\sigma$, then reuses $\pi$ $K$ times by shifting it one step to the right in a circle (a circulant permutation). Remarkably, because these shifted trials are slightly negatively correlated, CMinHash actually gives lower variance (better accuracy) than $K$ truly independent shuffles!
So what’s the catch? Because the shifted trials aren't independent, calculating the estimator's variance requires computing the covariance between shifts. The original CMinHash paper relied on grueling combinatorial sums under strict constraints (including one equality in the proof that doesn't hold in general). If you wanted to apply this neat circular-shift trick to any other MinHash variant, you were stuck facing a mathematical wall.
Methods
The authors tear down that wall with two major shifts in perspective:
- Sampling Without Replacement: Instead of wrestling with permutation algebra, they treat a permutation as the draw order when pulling marbles from a bag without replacement. Every index in the universe $D$ is categorized into one of three marble types: success (e.g., in both sets), failure (in only one set), or neutral (in neither). Finding the probability of a hash collision across two circular shifts becomes as intuitive as asking: What are the odds of drawing a blue marble before a red marble in both shifted views, completely ignoring the green neutral marbles?
- Large-$D$ Asymptotics: Exact combinatorial perfection isn't necessary because we only use MinHash when $D$ is huge anyway. Assuming $D \to \infty$, the authors use indicator random variables and the delta method to derive clean, closed-form approximate variance formulas for both sparse sets ($f/D \to 0$) and dense sets.
To prove their framework generalizes, they apply it to Minner estimators (used in asymmetric hashing, where one baseline set is compared against a database). Crucially, one Minner variant doesn't just check if a collision happens—it counts how many items from Set 1 appear before the first item of Set 2. Using indicator variables and exchangeability, the authors smoothly extend circulant variance analysis to count-based estimators for the first time.
Datasets
The authors evaluate their theoretical formulas against empirical simulations (averaged over 10,000 iterations) on:
- Synthetic binary vectors: Tested across a wide range of universe sizes ($D$ from 128 up to 4,096), set cardinalities, and overlaps to probe dense, sparse, and extreme edge cases.
- Words dataset: A standard real-world benchmark from natural language processing (introduced by Li & Church, 2005) representing word co-occurrences with a universe size of $D = 65,536$, including sparse word pairs like
HONG–KONG.
No new benchmarks are introduced.
Key Insights and Ideas
- Neutral elements wash out: Just as the odds of drawing 1 blue marble before 2 red marbles is always $1/3$ whether there are ten green marbles in the bag or ten million, framing permutations as sequential draws lets you ignore massive swaths of empty data during probability calculations.
- Clean scaling laws: For non-sparse sets, CMinHash scales down the variance of standard MinHash by a remarkably clean first-order factor of roughly $1 - \frac{K-1}{2D - f - 1}$ (where $f$ is the union size). Notice that the intersection size doesn't even appear in that ratio!
- A universal template: Almost any MinHash variant can be phrased as "stop at the $s$-th success, do something at a failure, and ignore neutrals." Conditioning on the failure elements makes analyzing new circulant estimators plug-and-play.
Key Results
Even though the variance formulas are technically asymptotic ($D \to \infty$), they work shockingly well on tiny dimensions.
- Standard CMinHash: As shown in the plots above, at a modest $D = 128$ and $D = 256$, the theoretical approximate variance (dotted red lines) overlaps almost perfectly with the empirical Mean Squared Error (solid red lines). In extreme sparse edge cases (like $f = 2$ or $4$ at $D = 128$), the formula slightly overestimates MSE, but by $D = 1,024$, the match is virtually exact.
- Count-based Minner Estimators: The authors prove asymptotically that circulant shifts always reduce variance for count-based Minner estimators too. On synthetic data ($D = 512$ to $4,096$) and the real-world Words dataset ($D = 65,536$), the theoretical curves tightly hug empirical MSE—even when sparsity hits $\frac{41}{65536}$ on the
HONG–KONGpair.
Limitations and Future Work
- Limitations: The variance expressions are approximations that rely on $D$ being sufficiently large. For very small $D$ (e.g., $D = 128$) combined with very sparse sets, the approximation noticeably deviates from empirical MSE. However, in real-world hashing applications, $D$ is typically on the order of $2^{32}$ or larger—well into the regime where these approximations shine.
- Future Work: While the paper demonstrates its framework on CMinHash and Minner, the authors point out that their indicator-variable technique can directly extend circulant permutations to estimators that stop at the "$s$-th success" (like bottom-$k$ sketches) or perform more complex operations along the draw sequence.
Summary updated