Concept

Next Sentence Prediction (NSP)

A simple method for designing a self-supervised classification task to train an encoder is Next Sentence Prediction (NSP), as presented in the original BERT paper. This approach is built on the assumption that a good text encoder should effectively capture the relationship between two sentences. To model this, NSP uses the output of encoding two consecutive sentences, SentA\mathrm{Sent}_{A} and SentB\mathrm{Sent}_{B}, to determine whether SentB\mathrm{Sent}_{B} is indeed the next sentence following SentA\mathrm{Sent}_{A}. For example, if SentA\mathrm{Sent}_{A} is 'It is raining .' and SentB\mathrm{Sent}_{B} is 'I need an umbrella .', the model is tasked with recognizing this sequential relationship.

0

1

Updated 2026-05-02

Tags

What is BERT?

Data Science

Ch.1 Pre-training - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences

Related
Learn After