[论文解读] Training Logistic Regression and SVM on 200GB Data Using b-Bit Minwise Hashing and Comparisons with Vowpal Wabbit (VW)
本文提出 b 位最小哈希(b-bit minwise hashing)作为一种在大规模数据集上训练逻辑回归和 SVM 的高效方法,证明其在显著更低的存储成本下,相比 Vowpal Wabbit(VW)哈希实现了更优的准确率。使用一个 200GB 扩展后的 rcv1 数据集,作者表明仅使用每个样本 30 个哈希值的 b 位哈希,即可达到使用 16,384 个值的 VW 的性能,同时预处理成本可控且可借助 GPU 加速。
We generated a dataset of 200 GB with 10^9 features, to test our recent b-bit minwise hashing algorithms for training very large-scale logistic regression and SVM. The results confirm our prior work that, compared with the VW hashing algorithm (which has the same variance as random projections), b-bit minwise hashing is substantially more accurate at the same storage. For example, with merely 30 hashed values per data point, b-bit minwise hashing can achieve similar accuracies as VW with 2^14 hashed values per data point. We demonstrate that the preprocessing cost of b-bit minwise hashing is roughly on the same order of magnitude as the data loading time. Furthermore, by using a GPU, the preprocessing cost can be reduced to a small fraction of the data loading time. Minwise hashing has been widely used in industry, at least in the context of search. One reason for its popularity is that one can efficiently simulate permutations by (e.g.,) universal hashing. In other words, there is no need to store the permutation matrix. In this paper, we empirically verify this practice, by demonstrating that even using the simplest 2-universal hashing does not degrade the learning performance.
研究动机与目标
- 在大规模数据集(200GB 扩展后的 rcv1)上评估 b 位最小哈希,以评估其在真实机器学习场景中的性能。
- 直接比较 b 位最小哈希与 Vowpal Wabbit(VW)哈希在测试准确率和存储效率方面的表现。
- 验证 2-通用哈希作为存储完整排列的实用且有效替代方案的可行性。
- 证明 b 位最小哈希的预处理成本在实践中可忽略不计,尤其是在多次训练运行中分摊后。
- 通过使用 LIBLINEAR 和哈希数据提供可复现的实验设置,使其他研究人员能够轻松验证结果。
提出的方法
- 作者通过包含原始特征、所有两两组合以及 1/30 的三元组合特征,将 rcv1 数据集扩展为 200GB 的 LibSVM 格式数据集。
- 采用 2-通用哈希函数对 b 位最小哈希进行处理,以模拟排列,从而避免存储完整的排列映射。
- 哈希过程使用线性同余函数将每个非零特征索引映射到新位置:$ h_j(t) = \{c_{1,j} + c_{2,j} \cdot t\ \text{mod}\ p\}\ \text{mod}\ D $,其中 $ p > D $ 为素数。
- 对每个数据点,记录 $ k $ 个排列中的最小哈希值,形成紧凑的 $ k $-维表示。
- 将生成的哈希数据用于在 LIBLINEAR 上训练逻辑回归和 SVM 模型,LIBLINEAR 是广泛用于大规模线性模型的求解器。
- 通过在不同哈希值数量($ k $)下比较 b 位最小哈希与 VW 哈希的测试准确率,评估性能表现。
实验结果
研究问题
- RQ1当使用显著更少的哈希值时,b 位最小哈希能否实现与 Vowpal Wabbit 哈希相当或更好的测试准确率?
- RQ2使用 2-通用哈希替代完美排列对 b 位最小哈希的学习性能有何影响?
- RQ3在大规模学习流水线中,预处理与数据加载时间如何比较?预处理是否构成瓶颈?
- RQ4b 位最小哈希能否有效用于标准求解器(如 LIBLINEAR)在高达 200GB 的数据集上进行训练?
- RQ5b 位最小哈希的一次性预处理成本是否因其可在多个训练实验和超参数调优任务中重复使用而得到合理化?
主要发现
- 仅使用每个样本 30 个哈希值,b 位最小哈希即可实现与使用 16,384 个哈希值的 Vowpal Wabbit(VW)相当的测试准确率。
- 即使未使用 GPU 加速,b 位最小哈希的预处理成本与 200GB 数据集的数据加载时间处于同一数量级。
- 使用 GPU 后,预处理时间缩短至数据加载时间的 1/7 以下,使其成为次要瓶颈。
- 使用 2-通用哈希并未降低模型性能,这在 webspam 数据集上通过排列与 2-通用哈希的测试准确率曲线重叠得到验证。
- 同一份预处理数据可重复用于多次训练运行,包括不同 C 值或数据划分的交叉验证,显著降低总体计算成本。
- b 位最小哈希在方差减少方面优于 VW 哈希,证实了理论预期:其方差低于随机投影(VW 所模拟的)。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。