In NLP: What are up-to-date ways of measuring the surprise of a current statement? I…
- User
In NLP: What are up-to-date ways of measuring the surprise of a current statement?
I thought of preplaxity and NSP. can you help me expand these?
- Assistant
In NLP: What are up-to-date ways of measuring the surprise of a current statement?
I thought of preplaxity and NSP. can you help me expand these?
Got it — you’re talking about “surprise” in an NLP sense, which is basically how unexpected a statement is given some context. You’ve already mentioned:
Perplexity (PPL) → global measure of how well a model predicts a sequence.
Next Sentence Prediction (NSP) → classification task measuring whether a sentence is likely to follow another.
Let’s expand on these and add modern, up-to-date alternatives that go beyond them.
Token- and sequence-level probabilistic measures These come from the model’s internal probability distribution over tokens. MethodWhat it MeasuresNotesToken-level negative log likelihood (NLL)Surprise per token: ( -\log p(tokencontext) )Perplexity (PPL)Geometric mean of inverse probabilities over sequenceStill widely used; can be computed locally for just the new statement given its context.SurprisalSame as NLL but expressed in bits: −log2p-\log_2 p−log2pCommon in psycholinguistics; easier to relate to human reading times.Entropy of prediction distributionUncertainty in model’s prediction before seeing actual tokenHigh entropy = model not confident → higher surprise possible.
Contextual coherence & continuation likelihood These judge how well the statement fits with previous discourse. MethodModern Alternative to NSPSentence-level log probability (from autoregressive LM)Measures plausibility directly without a binary classifier.BERTScore-based coherenceCompare contextual embeddings of preceding and current sentences to expected semantic flow.Contrastive scoringCompare probability of correct continuation vs. plausible but incorrect alternatives (used in e.g. LAMBADA, BLiMP).Next Sentence Ranking (NSR)Instead of yes/no NSP, rank the true next sentence among distractors — more robust.
Embedding-based semantic surprise These use vector-space representations instead of raw probabilities. MethodWhat it CapturesCosine distance between context and statement embeddingsMeasures semantic drift or topic shift.Change in contextual embedding space entropyIf the model’s contextual representation changes drastically, statement may be surprising.Distributional novelty detectionUse a learned embedding distribution for “in-domain” text; high Mahalanobis distance = surprising.
Pragmatic & world knowledge surprise These involve models that incorporate real-world facts or commonsense. MethodExampleFact-checking probabilityModels like FactCC or RAG-based rankers estimate how likely statement is true given knowledge base.Commonsense consistency scoringUse COMET or similar to see if implied events contradict expectations.Counterfactual likelihoodMeasure how much the probability of preceding context would change if statement were true.
Hybrid approaches
Entropy over possible next statements + actual statement probability → captures both uncertainty and fit.
Information gain: Compare LM’s belief state before and after seeing statement.
Surprise relative to domain baseline: Normalize token surprisal by average surprisal in that topic/domain.
💡 If you want an up-to-date practical workflow:
Use a large pre-trained LM (e.g., GPT-4, LLaMA-3, Mistral) to compute token surprisals for the statement given context.
Complement with an embedding-based coherence measure (e.g., cosine similarity in Sentence-BERT space).
Optionally, add a knowledge-based check to catch semantic surprises that are low-probability not just statistically, but factually.
If you want, I can map these metrics into a “surprise score” pipeline that fuses perplexity, coherence, and knowledge signals into one ranking. That would give you something more modern than just PPL + NSP.