Lune

ACL Findings2023

Predicting Numerals in Text Using Nearest Neighbor Language Models

Taku Sakamoto, Akiko Aizawa

Abstract

Commonsense about quantitative properties is essential for a deep understanding of texts containing numerals. However, naive language models (LMs) treat numerals as string tokens; therefore, they lack an understanding of the magnitudes of numerals, resulting in a difficulty in acquiring the commonsense. In this study, we apply the k-nearest neighbor LM (kNN-LM) to the masked numeral prediction (MNP) task, which measures the quantitative commonsense of LMs. kNN-LM extends pretrained neural LMs with the k-nearest neighbor (kNN) search. Since it can utilize patterns that appear in the datastore for prediction, we expect an improvement in numeral prediction accuracy, which is associated with a high rate of occurrence of out-of-vocabulary (OOV) words. Through experiments, we verified that the retrieval-based method is effective for fine-grained predictions of numerals from context, especially for the OOV numerals. We also compared two different context spans for context representations to improve the accuracy of kNN search by using only the words that are closely related to the masked numeral: the mask and its surrounding words, and the mask and its subsequent words. Our results reveal that using only the embeddings of mask tokens for numerals in kNN search is the most effective approach for realizing MNP tasks.

Ask Lune

Ask anything. The answer quotes the paper.

Lune reads all of it and the papers around it, then shows you the passages behind every answer.

Questions to start from

Lune answers from

the full paper · related work

Get the answer

Free to start. No credit card required.

Builds on5

  1. Retrieval Augmented Language Model Pre-TrainingKelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat et al.ICML 2020 · 2,937 citations
  2. Generalization through Memorization: Nearest Neighbor Language ModelsUrvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer et al.ICLR 2020 · 1,038 citations
  3. GNN-LM: Language Modeling based on Global Contexts via GNNYuxian Meng, Shi Zong, Xiaoya Li, Xiaofei Sun et al.ICLR 2022 · 46 citations
  4. An Empirical Investigation of Contextualized Number PredictionTaylor Berg-Kirkpatrick, Daniel SpokoynyEMNLP 2020 · 34 citations
  5. Injecting Numerical Reasoning Skills into Language ModelsMor Geva, Ankit Gupta, Jonathan BerantACL 2020 · 12 citations

Related papers

  1. Do Language Embeddings capture Scales?Xikun Zhang, Deepak Ramachandran, Ian Tenney, Yanai Elazar et al.EMNLP Findings 2020 · 35 citations
  2. Probing Pre-trained Language Models for Semantic Attributes and their ValuesMeriem Beloucif, Chris BiemannEMNLP Findings 2021 · 9 citations
  3. Why do Nearest Neighbor Language Models Work?Frank F. Xu, Uri Alon, Graham NeubigICML 2023 · 33 citations
  4. Do Language Models Understand Measurements?Sungjin Park, Seungwoo Ryu, Edward ChoiEMNLP Findings 2022 · 5 citations
  5. Investigating Numeracy Learning Ability of a Text-to-Text Transfer ModelKuntal Kumar Pal, Chitta BaralEMNLP Findings 2021 · 18 citations
Dusk over the sea between two cliffs drawn in fine vertical lines