用多头编码解决海量标签分类的计算过载问题
Multi-Head Encoding for Extreme Label Classification
- 将复杂标签拆解为多个短局部标签,分头训练降低计算量
- 在多种任务上实现领先性能,训练推理速度显著提升
- 适合处理百万级标签的分类场景,尤其适用于预训练
现实世界中实例类别数量庞大,且常含多重标签。为应对这一挑战,提出了极端标签分类(XLC)方法。然而,随着类别数增加,分类器参数和非线性操作随之激增,导致分类器计算过载(CCOP)。为此,本文提出多头编码(MHE)机制,用多头分类器替代传统分类器。训练时,将极端标签分解为多个短局部标签的乘积,各头分别学习这些局部标签;测试时,通过各头的局部预测直接计算最终标签。该方法使计算负载几何级降低。针对单标签、多标签及模型预训练等不同任务特性,进一步提出三种基于MHE的实现:多头乘积、多头级联与多头采样。理论证明,MHE可通过将低秩近似从Frobenius范数推广至交叉熵,实现与原始分类器相当的性能。实验表明,所提方法在保持先进性能的同时,大幅简化了训练与推理过程。代码已公开于 https://github.com/Anoise/MHE。
原文摘要 · Abstract (English)
The number of categories of instances in the real world is normally huge, and each instance may contain multiple labels. To distinguish these massive labels utilizing machine learning, eXtreme Label Classification (XLC) has been established. However, as the number of categories increases, the number of parameters and nonlinear operations in the classifier also rises. This results in a Classifier Computational Overload Problem (CCOP). To address this, we propose a Multi-Head Encoding (MHE) mechanism, which replaces the vanilla classifier with a multi-head classifier. During the training process, MHE decomposes extreme labels into the product of multiple short local labels, with each head trained on these local labels. During testing, the predicted labels can be directly calculated from the local predictions of each head. This reduces the computational load geometrically. Then, according to the characteristics of different XLC tasks, e.g., single-label, multi-label, and model pretraining tasks, three MHE-based implementations, i.e., Multi-Head Product, Multi-Head Cascade, and Multi-Head Sampling, are proposed to more effectively cope with CCOP. Moreover, we theoretically demonstrate that MHE can achieve performance approximately equivalent to that of the vanilla classifier by generalizing the low-rank approximation problem from Frobenius-norm to Cross-Entropy. Experimental results show that the proposed methods achieve state-of-the-art performance while significantly streamlining the training and inference processes of XLC tasks. The source code has been made public at https://github.com/Anoise/MHE.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。