arXiv:2508.03175cs.LG2025-08中稿 · IEEE TASLP被引 4

提出自适应稀疏Softmax,让模型专注区分难样本,提升训练效率与分类效果。

Adaptive Sparse Softmax: An Effective and Efficient Softmax Variant

  • 训练时只关注目标类的强竞争类,忽略低分类别,聚焦关键挑战。
  • 易样本损失趋近0,验证集性能与损失高度相关,可作为有效评估指标。
  • 自适应梯度累积策略使训练提速1.2倍,适合多任务、大类别场景使用。

当前神经网络分类模型普遍采用带交叉熵损失的Softmax。然而,在Softmax框架下目标类得分永远无法达到理想值1,导致训练过程无限持续并引发过拟合。此外,‘逼近1’的目标迫使模型持续学习所有样本,包括已高置信度正确分类的样本,造成资源浪费;而测试目标仅要求目标类得分最高。为此,本文提出自适应稀疏Softmax(AS-Softmax),在Softmax之上设计一种符合测试目标的合理变换:训练时剔除与真实类得分差距较大的类别,使模型专注于区分目标类与其强竞争类——这正是测试中的核心挑战。同时,由于易样本的损失在AS-Softmax中逐渐趋近于0,我们引入基于掩码样本比例的自适应梯度累积策略,显著加速训练。我们在文本多分类、多标签、词元分类、图像分类和音频分类等任务上进行了验证,类别数从5到5000+不等。结果表明,AS-Softmax在各类任务中均优于标准Softmax及其变体,且其损失与验证性能高度相关。此外,自适应梯度累积策略相比标准Softmax带来约1.2倍的训练加速,同时保持分类效果不变。

原文摘要 · Abstract (English)

Softmax with the cross entropy loss is the standard configuration for current neural classification models. The gold score for a target class is supposed to be 1, but it is never reachable under the softmax schema. Such a problem makes the training process continue forever and leads to overfitting. Moreover, the "target-approach-1" training goal forces the model to continuously learn all samples, leading to a waste of time in handling some samples which have already been classified correctly with high confidence, while the test goal simply requires the target class of each sample to hold the maximum score. To solve the above weaknesses, we propose the Adaptive Sparse softmax (AS-Softmax) which designs a reasonable and test-matching transformation on top of softmax. For more purposeful learning, we discard the classes with far smaller scores compared with the actual class during training. Then the model could focus on learning to distinguish the target class from its strong opponents, which is also the great challenge in test. In addition, since the training losses of easy samples will gradually drop to 0 in AS-Softmax, we develop an adaptive gradient accumulation strategy based on the masked sample ratio to speed up training. We verify the proposed AS-Softmax on a variety of text multi-class, text multi-label, text token classification, image classification and audio classification tasks with class sizes ranging from 5 to 5000+. The results show that AS-Softmax consistently outperforms softmax and its variants, and the loss of AS-Softmax is remarkably correlated with classification performance in validation. Furthermore, adaptive gradient accumulation strategy can bring about 1.2x training speedup comparing with the standard softmax while maintaining classification effectiveness.

Softmax分类优化训练加速自适应

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。