Pragmatics, Implicature, and Presupposition › Testing Next-Token Models for Context Sensitivity
Language AI HandbookAll chapters The RSA model is a model of meaning. A next-token model is a model of strings. To connect them, we need a measurement design that respects the difference.
The Measurement Problem
A language model assigns a probability to each token given a context:
where:
- : the token being predicted at position
- : the preceding tokens that form the context
- : the model parameters
A pragmatic listener, by contrast, assigns a probability to a state given an utterance:
where is the intended state (for example, how many servers passed) and is the observed utterance (for example, "some").
These are different objects. The token probability is over surface forms. The meaning probability is over intended states. A model can assign high probability to the token "some" without representing the not-all inference. Conversely, a model can represent the inference in some internal sense without its next-token distribution reflecting it. The token probability is not a calibrated belief about the number of servers that passed. It is a belief about what token comes next, and the two can come apart in many ways.
There are several ways to bridge the gap, and each has costs:
- Marginalize over strings with the same meaning. Assign meanings to complete continuations under a specified stopping rule. Then add probabilities of distinct completed outcomes that share the relevant meaning. Summing both a prefix and its extensions as separate outcomes would count some probability twice.
- Behavioral probes. Ask the model to answer "How many servers passed?" or to choose among states. This measures a different behavior, and it is sensitive to prompt format, but it can be more interpretable than a raw token probability.
- Calibration. Evaluate probabilities against observations of the same forecast event on held-out examples. If the forecast is the chance a reader endorses "not all," compare forecasts with readers’ endorsements. A next-token production score forecasts a different event.
- Ordinal predictions. Test whether a model ranks outcomes in the direction predicted by a specified theory. In our fully informed RSA baseline, exceeds . The capped tally makes "all" impossible, so the corresponding posterior comparison is undefined there.
The safest approach is to be explicit about which object you are measuring and to avoid inferring pragmatic competence from a single token probability. Each of the four methods above measures something different, and a claim that is justified under one method may not be justified under another. A calibration result tells you about the model's probability estimates. A behavioral probe tells you about the model's outputs on a different task. An ordinal result tells you about a qualitative pattern. None of them, by itself, tells you that the model has pragmatic competence in the sense that a human does.
Paired Context Interventions
A controlled test fixes the target utterance and varies one contextual factor at a time. The target is the same string in both conditions. The contexts are minimal pairs. The measured quantity is the change in log probability of the target:
where:
- : the fixed string whose probability is measured, such as "some"
- and : the two conditions of the minimal pair
- : the model's probability of the target string given that context
- : the log-probability ratio, which measures how much the context shift changes the target's likelihood
When both target probabilities are positive, is finite and positive if the target is more likely under context B. A negative means it is less likely. The same design can be applied to the whole next-token distribution with a divergence measure, such as Kullback-Leibler divergence. The KL divergence is nonnegative and zero exactly when the distributions agree. It can be infinite when assigns zero mass to an outcome with positive mass. It need not agree with the divergence in the reverse direction.
The design choices matter:
- Fix the target. Verify the target IDs after tokenizing each complete prompt with its continuation. If a token crosses the prompt boundary, adjust the separator or scoring setup consistently. Sum the conditional log probabilities of all target tokens.
- Vary one factor. Choose one factor to change, such as the prior, the available alternatives, or the speaker's knowledge. Changing several factors in one pair leaves their separate contributions unidentified.
- Use multiple items. A single context pair is an anecdote. The unit of analysis is the item, not the token. Compute a per-item delta and use a paired test across items.
- Control the prompt. Keep the shared wording and sentence order fixed within each pair. Across independently created pairs, distribute any permissible order variations evenly. Omit labels such as "implicature" that give away what you are testing.
- Report the model and decoding. State the model version, the tokenizer, the temperature, and whether you used log probabilities or sampled generations. A greedy generation is not a probability.
- Check contamination. The items may appear in pretraining data. Use novel contexts and held-out items. A benchmark score is not evidence of generalization if the benchmark leaked.
These choices are not bureaucratic. Each one addresses a specific threat to validity. Fixing the target controls for lexical differences. Varying one factor controls for confounds. Using multiple items controls for idiosyncratic contexts. Controlling the prompt controls for superficial cues. Reporting the model and decoding supports reproducibility. A contamination check reduces the risk of mistaking memorization for generalization. A study that skips one of these steps may still be informative, but the claim it supports is weaker, and the weakness should be stated explicitly.
A Toy Scorer for the Arithmetic
To make the measurement code checkable, we use a stipulated lookup table. It is not a language model, and the numbers are invented. The purpose is to show the arithmetic of a paired effect, not to report a result about any real model.
PythonIn [15]Expand
VOCAB = ["all", "most", "some", "none", "unclear"]
# A stipulated lookup table, not a language model.
# Each row is a probability distribution over the next word.
TOY_CONTEXTS = {
"complete_report": np.array([0.55, 0.15, 0.20, 0.02, 0.08]),
"capped_report": np.array([0.08, 0.12, 0.42, 0.03, 0.35]),
}
def toy_scorer(context):
"""Return log-probabilities over VOCAB for a stipulated context."""
return np.log(TOY_CONTEXTS[context])
def paired_effect(scorer, target, context_a, context_b):
"""Difference in log P(target | context) for a fixed target."""
i = VOCAB.index(target)
return scorer(context_b)[i] - scorer(context_a)[i]
def kl_divergence(p, q):
"""Return KL(p || q) in nats for aligned probability vectors."""
active = p > 0
if np.any(q[active] == 0):
return np.inf
return float(np.sum(p[active] * (np.log(p[active]) - np.log(q[active]))))Both toy distributions sum to one. In each case, all three servers passed in the underlying scenario. In the complete-report condition, Ada sees the exact count. In the capped-report condition, she sees only "at least two". We stipulate a probability of 0.20 for "some" with the full count and 0.42 with the capped count. Greater use of the weak report under limited knowledge is compatible with the speaker model above. The lookup probabilities illustrate arithmetic and were chosen independently of that model.
ConsoleOut [16]Expand
complete_report P('some') = 0.20
capped_report P('some') = 0.42
Delta log P('some') = 0.742
KL(capped_report || complete_report) = 0.659The delta is positive because the toy lookup assigns higher probability to the same target under the capped report. The KL divergence compares all five probabilities. Both quantities describe text scores. Measuring a listener's interpretation would require asking about the likely server count after showing the report, or specifying a mapping from continuations to interpretations.
The arithmetic is easier to read when the two stipulated next-token distributions are placed side by side. The chart shows the same vocabulary under both contexts, so the shift in "some" can be compared with the shifts in the competing tokens.
PythonIn [17]Expand
import numpy as np
toy_context_names = ["complete report", "capped report"]
toy_context_matrix = np.vstack(
[
TOY_CONTEXTS["complete_report"],
TOY_CONTEXTS["capped_report"],
]
)
toy_x = np.arange(len(VOCAB))
toy_bar_width = 0.36VisualizationOut [18]Expand

