BERT's Crucial Companion: Next Sentence Prediction

Beyond MLM, BERT was also pre-trained with Next Sentence Prediction (NSP), a task that taught the model to understand discourse-level relationships by predicting if two sentences logically followed each other.

The top 3

  1. NSP's Unique Role Beyond Word Prediction: While Masked Language Modeling (MLM) trains BERT on understanding word-level context, Next Sentence Prediction (NSP) specifically teaches the model to grasp the relationship and coherence between two consecutive sentences.
  2. Inside BERT's NSP Training Mechanism: For the NSP task, BERT receives two sentences (A and B) separated by a [SEP] token and uses the [CLS] token's output to predict if B is the actual next sentence of A (labeled 'IsNext') or a randomly sampled one ('NotNext').
  3. NSP's Limitations: Why Later Models Abandoned It: While initially crucial for BERT, models like RoBERTa and XLNet later found that NSP's contribution to downstream task performance was often minimal, and sometimes even detrimental, leading them to remove or significantly modify this pre-training objective.

Sources

Open the full topic