Nonparametric Masked Language Modeling

Sewon Min, Weijia Shi, Mike Lewis, Xilun Chen, Wen-tau Yih +2 more
12/2/2022
cs.CLcs.AIcs.LG

Official code: facebookresearch/NPM (159 stars, Python, last commit 2023-01-06).

Abstract

Existing language models (LMs) predict tokens with a softmax over a finite vocabulary, which can make it difficult to predict rare tokens or phrases. We introduce NPM, the first nonparametric masked language model that replaces this softmax with a nonparametric distribution over every phrase in a reference corpus.

Show full abstract

NPM fills in the [MASK] solely from retrieving a token from a text corpus. We show that NPM can be efficiently trained with a contrastive objective and an in-batch approximation to full corpus retrieval. Zero-shot evaluation on 16 tasks including classification, fact probing and question answering demonstrates that NPM outperforms significantly larger parametric models, either with or without a retrieve-and-generate approach. It is particularly better at dealing with rare patterns (word senses or facts) and predicting rare or nearly unseen words (e.g., non-Latin script). We release the model and code at github.com/facebookresearch/NPM.

View on arXivView PDF

Code Implementations(1)

The original implementation of Min et al. "Nonparametric Masked Language Modeling" (paper https//arxiv.org/abs/2212.01349)

15915Python, ShellDec 21, 20223 years agoNOASSERTION

Similar Papers

Cite this paper

@article{min2022nonparametric,
  title  = {Nonparametric Masked Language Modeling},
  author = {Sewon Min and Weijia Shi and Mike Lewis and Xilun Chen and Wen-tau Yih and Hannaneh Hajishirzi and Luke Zettlemoyer},
  year   = {2022},
  eprint = {2212.01349},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2212.01349}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2212.01349.svg)](https://codeofpaper.com/paper/2212.01349)

Discussion