Next-sentence prediction (NSP)
BERT's second training task: it is shown two sentences, A and B, and learns to say whether B really came after A in the original text or was picked at random.
Example: "The cat sat." followed by "It fell asleep." is IsNext; followed by "Paris is in France." it is NotNext.
ⓘ Technical definition
A binary classification objective on sentence pairs: the final [CLS] vector goes through the pooler (dense layer + tanh) and a two-way classifier, trained with cross-entropy on IsNext / NotNext labels (50 % each).