---
title: 'One-Permutation MinHash: Efficient Jaccard Estimation'
url: https://www.emergentmind.com/topics/one-permutation-minhash
type: topic
---

# One-Permutation MinHash: Efficient Jaccard Estimation

to=arxiv_search.search  北京赛车女郎  天天中彩票有人?
{"query":"\"one permutation hashing\" minhash arXiv", "max_results": 10}
to=arxiv_search.search 】【。】【”】【json
{"query":"one permutation hashing minhash", "max_results":5, "sort_by":"relevance"}
to=arxiv_search 】【。】【”】【json
{"query":"one permutation hashing minhash", "max_results":5}
One-Permutation MinHash denotes a family of minwise-hashing methods that estimate Jaccard similarity while avoiding the \(K\) independent random permutations required by classical MinHash. In the canonical formulation introduced as One-Permutation Hashing (OPH), one applies a single permutation to the feature universe, partitions the permuted coordinates into \(k\) equal-sized bins, and stores the minimum nonzero location in each bin; later work developed densification schemes for empty bins, search and learning variants, privacy-preserving forms, and a distinct circulant line in which one permutation is reused for both structure-breaking and hash generation [1208.1259][2109.04595].

## 1. Classical formulation and the one-permutation objective

For sets \(S_1,S_2 \subseteq \Omega\) with \(|\Omega|=D\), or equivalently for binary vectors \(v,w \in \{0,1\}^D\), the target similarity is the Jaccard similarity
\[
R = \frac{|S_1 \cap S_2|}{|S_1 \cup S_2|}
\quad\text{or}\quad
J(v,w)=\frac{|v\wedge w|}{|v\vee w|}.
\]
Classical MinHash draws \(k\) or \(K\) independent permutations \(\pi_1,\ldots,\pi_k\) and computes \(h_j(S)=\min \pi_j(S)\). The estimator
\[
\hat R_M = \frac{1}{k}\sum_{j=1}^k I\{h_j(S_1)=h_j(S_2)\}
\]
is unbiased, with collision probability equal to resemblance and variance \(R(1-R)/k\) [1208.1259].

The motivation for one-permutation methods is computational and storage cost. The standard implementation of MinHash requires applying \(K\) random permutations, which is expensive in preprocessing, expensive at test time for previously unseen points, and costly to store when \(D\) and \(K\) are large [1208.1259][2109.04595]. One-permutation methods attempt to preserve the collision-probability semantics of MinHash while reducing the permutation budget from \(K\) to one.

Two distinct lines appear in the literature. The first is OPH, introduced by Li, Owen, and Zhang, which uses one global permutation and bin-wise minima [1208.1259]. The second is one-permutation circulant MinHash, denoted C-MinHash-\((\pi,\pi)\), which reuses the same permutation for an initial “structure-breaking” shuffle and for \(K\) circulant shifts [2109.04595]. The later C-OPH work states explicitly that C-MinHash is different from the well-known OPH method published in NIPS’12 [2111.09544].

## 2. The original One-Permutation Hashing construction

In OPH, one applies a single permutation \(\pi\) to the universe and divides the permuted coordinates evenly into \(k\) bins. With \(D\) divisible by \(k\), let \(m=D/k\) and define
\[
\text{Bin}_j = \{j\cdot m,\ldots,(j+1)\cdot m-1\}, \qquad j=0,\ldots,k-1.
\]
For a set \(S\), the signature \(H[0..k-1]\) stores, in each bin, the smallest nonzero residue within that bin; if no element of \(S\) falls into a bin, the bin is marked by the empty symbol \(*\) [1208.1259].

This construction yields a bin-wise analogue of MinHash. Fix a bin and let \(A\) and \(B\) be the elements of \(S_1\) and \(S_2\) in that bin. If the bin is nonempty for both sets, the smallest permuted item in \(A\cup B\) is equally likely to be any element of that union, so the probability that the two bin-wise minima agree is \(|A\cap B|/|A\cup B|\). The OPH analysis shows that any surviving bin’s min-collision probability equals the global resemblance \(R\), regardless of which bin survives [1208.1259].

