NSP-BERT: A Prompt-based Few-Shot Learner Through an Original Pre-training Task--Next Sentence Prediction

Yi Sun, Yu Zheng, Chao Hao, Hangping Qiu
9/8/2021
cs.CLcs.AI

Official code: sunyilgdx/Prompts4Keras (29 stars, Python, Apache-2.0, last commit 2022-10-12).

Abstract

Using prompts to utilize language models to perform various downstream tasks, also known as prompt-based learning or prompt-learning, has lately gained significant success in comparison to the pre-train and fine-tune paradigm. Nonetheless, virtually all prompt-based methods are token-level, meaning they all utilize GPT's left-to-right language model or BERT's masked language model to perform cloze-style tasks.

Show full abstract

In this paper, we attempt to accomplish several NLP tasks in the zero-shot scenario using a BERT original pre-training task abandoned by RoBERTa and other models--Next Sentence Prediction (NSP). Unlike token-level techniques, our sentence-level prompt-based method NSP-BERT does not need to fix the length of the prompt or the position to be predicted, allowing it to handle tasks such as entity linking with ease. Based on the characteristics of NSP-BERT, we offer several quick building templates for various downstream tasks. We suggest a two-stage prompt method for word sense disambiguation tasks in particular. Our strategies for mapping the labels significantly enhance the model's performance on sentence pair tasks. On the FewCLUE benchmark, our NSP-BERT outperforms other zero-shot methods on most of these tasks and comes close to the few-shot methods.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Prompt-learning methods used BERT4Keras (PET, EFL and NSP-BERT), both for Chinese and English.

290Python, ShellMay 7, 20224 years agoApache-2.0
bertbert4keraseflnlpnsp-bert+4 more

Similar Papers

Cite this paper

@article{sun2021nspbert,
  title  = {NSP-BERT: A Prompt-based Few-Shot Learner Through an Original Pre-training Task--Next Sentence Prediction},
  author = {Yi Sun and Yu Zheng and Chao Hao and Hangping Qiu},
  year   = {2021},
  eprint = {2109.03564},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2109.03564}
}

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/2109.03564.svg)](https://codeofpaper.com/paper/2109.03564)

Discussion