Skip to main content
QUICK REVIEW

[Paper Review] Exact Weighted Minwise Hashing in Constant Time

Anshumali Shrivastava|arXiv (Cornell University)|Feb 26, 2016
Advanced Image and Video Retrieval TechniquesComputer Science20 references7 citations
TL;DR

This paper proposes an exact weighted minwise hashing algorithm that computes k independent, unbiased hashes in O(k) time—constant amortized per hash—instead of the O(dk) time required by Ioffe's method, where d is the number of non-zero elements. The approach uses a novel hash function based on uniform random variables and bit-level operations, achieving up to 60,000× speedup on real datasets with only 5–9 bits per hash, compared to 64 bits in prior methods, while preserving exact collision probability matching the Jaccard similarity.

ABSTRACT

Weighted minwise hashing (WMH) is one of the fundamental subroutine, required by many celebrated approximation algorithms, commonly adopted in industrial practice for large scale-search and learning. The resource bottleneck of the algorithms is the computation of multiple (typically a few hundreds to thousands) independent hashes of the data. The fastest hashing algorithm is by Ioffe \cite{Proc:Ioffe_ICDM10}, which requires one pass over the entire data vector, $O(d)$ ($d$ is the number of non-zeros), for computing one hash. However, the requirement of multiple hashes demands hundreds or thousands passes over the data. This is very costly for modern massive dataset. In this work, we break this expensive barrier and show an expected constant amortized time algorithm which computes $k$ independent and unbiased WMH in time $O(k)$ instead of $O(dk)$ required by Ioffe's method. Moreover, our proposal only needs a few bits (5 - 9 bits) of storage per hash value compared to around $64$ bits required by the state-of-art-methodologies. Experimental evaluations, on real datasets, show that for computing 500 WMH, our proposal can be 60000x faster than the Ioffe's method without losing any accuracy. Our method is also around 100x faster than approximate heuristics capitalizing on the efficient "densified" one permutation hashing schemes \cite{Proc:OneHashLSH_ICML14}. Given the simplicity of our approach and its significant advantages, we hope that it will replace existing implementations in practice.

Motivation & Objective

  • To address the high computational cost of generating multiple independent weighted minwise hashes in large-scale data applications.
  • To eliminate the O(dk) time complexity of Ioffe’s exact method, which requires multiple passes over high-dimensional sparse data.
  • To reduce memory usage by minimizing hash value storage from 64 bits to just 5–9 bits per hash without sacrificing accuracy.
  • To develop a method that is both theoretically exact and practically efficient, enabling widespread adoption in big-data systems.

Proposed method

  • Introduces a novel hash function that maps each non-zero element to a hash value using a uniform random variable and bit-level operations.
  • Employs a two-step process: first, assign each non-zero element a random value from a uniform distribution; second, compute the minimum hash value across all elements.
  • Uses bit-level truncation and normalization to compress hash values into 5–9 bits while preserving exact collision probability.
  • Derives theoretical bounds showing that the collision probability of the proposed scheme exactly matches the Jaccard similarity, ensuring unbiased estimation.
  • Leverages the fact that the minimum of independent uniform variables follows a known distribution, enabling efficient and exact sampling.
  • Optimizes for constant-time amortized complexity by precomputing and reusing random values across multiple hash functions.

Experimental results

Research questions

  • RQ1Can weighted minwise hashing be computed in constant time per hash, independent of data sparsity?
  • RQ2Is it possible to reduce hash storage from 64 bits to under 10 bits while maintaining exact collision probability?
  • RQ3Can the proposed method achieve significant speedups over Ioffe’s O(dk) method without introducing bias?
  • RQ4How does the accuracy of the proposed scheme compare to Ioffe’s exact method and approximate heuristics in practice?

Key findings

  • The proposed method achieves up to 60,000× speedup over Ioffe’s method when computing 500 hashes on the Oxford dataset, with identical accuracy.
  • On the Caltech101 dataset, the method is 1,500 to 70,000× faster than Ioffe’s method, depending on data sparsity.
  • Hash values are confined to a small range (e.g., [1,107] for Web-Images), requiring only 7–9 bits per hash, a 5–6× reduction in memory usage.
  • The mean hash values observed in experiments align with the theoretical prediction in Theorem 2, validating the distributional correctness of the method.
  • Estimation accuracy is indistinguishable from Ioffe’s exact method, with average errors in Jaccard similarity estimation remaining identical across k=1 to 50 hashes.
  • The method outperforms approximate heuristics like Fast-WDOPH by 5–100× in speed while maintaining exactness, unlike biased approximations.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.