基于Count-Min Sketch的日志存储极端分类--以Amazon搜索50 M商品为例
Extreme Classification in Log Memory using Count-Min Sketch: A Case Study of Amazon Search with 50M Products
摘要:
在过去的十年中,许多人工智能的硬任务,特别是在NLP中,可以自然地建模为极端分类问题,从而提高精度。然而,由于最后一层的内存爆炸,这种模型的训练成本过高。例如,本文中感兴趣的数据集的合理softmax层可以轻松达到远远超过1000亿个参数(>400 GB内存)。为了缓解这个问题,我们提出了通过哈希的合并平均分类器(MACH),这是一种通用的K分类算法,其中内存可证明为O(logK),而无需对类进行任何强假设。MACH是一个巧妙的伪装的count-min sketch结构,它使用通用哈希将大量类别的分类减少到少数具有少量(恒定)类别的并行和独立分类任务。MACH自然提供了一种零通信模型并行技术。我们用6个数据集进行了实验;一些是多类的,一些是多标签的,并且在各自的最先进的基线上显示出一致的改进。特别是,我们在从亚马逊搜索引擎采样的私有产品搜索数据集上训练了一个端到端的深度分类器,该数据集包含7000万个查询和4946万个产品。MACH的性能远远优于商业搜索引擎上部署的最先进的极端分类模型:Parabel和密集嵌入模型。我们最大的模型有64亿个参数,在一台p3.16x机器上训练不到35小时。我们的训练时间比最佳基线快7- 10倍,内存占用比最佳基线小2- 4倍。这个训练时间也明显低于Google的混合专家模型(MoE)语言模型在类似模型大小和硬件上报告的时间。
英文摘要:
In the last decade, it has been shown that many hard AI tasks, especially in NLP, can be naturally modeled as extreme classification problems leading to improved precision. However, such models are prohibitively expensive to train due to the memory blow-up in the last layer. For example, a reasonable softmax layer for the dataset of interest in this paper can easily reach well beyond 100 billion parameters (>400 GB memory). To alleviate this problem, we present Merged-Average Classifiers via Hashing (MACH), a generic K-classification algorithm where memory provably scales at O(logK) without any strong assumption on the classes. MACH is subtly a count-min sketch structure in disguise, which uses universal hashing to reduce classification with a large number of classes to few embarrassingly parallel and independent classification tasks with a small (constant) number of classes. MACH naturally provides a technique for zero communication model parallelism. We experiment with 6 datasets; some multiclass and some multilabel, and show consistent improvement over respective state-of-the-art baselines. In particular, we train an end-to-end deep classifier on a private product search dataset sampled from Amazon Search Engine with 70 million queries and 49.46 million products. MACH outperforms, by a significant margin,the state-of-the-art extreme classification models deployed on commercial search engines: Parabel and dense embedding models. Our largest model has 6.4 billion parameters and trains in less than 35 hours on a single p3.16x machine. Our training times are 7-10x faster, and our memory footprints are 2-4x smaller than the best baselines. This training time is also significantly lower than the one reported by Google's mixture of experts (MoE) language model on a comparable model size and hardware.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。