mlsanityData to 7 Oct 2026

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

arXiv 2411.02083 ↗First posted 4 Nov 2024cs.CL cs.AI cs.CEcited by 12

Not on the map. Why?

Abstract (arXiv)

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 Lp 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.

Key facts. Cited by 12 papers in the map (data through 7 Oct 2026). Builds on 30 of its 50 references that are in the map. First posted on arXiv 4 Nov 2024.

Builds on

30 of 50 references.

References · 30

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  4. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  5. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  6. 2013Sinkhorn Distances: Lightspeed Computation of Optimal Transportation Distancescited by 2,277
  7. 2020On Layer Normalization in the Transformer Architecturecited by 906
  8. 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 496
  9. 2019Analysing Mathematical Reasoning Abilities of Neural Modelscited by 331
  10. 2022Making Large Language Models Better Reasoners with Step-Aware Verifiercited by 231
  11. 2024Tool Learning with Large Language Models: A Surveycited by 221
  12. 2015Semi-supervised Sequence Learningcited by 198
18 more
  1. 2019Do NLP Models Know Numbers? Probing Numeracy in Embeddingscited by 157
  2. 2024The pitfalls of next-token predictioncited by 156
  3. 2020Injecting Numerical Reasoning Skills into Language Modelscited by 133
  4. 2023Teaching Arithmetic to Small Transformerscited by 121
  5. 2024Tokenization counts: the impact of tokenization on arithmetic in frontier LLMscited by 112
  6. 2023Unifying Molecular and Textual Representations via Multi-task Language Modellingcited by 92
  7. 2021Representing Numbers in NLP: a Survey and a Visioncited by 83
  8. 2023Grokking modular arithmeticcited by 77
  9. 2023TinyGSM: achieving >80% on GSM8k with small language modelscited by 68
  10. 2020Do Language Embeddings Capture Scales?cited by 63
  11. 2022Regression Transformer: Concurrent sequence regression and generation for molecular language modelingcited by 49
  12. 2023Learning the greatest common divisor: explaining transformer predictionscited by 33
  13. 2022Regression as Classification: Influence of Task Formulation on Neural Network Featurescited by 29
  14. 2023xVal: A Continuous Numerical Tokenization for Scientific Language Modelscited by 26
  15. 2023Recursion of Thought: A Divide-and-Conquer Approach to Multi-Context Reasoning with Language Modelscited by 24
  16. 2024Reverse That Number! Decoding Order Matters in Arithmetic Learningcited by 8
  17. 2024Salsa Fresca: Angular Embeddings and Pre-Training for ML Attacks on Learning With Errorscited by 7
  18. 2023Learning Label Encodings for Deep Regressioncited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 3; 2026: 9.

12 papers.