A real model may react to the wording of the dashboard description. To test the knowledge manipulation, repeat the comparison with paraphrases, counterbalance irrelevant wording, and hold the underlying scenario fixed. Scoring Ada's report measures a production preference. Probing Ben's interpretation after he reads it measures a different response.
A Paired Prompt You Can Score
Use the same instruction and completion prefix in both conditions. Change the dashboard report from exact to capped. Keep the true count of three in the answer key so the model sees only the dashboard report.
CodeExpand
Ada can see only the dashboard report.
The dashboard report says: three passed.
Ada may report none, some, or all. Complete Ada's report.
Ada's report:For the second prompt, replace three passed. with at least two passed. in the dashboard line. Score the identical continuation Some of the servers passed the check. after both prompts with the same model and tokenizer. Include the leading space in both. If the continuation occupies several tokens, sum the conditional log probabilities over the whole continuation. The change measures the score of this exact continuation under the two prompts. A separate listener task can test which state a reader infers from the report.
From Tokens to Meanings
If you want a distribution over meanings, you need a model of meaning that is separate from the token distribution. Some options:
- Map completed continuations to meanings. A formal grammar can assign meanings to distinct completed continuations. Their probabilities induce a distribution over meanings. This is clean in a toy domain and hard in open-domain language.
- Ask the model to report a meaning. Use a multiple-choice or free-response probe. This measures the model's behavior on a different task, and it can be compared to the RSA prediction.
- Fit a calibration map. Learn a mapping from token probabilities to human meaning judgments. Check the mapping on held-out items. Report reliability, not just accuracy.
- Test ordinal predictions. Compare conditions that the theory says should differ in a particular direction. An ordinal test checks the direction of the change. The result is invariant under a shared strictly increasing transformation of the scores. Calibration compares numerical forecasts with outcome frequencies.
Each option makes a different claim. The first is an implementation claim about a semantics. The second is a behavioral claim about the model's outputs. The third is an empirical claim about calibration. The fourth is a claim about ordinal structure. Mixing them up is a common source of overinterpretation. Calibration summarizes the relationship between predictions and observed outcomes. A claim about the model's internal representations needs separate evidence. Keeping the claims separate is part of what makes the evidence interpretable.
Benchmarks and Evidence
Several benchmarks make the evaluation problem concrete.
IMPPRES. Jeretic and colleagues tested BERT, InferSent, and a bag-of-words model trained on MultiNLI. BERT often labeled the scalar inference from "some" to "not all" as entailment. In the presupposition analysis, each model's projection scores used items for which it correctly classified the corresponding cancellation and unembedded control pairs. The bag-of-words system also predicted positive presuppositions on its retained items. BERT was the only evaluated system that reliably rejected negation of the projected content under the reported analysis. Results varied by trigger and condition. IMPPRES study
The Goldilocks of Pragmatic Understanding. Ruis and colleagues asked models to judge indirect replies with "yes" or "no". Models tuned with instructions written for individual training examples generally performed better on the binary implicature task. The authors ranked answer likelihoods for most models. For GPT-3.5-turbo and GPT-4 they used greedy decoding with prompts that requested "yes" or "no". The comparison spans different models and training settings. The binary scoring task does not by itself diagnose over-application of an inference. Ruis et al.
PUB. The benchmark tests models on several pragmatic phenomena, including implicature and presupposition. Three human evaluators completed a subset of the model evaluation items. The authors report aggregate differences from this human comparison and variation across tasks. In Figure 5's Implicature NLI panel, the best tested model score exceeds the human subset score. PUB study
These benchmarks are useful because they standardize items and metrics. They are limited because pragmatic competence is multi-dimensional, and a single score can hide important differences. A model that scores well on scalar implicature may fail on presupposition projection. A model that scores well on both may still be sensitive to prompt wording. The evidence is always conditional on the benchmark. A benchmark result is a constraint on the space of possible claims, not a final verdict on the model's pragmatic competence.
Behavior, Evidence, and Implementation Claims
It helps to keep three kinds of claims separate:
- Implementation claims are about the code and the model. "This function normalizes the speaker over utterances." "This prompt template has the context before the target." These claims can be checked by reading the code.
- Behavioral claims are about what the system does. "The model assigns higher probability to 'some' when the context mentions an unchecked server." These claims can be checked by running the system.
- Evidence claims are about what the behavior shows. "The model represents the speaker's epistemic state." "The model is pragmatically competent." These claims require an argument that connects the behavior to the theoretical construct. They are the easiest to overstate.
The RSA model is an implementation of a stipulated theory. Its outputs are behavioral predictions under that theory. They become evidence about human cognition only when compared to human data. The same discipline applies to language models. A token probability is a behavior. A conclusion about pragmatic competence is an evidence claim. The gap between them is where most overinterpretation happens. Keeping the three kinds of claims separate does not make the evidence stronger, but it makes the argument clearer, and it makes it easier to see where additional work is needed.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!