用新型损失函数训练更可解释、收敛更快的AI模型
Harmonic Loss Trains Interpretable AI Models
- 用欧氏距离和哈马克函数替代传统softmax,实现尺度不变性
- 在少量数据下表现更好,且减少‘突然理解’现象(grokking)
- 适合数据少或对可解释性要求高的高风险应用
本文提出谐波损失(Harmonic Loss)作为神经网络与大语言模型的替代监督信号。其核心是将标准SoftMax替换为尺度不变的哈马克(HarMax)函数,并通过欧氏距离计算logits而非点积。该设计使模型具备尺度不变性与预定的有限收敛点,可被解释为类别中心,从而提升可解释性并加速收敛。我们在算法、视觉与语言数据集上验证了性能,结果表明:使用谐波损失的模型在更低数据量下实现更好泛化,显著减少grokking现象;对比GPT-2模型,谐波训练版本生成更可解释的表征。未来有望应用于数据稀缺或对可靠性要求极高的场景,推动更稳健高效的模型发展。
原文摘要 · Abstract (English)
In this paper, we introduce harmonic loss as an alternative supervisory signal for training neural networks and large language models (LLMs). Harmonic loss differs from standard cross-entropy loss by (a) replacing the usual SoftMax normalization with a scale-invariant HarMax function and (b) computing logits via Euclidean distance rather than a dot product. Harmonic loss enables improved interpretability and faster convergence, owing to its scale invariance and finite convergence point by design, which can be interpreted as a class center. We first validate the performance of harmonic models across algorithmic, vision, and language datasets. Through extensive experiments, we demonstrate that models trained with harmonic loss perform better than standard models by: (a) enhancing interpretability, (b) requiring less data for generalization, and (c) reducing grokking. Moreover, we compare a GPT-2 model trained with harmonic loss to the standard GPT-2, illustrating that the harmonic model develops more interpretable representations. Looking forward, we believe harmonic loss may become a valuable tool in domains with limited data availability or in high-stakes applications where interpretability and reliability are paramount, paving the way for more robust and efficient neural network models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。