arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.02083cs.CLcs.AIcs.CEcs.LG
收藏

回归,而非猜测——一种针对语言模型数字令牌的类回归损失

Regress, Don't Guess -- A Regression-like Loss on Number Tokens for Language Models

Technical University of Munich(慕尼黑技术大学);Munich Center for Machine Learning (MCML)(慕尼黑机器学习中心(MCML));IBM Research Europe(IBM欧洲研究院);ETH Zurich(苏黎世联邦理工学院)
Jonas Zausinger, Lars Pennig, Anamarija Kozina, Sean Sdahl, Julian Sikora, Adrian Dendorfer, Timofey Kuznetsov, Mohamad Hagog, Nina Wiedemann, Kacper Chlodny, V… 展开作者

Jonas Zausinger, Lars Pennig, Anamarija Kozina, Sean Sdahl, Julian Sikora, Adrian Dendorfer, Timofey Kuznetsov, Mohamad Hagog, Nina Wiedemann, Kacper Chlodny, Vincent Limbach, Anna Ketteler, Thorben Prein, Vishwa Mohan Singh, Michael Morris Danziger, Jannis Born

AI总结:

本文提出数字令牌损失(NTL),以类回归方式在令牌级别最小化数字预测误差,无需额外运行时开销即可提升语言模型在数学推理任务中的性能,并可扩展至30亿参数LLM。

摘要:

尽管语言模型在文本生成方面具有卓越能力,但它们缺乏对数字输出的自然归纳偏置,因此在涉及定量推理的任务中表现不佳,尤其是在算术方面。一个根本性的局限在于交叉熵(CE)损失的性质,该损失假设名义尺度,因此无法传达生成数字令牌之间的邻近关系。针对这一问题,我们提出了一种完全在令牌级别上运作的类回归损失。我们提出的数字令牌损失(Number Token Loss,NTL)有两种形式,分别最小化真实数字令牌与预测数字令牌数值之间的 $L_p$ 范数或Wasserstein距离。NTL可以轻松添加到任何语言模型中,并在训练期间扩展CE目标,且不会带来运行时开销。我们在多个数学数据集上评估了所提出的方案,发现它能够持续提升数学相关任务的性能。在回归任务的直接比较中,我们发现尽管NTL在令牌级别上运作,其性能仍可与回归头相媲美。最后,我们将NTL扩展到30亿参数模型,并观察到性能提升,证明了其无缝集成到大型语言模型(LLM)中的潜力。我们希望激励LLM开发者改进其预训练目标,并将NTL作为一个极简且轻量级的PyPI软件包 $ntloss$ 发布:https://github.com/ai4sd/number-token-loss。用于完整论文复现的开发代码另行提供。

英文摘要:

While language models have exceptional capabilities at text generation, they lack a natural inductive bias for emitting numbers and thus struggle in tasks involving quantitative reasoning, especially arithmetic. One fundamental limitation is the nature of the cross-entropy (CE) loss, which assumes a nominal scale and thus cannot convey proximity between generated number tokens. In response, we here present a regression-like loss that operates purely on token level. Our proposed Number Token Loss (NTL) comes in two flavors and minimizes either the $L_p$ norm or the Wasserstein distance between the numerical values of the real and predicted number tokens. NTL can easily be added to any language model and extend the CE objective during training without runtime overhead. We evaluate the proposed scheme on various mathematical datasets and find that it consistently improves performance in math-related tasks. In a direct comparison on a regression task, we find that NTL can match the performance of a regression head, despite operating on token level. Finally, we scale NTL up to 3B parameter models and observe improved performance, demonstrating its potential for seamless integration into LLMs. We hope to inspire LLM developers to improve their pretraining objectives and distribute NTL as a minimalistic and lightweight PyPI package $ntloss$: https://github.com/ai4sd/number-token-loss. Development code for full paper reproduction is available separately.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