[论文解读] Exact Weighted Minwise Hashing in Constant Time
本文提出了一种精确加权 minwise 哈希算法,可在 O(k) 时间内计算出 k 个独立且无偏的哈希值——每个哈希值的摊销时间恒定——而非 Ioffe 方法所需的 O(dk) 时间,其中 d 为非零元素的数量。该方法基于均匀随机变量和位级操作设计了一种新型哈希函数,在真实数据集上仅使用每哈希 5–9 位(相比之前方法的 64 位)即可实现高达 60,000× 的加速,同时精确匹配 Jaccard 相似度的碰撞概率。
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.
研究动机与目标
- 解决在大规模数据应用中生成多个独立加权 minwise 哈希所导致的高计算成本问题。
- 消除 Ioffe 精确方法中 O(dk) 的时间复杂度,该方法需对高维稀疏数据进行多次遍历。
- 通过将哈希值存储从 64 位减少至仅 5–9 位,降低内存使用量,同时不损失准确性。
- 开发一种在理论上精确且在实践中高效的算法,使其可在大数据系统中广泛采用。
提出的方法
- 引入一种新型哈希函数,利用均匀随机变量和位级操作将每个非零元素映射为哈希值。
- 采用两步流程:首先,为每个非零元素分配一个来自均匀分布的随机值;其次,计算所有元素中的最小哈希值。
- 通过位级截断和归一化,将哈希值压缩至 5–9 位,同时保持精确的碰撞概率。
- 推导理论界,表明所提方案的碰撞概率与 Jaccard 相似度完全匹配,确保无偏估计。
- 利用独立均匀随机变量的最小值服从已知分布的特性,实现高效且精确的采样。
- 通过预计算并复用多个哈希函数之间的随机值,优化实现每个哈希的摊销时间恒定。
实验结果
研究问题
- RQ1加权 minwise 哈希能否实现每个哈希的常数时间计算,且与数据稀疏性无关?
- RQ2是否可能将哈希存储从 64 位减少至 10 位以下,同时保持精确的碰撞概率?
- RQ3所提方法能否在不引入偏差的情况下,显著超越 Ioffe 的 O(dk) 方法?
- RQ4所提方案在实际中的准确性与 Ioffe 的精确方法及近似启发式方法相比如何?
主要发现
- 在 Oxford 数据集上计算 500 个哈希时,所提方法相比 Ioffe 方法实现高达 60,000× 的加速,且准确性完全一致。
- 在 Caltech101 数据集上,该方法比 Ioffe 方法快 1,500 至 70,000×,具体取决于数据稀疏性。
- 哈希值被限制在较小范围内(例如,Web-Images 数据集中为 [1,107]),每哈希仅需 7–9 位,内存使用量减少 5–6 倍。
- 实验中观察到的平均哈希值与定理 2 的理论预测一致,验证了该方法的分布正确性。
- 估计准确性与 Ioffe 的精确方法无异,k=1 至 50 个哈希下,Jaccard 相似度估计的平均误差保持完全相同。
- 与近似启发式方法(如 Fast-WDOPH)相比,该方法在速度上快 5–100×,且保持精确性,而后者存在偏差。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。