The standard OPH estimator is based on matched nonempty bins. Let \(N_{\text{emp}}\) be the number of simultaneously empty bins and \(N_{\text{mat}}\) the number of bins in which both signatures are nonempty and the minima agree. Then
\[
\hat R_{\text{one}} = \frac{N_{\text{mat}}}{k-N_{\text{emp}}}
\]
is unbiased:
\[
E[\hat R_{\text{one}}]=R.
\]
Its variance is
\[
\operatorname{Var}(\hat R_{\text{one}})
=
R(1-R)\cdot E\!\left[\frac{1}{k-N_{\text{emp}}}\right]
-
\frac{1}{f-1}R(1-R)\cdot
\left(1-E\!\left[\frac{1}{k-N_{\text{emp}}}\right]\right),
\]
where \(f=|S_1\cup S_2|\). When \(f\gg k\), this approaches \(R(1-R)/k\), and in fact the paper shows
\[
\operatorname{Var}(\hat R_{\text{one}})\le \frac{R(1-R)}{k},
\]
so the one-permutation estimator has no higher variance and is often slightly smaller because of a “sample-without-replacement” effect [1208.1259].

The same work also situates OPH within the b-bit MinHash setting: one often stores only the lowest \(b\) bits of each hash value, yielding b-bit MinHash without changing the underlying collision probability [1208.1259].

## 3. Empty bins and densification

The central technical complication in OPH is the presence of empty bins. In sparse data many bins contain no nonzero entries, so direct bin-wise comparison either wastes information or introduces bias. The later OPH literature describes densification as the procedure that refills empty bins by borrowing hashes from nonempty bins, thereby restoring an unbiased estimator, while also noting that poor densification can create dependencies that increase variance [2111.09544].

Shrivastava and Li’s original densification scheme assigns each empty bin the value of the nearest non-empty bin to its right, wrapping around circularly, and adds an offset \(C=D/k+1\) to prevent spurious collisions. This construction preserves the LSH property:
\[
\Pr[\mathcal H_j(S_1)=\mathcal H_j(S_2)] = R.
\]
Its query cost remains \(O(d+k)\), where \(d\) is the number of nonzeros in the query vector, but its variance is affected by a randomness-deficiency phenomenon: when there are \(m\) non-empty bins, two empty bins borrow from the same non-empty bin with probability \(p=2/(m+1)\) [1406.4784].

The improved densification method injects additional randomness by assigning each bin an independent fair coin \(q_j\). When a bin is empty, the algorithm looks either left or right, circularly, according to \(q_j\). This reduces the corresponding empty-empty borrowing probability to
\[
p^+ = \frac{1.5}{m+1},
\]
while preserving the same LSH property. The resulting estimator satisfies
\[
\operatorname{Var}(\hat R^+) \le \operatorname{Var}(\hat R),
\]
with the variance gap given explicitly by
\[
\operatorname{Var}(\hat R)-\operatorname{Var}(\hat R^+)
=
\mathbb E\Bigl[\frac{N_{\text{emp}}(N_{\text{emp}}-1)}{2k^2(k-N_{\text{emp}}+1)}(R-R\tilde R)\Bigr]\ge 0,
\]
where \(\tilde R\) is defined in the paper. The cost remains \(O(d+k)\), and the only additional storage is \(k\) coin bits [1406.4784].

A separate taxonomy appears in the differential privacy treatment of OPH. That work describes three densification strategies. In OPH-fix, each empty bin copies the raw hash of a uniformly chosen non-empty bin. In OPH-re, an empty bin chooses a non-empty bin and re-hashes it under a fresh partial permutation induced by the empty bin. In OPH-rand, each empty bin is filled by a uniformly random value from the hash-value universe. The paper states that all unbiased densifications guarantee
\[
E\bigl[1\{h_k(u)=h_k(v)\}\bigr]=J(u,v),
\]
so that the corresponding OPH estimator remains unbiased [2306.07674].

## 4. Computational profile and empirical behavior

