arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2306.15944cs.LGcs.DScs.IR
收藏

Pb-Hash:分块 b-bit 哈希

Pb-Hash: Partitioned b-bit Hashing

LinkedIn Ads(领英广告)

Ping Li, Weijie Zhao

AI总结:

本文提出 Pb-Hash 算法,通过将哈希值分块重复使用以大幅减小模型规模,理论分析与实验表明其在准确率损失可控的前提下,对线性 SVM 和深度学习模型均有效。

摘要:

许多哈希算法,包括 minwise hashing(MinHash)、one permutation hashing(OPH)和 consistent weighted sampling(CWS),都会生成 $B$ 个比特的整数。对于每个数据向量使用 $k$ 个哈希值,存储空间将为 $B\times k$ 比特;当用于大规模学习时,模型大小将为 $2^B\times k$,这可能会非常昂贵。一种标准策略是仅使用 $B$ 个比特中最低的 $b$ 个比特,并适当增加哈希数量 $k$。在本研究中,我们提出通过将 $B$ 个比特划分为 $m$ 个块(例如 $b\times m =B$)来重复使用哈希值。相应地,模型大小变为 $m\times 2^b \times k$,这可以大大小于原始的 $2^B\times k$。我们的理论分析表明,通过将哈希值划分为 $m$ 个块,准确率会下降。换句话说,使用 $m$ 个 $B/m$ 比特的块不会像直接使用 $B$ 个比特那样准确。这是由于重复使用相同的哈希值产生的相关性导致的。另一方面,我们的分析也表明,对于(例如)$m=2\sim 4$,准确率不会下降太多。在某些区域,即使 $m$ 远大于 4,Pb-Hash 仍然表现良好。我们期望 Pb-Hash 将成为哈希方法/应用家族的良好补充,并使工业界从业者受益。我们在机器学习任务中验证了 Pb-Hash 的有效性,包括线性 SVM 模型和深度学习模型。由于哈希数据本质上是分类(ID)特征,我们遵循为每个哈希使用嵌入表的标准做法。使用 Pb-Hash,我们需要设计一种有效的策略来组合 $m$ 个嵌入。我们的研究对四种池化方案进行了实证评估:concatenation、max pooling、mean pooling 和 product pooling。关于哪种池化方案总是更好,目前没有确定的答案,我们将其留待未来研究。

英文摘要:

Many hashing algorithms including minwise hashing (MinHash), one permutation hashing (OPH), and consistent weighted sampling (CWS) generate integers of $B$ bits. With $k$ hashes for each data vector, the storage would be $B\times k$ bits; and when used for large-scale learning, the model size would be $2^B\times k$, which can be expensive. A standard strategy is to use only the lowest $b$ bits out of the $B$ bits and somewhat increase $k$, the number of hashes. In this study, we propose to re-use the hashes by partitioning the $B$ bits into $m$ chunks, e.g., $b\times m =B$. Correspondingly, the model size becomes $m\times 2^b \times k$, which can be substantially smaller than the original $2^B\times k$. Our theoretical analysis reveals that by partitioning the hash values into $m$ chunks, the accuracy would drop. In other words, using $m$ chunks of $B/m$ bits would not be as accurate as directly using $B$ bits. This is due to the correlation from re-using the same hash. On the other hand, our analysis also shows that the accuracy would not drop much for (e.g.,) $m=2\sim 4$. In some regions, Pb-Hash still works well even for $m$ much larger than 4. We expect Pb-Hash would be a good addition to the family of hashing methods/applications and benefit industrial practitioners. We verify the effectiveness of Pb-Hash in machine learning tasks, for linear SVM models as well as deep learning models. Since the hashed data are essentially categorical (ID) features, we follow the standard practice of using embedding tables for each hash. With Pb-Hash, we need to design an effective strategy to combine $m$ embeddings. Our study provides an empirical evaluation on four pooling schemes: concatenation, max pooling, mean pooling, and product pooling. There is no definite answer which pooling would be always better and we leave that for future study.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