Skip to main content
QUICK REVIEW

[Paper Review] PromptBERT: Improving BERT Sentence Embeddings with Prompts

Ting Jiang, Jiao, Jian|arXiv (Cornell University)|Jan 12, 2022
Topic ModelingComputer Science12 citations
TL;DR

PromptBERT proposes a prompt-based method to improve BERT's sentence embeddings by mitigating static token embedding bias and ineffective BERT layers. It introduces template-based contrastive learning with template denoising, achieving state-of-the-art performance in both unsupervised and supervised settings, with 2.29 and 2.58 gains over SimCSE on BERT and RoBERTa respectively.

ABSTRACT

We propose PromptBERT, a novel contrastive learning method for learning better sentence representation. We firstly analyze the drawback of current sentence embedding from original BERT and find that it is mainly due to the static token embedding bias and ineffective BERT layers. Then we propose the first prompt-based sentence embeddings method and discuss two prompt representing methods and three prompt searching methods to make BERT achieve better sentence embeddings. Moreover, we propose a novel unsupervised training objective by the technology of template denoising, which substantially shortens the performance gap between the supervised and unsupervised settings. Extensive experiments show the effectiveness of our method. Compared to SimCSE, PromptBert achieves 2.29 and 2.58 points of improvement based on BERT and RoBERTa in the unsupervised setting.

Motivation & Objective

  • To address the poor performance of original BERT in sentence embeddings, which stems from static token embedding bias and ineffective use of BERT layers.
  • To develop a prompt-based method that leverages BERT's full capacity without fine-tuning, avoiding manual bias removal and preserving meaningful tokens.
  • To improve unsupervised training by introducing a novel contrastive learning objective using templates and template denoising to reduce bias and enhance positive pair quality.
  • To close the performance gap between supervised and unsupervised settings in sentence representation learning.
  • To demonstrate that prompt engineering can outperform fine-tuned BERT baselines in sentence embedding tasks.

Proposed method

  • Proposes a prompt-based sentence representation method using templates to guide BERT in generating sentence embeddings, replacing simple pooling of hidden states.
  • Introduces two prompt representation methods: template-based and continuous prompt tuning, with manual templates showing superior performance.
  • Employs three prompt search strategies: manual, T5-generated, and continuous prompts, to find optimal templates for sentence representation.
  • Develops a novel unsupervised contrastive learning objective using multiple templates as positive pairs, with template denoising to filter out biased or irrelevant tokens.
  • Applies template denoising via masked language modeling (MLM) to refine predicted tokens, removing unrelated or noisy predictions (e.g., 'nothing', 'yes') and improving semantic relevance.
  • Uses weighted average of top-k predicted tokens (e.g., top-200) as sentence embeddings, with denoising significantly improving performance on this representation method.

Experimental results

Research questions

  • RQ1Why does original BERT underperform in sentence embeddings despite its strong architecture?
  • RQ2Can prompt-based methods mitigate static token embedding bias and improve sentence representation quality without fine-tuning?
  • RQ3How effective is template-based contrastive learning with denoising in improving unsupervised sentence embedding performance?
  • RQ4Can template denoising reduce bias in predicted tokens and enhance the semantic quality of sentence embeddings?
  • RQ5To what extent does prompt-based contrastive learning stabilize training and close the gap between supervised and unsupervised settings?

Key findings

  • Original BERT layers degrade sentence embedding quality, and static token embeddings suffer from frequency, case, and subword biases, despite being less anisotropic than last-layer representations.
  • A simple baseline using average embeddings of non-biased tokens (e.g., excluding high-frequency subwords and punctuation) outperforms GloVe and rivals post-processing methods like BERT-flow and BERT-whitening.
  • Prompt-based sentence embeddings with manual templates significantly outperform standard BERT pooling and even surpass some fine-tuned BERT baselines in sentence similarity tasks.
  • Template denoising improves the quality of top-k predicted tokens in MLM, increasing the average top-200 token embedding performance from 56.19 to 60.39 on the STS benchmark.
  • The proposed method with template denoising achieves 78.54 ± 0.15 (BERT-base) and 79.15 ± 0.25 (RoBERTa-base) on the STS-B benchmark in the unsupervised setting, outperforming SimCSE by 2.29 and 2.58 points respectively.
  • PromptBERT shows superior training stability, with a 0.53% performance gap between best and worst runs, compared to SimCSE’s 3.14% gap, indicating more consistent convergence.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.