The principal advantage of OPH is the reduction in preprocessing and query cost. Standard \(k\)-permutation MinHash requires \(O(k\cdot \mathrm{nnz})\) preprocessing, stores \(k\) permutations or hash functions, and requires \(O(k\cdot \mathrm{nnz}_{\text{query}})\) work for a new query. One-permutation hashing requires one global permutation and one pass over the nonzeros, giving \(O(\mathrm{nnz})\) preprocessing, \(O(\mathrm{nnz}_{\text{query}})\) query time, and a reduction in random-seed storage from \(O(kD)\) to \(O(D)\), or to one universal hash in approximate implementations [1208.1259].

The OPH formulation in the privacy paper makes the same point in vector notation. For \(u\in\{0,1\}^D\) with \(f=\|u\|_0\), standard MinHash costs \(O(K\cdot f)\) per vector if the \(K\) hashes are applied only to the nonzeros. OPH pays \(O(D)\) once up front to generate or store \(\pi\), then \(O(f)\) to route the nonzeros into bins and update the bin minima, and \(O(K)\) to densify empties. The total is roughly \(O(f+K)\simeq O(f)\) when \(f\gg K\), which the paper describes as about a \(K\)-fold speedup over classical MinHash [2306.07674].

The original empirical study evaluated OPH in large-scale linear learning. On the Webspam dataset, with \(n=350\,K\), \(D\approx 16\,M\), and average \(\mathrm{nnz}\approx 4\,K\), the original data achieved accuracy \(\approx 98.8\%\). The \(k\)-permutation baseline with \(k=512,b=8\) achieved \(\approx 98.7\%\) accuracy and preprocessing time \(\approx 6{,}000\,\mathrm{s}\), whereas one-permutation hashing with the same \(k\) and \(b\) achieved \(\approx 98.8\%\) accuracy with preprocessing time \(\approx 10\,\mathrm{s}\). On the sparse News20 dataset, with average \(\mathrm{nnz}\approx 500\), one-permutation hashing with zero-coding remained stable and at \(k=4096,b=8\) recovered \(\approx 98\%\) accuracy, outperforming the \(k\)-permutation scheme by up to \(0.5\%\) [1208.1259].

These results support the original claim that one permutation hashing can perform very similarly to the original \(k\)-permutation MinHash and can even be slightly more accurate on sparse data. The papers attribute this to the sample-without-replacement effect and to careful handling of empty bins [1208.1259][1406.4784].

## 5. One-permutation circulant MinHash

A later development revisited the permutation budget from a different angle. C-MinHash first showed that two permutations suffice for standard MinHash: one permutation \(\sigma\) breaks existing structure in the data, and a second permutation \(\pi\) is reused \(K\) times in a circulant-shifting fashion. The two-permutation version was proved unbiased and to have variance strictly smaller than the variance of classical MinHash [2109.04595].

