Traditional Natural Language Processing often relies on "embeddings"—dense vectors that represent the meaning of a word or sentence in a high-dimensional space. However, these vectors can be opaque and struggle to capture how a specific context subtly alters a word's function.
A growing body of research suggests a more intuitive and sensitive way to probe a model's "mind": instead of looking at its internal vectors, we should look at its output probability distributions. By measuring how these distributions shift when we add, remove, or change context, we can precisely quantify semantic distance, model "stubbornness," and the plausibility of a model's reasoning.
The Model as a Semantic Probe
The core intuition behind this direction is that a language model’s vocabulary distribution—the list of probabilities it assigns to every possible next word—is a complete snapshot of its current "expectations."
If you mask a word in a sentence, the model uses the surrounding context to predict what belongs there. Guy Kushilevitz and Shaul Markovitch demonstrated in A Two-Stage Masked LM Method for Term Set Expansion that if two different sentence structures prompt a model to predict the same set of candidate words for a missing slot, those structures are semantically equivalent. In this view, meaning is defined by the "hole" a context creates and the words that can fill it.
Measuring Context Reliance
One of the most powerful applications of this idea is determining whether a model is actually using the information provided in a prompt or simply relying on its own internal biases.
Gabriele Sarti and colleagues introduced PECoRe (Plausibility Evaluation of Context Reliance) in Quantifying the Plausibility of Context Reliance in Neural Machine Translation. The mechanism is elegantly simple:
- Calculate the probability distribution for a token with the context.
- Calculate the distribution for the same token without the context.
- Measure the KL-Divergence between these two distributions.
If the divergence is high, the context significantly "swayed" the model’s prediction. This approach is more sensitive than just looking at the top-ranked word; it captures subtle shifts in confidence across the entire vocabulary. Sarti later extended this in Model Internals-based Answer Attribution for Trustworthy Retrieval-Augmented Generation to identify which specific retrieved documents actually influenced a RAG system's answer.
Neighboring Distribution Divergence
When two sentences share 90% of the same words, traditional vector-based metrics often fail to see the difference. Letian Peng addressed this by developing Neighboring Distribution Divergence (NDD) in Contextualized Semantic Distance between Highly Overlapped Texts.
Instead of comparing the sentences directly, NDD masks the shared words in both sentences. It then compares the probability distributions the model generates for those identical slots. If the surrounding context in Sentence A makes the model expect different words than the context in Sentence B, the sentences are semantically distant—even if they look nearly identical on the surface. This "mask-and-predict" strategy has proven highly effective for unsupervised tasks like text compression and detecting personal privacy leaks.
The Tug of War between Prior and Context
This distributional lens also reveals the "internal conflict" within Large Language Models. Kevin Du and Ryan Cotterell explored this in Context versus Prior Knowledge in Language Models, defining two key metrics:
- Persuasion Score: How much the context forces the model to deviate from its internal "prior" (pre-trained knowledge).
- Susceptibility Score: How easily a model's distribution can be shifted by external information.
They found that models are "stubborn" about entities they saw frequently during training. Similarly, Isabelle Augenstein and Pepa Atanasova showed in From Internal Conflict to Contextual Adaptation of Language Models that when a model has internal "intra-memory conflicts" (e.g., seeing two different facts about the same subject during training), it becomes less likely to adapt to new, helpful context.
Why It Works
This research direction works because it treats the language model as a probabilistic observer rather than a static database. By analyzing the change in output distributions (using metrics like KL-Divergence, Jensen-Shannon distance, or Hellinger distance), researchers can isolate specific causal factors:
- Contextual Independence: Iskander Azangulov uses distribution shifts to test if tokens are independent enough to be generated in parallel in Parallel Sampling from Masked Diffusion Models.
- Hallucination Detection: Min-Hsuan Yeh uses the "tug-of-war" between distributions to flag when a model is ignoring context to hallucinate from its own weights in LUMINA.
- Weak Supervision: Letian Peng uses "Divergence Distance" to perform Named Entity Recognition with almost no training data, simply by measuring how much a sentence's expectations shift when a candidate word is swapped with a known example in X-NER.
By moving from "what the model represents" to "how the model's expectations change," this field provides a more granular, interpretable, and mathematically grounded way to understand the behavior of modern AI.