Improving Numeracy by Input Reframing and Quantitative Pre-Finetuning Task

Chung-Chi Chen, Hiroya Takamura, Ichiro Kobayashi, Yusuke MiyaoEACL (Findings) 2023

TL;DR

This paper introduces "innumeracy" as a key challenge in large language models (LLMs), where models struggle with numerical understanding, especially with unseen numeral formats. They propose two solutions: input reframing (representing numbers in different formats like digits or scientific notation) and a novel pre-finetuning task (comparing numbers) to improve LLM numeracy, showing significant gains, particularly for RoBERTa.

What Problem Does This Paper Address?

Large language models (LLMs) have shown remarkable capabilities across various natural language tasks. However, a critical gap exists in their understanding of numbers and quantitative reasoning, a phenomenon the authors term "innumeracy." This innumeracy is most apparent when LLMs encounter numerals that differ from their training data, such as different notations or magnitudes. While LLMs can process text, they often fail to grasp the underlying numerical information, hindering their ability to perform tasks requiring precise quantitative understanding. This paper aims to address this fundamental limitation by exploring methods to improve how LLMs handle numerical data.

Methods

The authors propose two primary methods to combat innumeracy:

  • Input Reframing: This involves transforming the numerical input into different formats to aid the model's understanding. They explore two key reframing techniques:
  • Digit-based Notation: Separating numerals into individual digits (e.g., "147" becomes "1", "4", "7").
  • Scientific Notation: Converting numbers into scientific notation (e.g., "14770200000" becomes "1.47702e+10"). They also consider the "Original" notation as a baseline.

  • Quantitative Pre-Finetuning Task (ComNum): Recognizing that LLMs are not inherently trained for numerical tasks, they introduce a novel pre-finetuning task called "Comparing Numbers" (ComNum). This task involves training LLMs on a dataset where they must determine if one number is greater than, less than, or equal to another. This process aims to make models more aware of numerical relationships and magnitudes.

Datasets

The paper utilizes and introduces several datasets:

  • Comparing Numbers Dataset (CND): This is a newly generated dataset for the ComNum task. It's automatically created and designed as a binary classification task. It includes training and two test sets (CND-T1 and CND-T2) with varying magnitudes of numbers to specifically test for innumeracy.
  • Quantitative 101 Dataset: This is a composite dataset created by the authors, combining three existing benchmark datasets:
  • Numeracy-600K (Chen et al., 2019): Used for the Quantitative Prediction (QP) task, focusing on predicting the magnitude of masked numerals.
  • EQUATE (Ravichander et al., 2019): Used for the Quantitative Natural Language Inference (QNLI) task, requiring inference based on quantitative clues.
  • NumGLUE Task 3 (Mishra et al., 2022): Used for the Quantitative Question Answering (QQA) task.

Key Insights and Ideas

  • "Innumeracy" is a real problem: LLMs exhibit a significant drop in performance when faced with numerals outside their training distribution, highlighting a fundamental weakness in numerical understanding.
  • Input reframing helps, especially scientific notation: Changing the way numbers are presented to the model can significantly improve performance, with scientific notation showing a more consistent benefit in reducing performance drops.
  • Pre-finetuning is crucial for numeracy: A dedicated pre-finetuning task focused on comparing numbers (ComNum) demonstrably improves an LLM's ability to handle quantitative tasks, particularly QNLI.
  • RoBERTa benefits greatly from these methods: While BERT-based models show some improvement, RoBERTa, which initially underperforms on numeracy tasks, becomes competitive with BERT after applying input reframing and the ComNum pre-finetuning.
  • No single "silver bullet": While input reframing and pre-finetuning are promising, the paper suggests that a combination of techniques might be necessary for comprehensive numeracy improvement.

Key Results

  • ComNum Task Performance: Models showed a noticeable performance drop on the CND-T2 test set compared to CND-T1, demonstrating the "innumeracy" phenomenon. Scientific notation reframing led to the smallest performance drops across LMs.
  • Quantitative 101 Score: Input reframing and the ComNum pre-finetuning task collectively improved the overall performance of RoBERTa, bringing it on par with BERT-based models.
  • QNLI Task Improvement: The proposed ComNum pre-finetuning task consistently improved performance on the QNLI task across different LMs.
  • QQA Task Improvement: Proper reframing methods were found to improve QQA task performance.
  • CN-FinBERT Outperforms Original FinBERT: The pre-finetuned FinBERT model (CN-FinBERT) showed better performance on the QP-comment task than the original FinBERT.

Limitations and Future Work

  • Limited to Digit-Based Numerals: The study focuses solely on numerals represented by digits and decimal points, excluding numbers written out in words (e.g., "one," "two"). Future work could explore converting word-based numbers to digits.
  • Short Text Scenarios: The experiments were conducted on instances within a 512-token limit. Future research could investigate the effectiveness of these methods on longer documents.
  • No Training from Scratch: The paper did not train models from scratch with the proposed reframing methods, leaving this as an open question for future studies.
  • Generalizability of Innumeracy: The authors acknowledge that they presented a "pilot exploration" and did not experiment with all possible ranges or LM types to definitively prove innumeracy is a universal phenomenon. Future work could expand the scope to confirm this.
  • No "Silver Bullet": The paper concludes that while input reframing and pre-finetuning are promising directions, there isn't a single solution for all quantitative problems.

Summary updated

BibTeX
@inproceedings{chen2023improving,
  author = {Chung-Chi Chen and Hiroya Takamura and Ichiro Kobayashi and Yusuke Miyao},
  title = {{Improving Numeracy by Input Reframing and Quantitative Pre-Finetuning Task}},
  booktitle = {EACL (Findings)},
  year = {2023},
  doi = {10.18653/v1/2023.findings-eacl.4},
}
Figure