The one-permutation version, C-MinHash-\((\pi,\pi)\), reuses the same permutation for both roles. For a binary vector \(v\in\{0,1\}^D\), one first computes \(v'=\pi(v)\), with
\[
v'_j = v_{\pi^{-1}(j)}.
\]
For \(k=1,\ldots,K\), the \(k\)-shifted permutation is defined by
\[
\pi_{\to k}(i)=\pi\bigl(((i-k-1)\bmod D)+1\bigr),
\]
and the \(k\)th hash is
\[
h_k(v)=\min\{\pi_{\to k}(i): v'_i=1\}.
\]
Given two vectors \(v,w\), the estimator is
\[
\hat J_{\pi,\pi}=\frac{1}{K}\sum_{k=1}^K 1\{h_k(v)=h_k(w)\}.
\]
Unlike classical MinHash and the two-permutation C-MinHash, this estimator is slightly biased. The paper derives an explicit closed-form hypergeometric-sum expression for each collision probability \(P[h_k(v)=h_k(w)]\), proves
\[
\mathrm{Bias}=E[\hat J_{\pi,\pi}]-J = O(1/D)
\]
for fixed sparsities, and reports numerically that \(|\mathrm{Bias}|\lesssim 10^{-3}\) or smaller even for moderate \(D\). Because the \(K\) terms alternate around \(J\), the average bias shrinks further with \(K\), and empirically \(\mathrm{bias}^2 \ll \operatorname{Var}(\hat J_{\pi,\pi})\), so \(\mathrm{MSE}\simeq \operatorname{Var}\) [2109.04595].

The empirical conclusion is that
\[
\operatorname{Var}(\hat J_{\pi,\pi}) < \frac{J(1-J)}{K}
\]
and closely matches the variance of the two-permutation C-MinHash estimator. Storage is reduced to one permutation vector of length \(D\), and the per-vector cost is \(O(D+Kf)\), where \(f\) is the number of nonzeros after preprocessing [2109.04595]. The later C-OPH paper emphasizes that this circulant construction is not the same as OPH: OPH is a bin-splitting method, whereas C-MinHash is a circulant reuse of one or two permutations within a MinHash-style framework [2111.09544].

## 6. Extensions and domain-specific adaptations

One major extension is C-OPH, which transfers the circulant idea into the OPH setting. After an initial full-length permutation \(\sigma\) partitions the coordinates into \(K\) equal-sized bins of length \(d=D/K\), C-OPH uses a single short permutation \(\pi\) on \([d]\) and reuses it across bins via circulant shifts \(\pi_{\to k}\). When a bin is nonempty, the algorithm applies the shifted short permutation within that bin; when a bin is empty, it densifies by choosing a nonempty bin uniformly at random and applying the same shifted short permutation there. The resulting estimator \(\hat R=(1/K)\sum_{k=1}^K C_k\) is unbiased. Its variance is given in the paper through a decomposition involving the number of empty bins \(N_{\text{emp}}\), the number of nonempty bins \(m=K-N_{\text{emp}}\), and a term \(E_1\) for two empty-bin collisions. The key comparison is that, for ReDen, \(E_1^{\text{ReDen}}=J\tilde J\), whereas in C-OPH the circulant reuse yields \(E_1^{\text{COPH}}<J\tilde J\), implying
\[
\operatorname{Var}_{\text{COPH}} < \operatorname{Var}_{\text{ReDen}}.
\]
On the Words dataset, C-OPH\((\sigma,\pi)\) outperformed ReDen by \(10\)–\(30\%\) relative MSE reduction across a range of \(J\), and replacing \(\sigma\) by \(2\)-universal hashing achieved virtually identical MSE [2111.09544].

A second extension concerns early termination in similarity search and multimedia near-duplicate detection. Group-based One-Permutation Hashing (GOPH) groups the \(k\) bins and applies Binomial-tail tests for early accept or reject. Hierarchical OPH (HOPH) recursively partitions the universe with split ratio \(a:b\), applies OPH at multiple levels, and uses the same type of Binomial screening to stop early on low-similarity pairs. The paper proves that the OPH estimator is unbiased, that the GOPH early-stop tests respect the prescribed error tolerance \(\epsilon\), and that the HOPH estimator is unbiased. In experiments on the FS dataset, response times were \(138.4\,\mathrm{s}\) for MinHash with \(k=400\), \(95.2\,\mathrm{s}\) for OPH with \(k=400\), \(45.8\,\mathrm{s}\) for GOPH, and \(24.3\,\mathrm{s}\) for HOPH with a \(1{:}1\) split; all methods maintained \(>98\%\) precision and \(\sim 100\%\) recall at \(T\ge 0.7\) [1805.11254].

A third extension is differential privacy. The DP-OPH framework combines OPH with \((\epsilon,\delta)\)-DP and includes three variants, DP-OPH-fix, DP-OPH-re, and DP-OPH-rand, corresponding to the three densification strategies. The same paper extends the construction to bin-wise consistent weighted sampling for non-binary data, producing DP-BCWS. The experimental summary states that DP-BCWS achieves excellent utility at around \(\epsilon = 5\sim 10\) on classification tasks [2306.07674].

Across these lines, the unifying idea remains the same: replace many independent permutations by a single permutation or a single reusable permutation structure, while preserving exact or near-exact Jaccard estimation, reducing preprocessing cost, and controlling the dependence introduced by binning or circulant reuse.

Source: https://www.emergentmind.com/topics/one-permutation-minhash