Skip to main content
QUICK REVIEW

[论文解读] Practical Hash Functions for Similarity Estimation and Dimensionality Reduction

Søren Dahlgaard, Mathias Bæk Tejs Knudsen|arXiv (Cornell University)|Nov 23, 2017
Advanced Image and Video Retrieval Techniques参考文献 4被引用 10
一句话总结

本文评估了混合表查找哈希作为一种在相似性估计和特征哈希中实用且理论保证良好的替代方案,相较于常用哈希函数的表现。结果表明,混合表查找哈希在理论集中界限和实际实验中均与真正随机哈希性能相当,且在可靠性与速度方面优于乘法取模素数和MurmurHash3——其速度比MurmurHash3快40%,同时提供强有力的理论保证。

ABSTRACT

Hashing is a basic tool for dimensionality reduction employed in several aspects of machine learning. However, the perfomance analysis is often carried out under the abstract assumption that a truly random unit cost hash function is used, without concern for which concrete hash function is employed. The concrete hash function may work fine on sufficiently random input. The question is if it can be trusted in the real world when faced with more structured input. In this paper we focus on two prominent applications of hashing, namely similarity estimation with the one permutation hashing (OPH) scheme of Li et al. [NIPS'12] and feature hashing (FH) of Weinberger et al. [ICML'09], both of which have found numerous applications, i.e. in approximate near-neighbour search with LSH and large-scale classification with SVM. We consider mixed tabulation hashing of Dahlgaard et al.[FOCS'15] which was proved to perform like a truly random hash function in many applications, including OPH. Here we first show improved concentration bounds for FH with truly random hashing and then argue that mixed tabulation performs similar for sparse input. Our main contribution, however, is an experimental comparison of different hashing schemes when used inside FH, OPH, and LSH. We find that mixed tabulation hashing is almost as fast as the multiply-mod-prime scheme ax+b mod p. Mutiply-mod-prime is guaranteed to work well on sufficiently random data, but we demonstrate that in the above applications, it can lead to bias and poor concentration on both real-world and synthetic data. We also compare with the popular MurmurHash3, which has no proven guarantees. Mixed tabulation and MurmurHash3 both perform similar to truly random hashing in our experiments. However, mixed tabulation is 40% faster than MurmurHash3, and it has the proven guarantee of good performance on all possible input.

研究动机与目标

  • 评估混合表查找哈希在涉及相似性估计和特征哈希的实际机器学习工作负载中的实际性能。
  • 评估常用哈希函数(如乘法取模素数和MurmurHash3)在实际应用中是否引入偏差或集中性差的问题,尽管其应用广泛。
  • 从速度、准确性和理论保证角度,将混合表查找哈希与其他哈希函数进行比较。
  • 提供实证与理论证据,证明混合表查找哈希在OPH和FH等应用中几乎与真正随机哈希表现相当。
  • 由于其兼具速度、可靠性与可证明性能,倡导将混合表查找哈希作为实际应用中的首选方案。

提出的方法

  • 作者在两种核心应用中实现并评估了混合表查找哈希:单排列哈希(OPH)和特征哈希(FH)。
  • 他们在合成数据、MNIST和News20数据集上进行了广泛实验,以测量LSH-based相似性搜索中的范数集中度和检索质量。
  • 在特征哈希中,他们对100次重复实验中变换后向量的平方L2范数进行计算,以评估方差与偏差。
  • 在OPH的LSH中,他们测量了不同K和L值下的#检索 / 召回率,为清晰起见聚焦于K=L=10。
  • 他们从速度和准确性的角度,将混合表查找哈希与乘法取模素数、2-wise PolyHash、MurmurHash3和CityHash进行了比较。
  • 他们推导了真正随机哈希下FH的改进集中界限,并表明当输入向量稀疏时,混合表查找哈希可实现相似性能。

实验结果

研究问题

  • RQ1在OPH和FH等实际应用中,混合表查找哈希是否与真正随机哈希性能相当?
  • RQ2在真实世界数据中,常用哈希函数(如乘法取模素数和MurmurHash3)是否可能引入系统性偏差或集中性差的问题?
  • RQ3在相似性估计与降维中,混合表查找哈希与MurmurHash3和CityHash相比,在速度与准确性方面表现如何?
  • RQ4混合表查找哈希的理论保证在多大程度上转化为对多样化数据分布的实用鲁棒性?
  • RQ5混合表查找哈希是否是机器学习流水线中启发式哈希函数的可靠且高效替代方案?

主要发现

  • 混合表查找哈希在范数集中度和LSH召回率方面均与真正随机哈希表现几乎完全一致,偏差极小,集中性极佳。
  • 乘法取模素数哈希在结构化或真实世界数据中导致相似性被显著高估,且集中性差,尽管其速度较快。
  • MurmurHash3在实际中表现与真正随机哈希相似,但缺乏理论保证,因此在对抗性或结构化输入下可靠性较低。
  • 混合表查找哈希比MurmurHash3快40%,同时保持其实际性能,因此是更优的实际选择。
  • 在MNIST数据集上,2-wise PolyHash的范数为16.671,而混合表查找哈希仅为2.077,表明弱哈希函数存在严重偏差。
  • 在#检索 / 召回率指标中,乘法取模素数因过度检索而持续表现不佳,尽管其召回率略高。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。