Exploiting Numerical-Contextual Knowledge to Improve Numerical Reasoning in Question Answering

Jeonghwan Kim, Junmo Kang, Kyung-Min Kim, Giwon Hong, Sung-Hyon Myaeng

Introduction

Numerical reasoning in Question Answering (QA) remains a significant challenge for Large Language Models (LLMs). While models like BERT excel at linguistic patterns, they often falter when performing discrete operations like addition, subtraction, or sorting based on textual evidence. Researchers from KAIST have identified a key culprit: the over-reliance on parametric knowledge—information memorized during pre-training that conflicts with the specific context of a passage.

The Challenge of Parametric Knowledge

Parametric knowledge refers to the associations baked into a model's weights during its initial training on massive web corpora. For instance, if a model frequently encountered "80s" in the context of years (e.g., "the 1980s"), it might struggle to interpret "80s" as an age in a sentence like "John is in his 80s." This bias leads the model to ignore local context, resulting in reasoning errors where the model predicts an answer based on global frequency rather than local facts.

Examples of model failure due to over-reliance on parametric knowledge.

Proposed Method: NC-BERT

To address this, the authors propose NC-BERT, which introduces a Numerical-Contextual Mask (NC-Mask) layer and specialized training objectives to decouple numerical values from their pre-trained biases. The NC-BERT architecture modifies the standard Transformer by adding a specialized layer on top of the encoder. This layer utilizes the NC-Mask, a tripartite attention scheme designed to force the model to look at relevant local context:

  1. Entity-Number Channel: Restricts a number's attention to entities mentioned within the same sentence, ensuring precise linkage (e.g., connecting "49" specifically to "yard field goal").
  2. Type-Number Channel: Uses a local window of words to define a number's "type" (e.g., YEAR vs. AGE), mitigating parametric interference.
  3. Decoder-Number Channel: Filters out non-numerical noise during the final calculation phase, allowing the decoder to focus strictly on digits.
The NC-BERT architecture featuring the Numerical-Contextual Mask (NC-Mask) layer.

Additionally, the model employs DICE-loss regularization. This acts as a sanity check to ensure that while the model becomes more context-aware, it does not lose its "intrinsic" understanding of numerical magnitude (e.g., knowing that 9 is greater than 2). The model also uses Least Significant Digit First (LSDF) generation, mimicking human arithmetic by producing digits in reverse order to better handle carries.

Experimental Results

The model was evaluated on the DROP (Discrete Reasoning Over Paragraphs) benchmark, which requires complex operations over scattered text. NC-BERT achieved an overall F1 score of 73.59, outperforming the GenBERT baseline (72.30). The most significant improvements were seen in the "Number" category, where accuracy rose from 75.21 to 77.72 F1. Ablation studies confirmed that the Entity-Number channel was the most critical for general reasoning, while the Type-Number channel specifically improved performance on date-related queries.

Conclusion

NC-BERT demonstrates that restricting attention can be more effective than full self-attention for specialized numerical tasks. By forcing the model to prioritize local contextual entities and types over pre-trained parametric biases, the researchers have created a more robust framework for numerical reasoning in natural language processing. Future work may explore scaling these constrained attention layers through large-scale pre-training.

Summary updated

BibTeX
@inproceedings{kim2022exploiting,
  author = {Jeonghwan Kim and Junmo Kang and Kyung-Min Kim and Giwon Hong and Sung-Hyon Myaeng},
  title = {{Exploiting Numerical-Contextual Knowledge to Improve Numerical Reasoning in Question Answering}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  url = {https://openreview.net/forum?id=40ru-q-rva6},
}
Figure