Sentence Meaning and Natural Language Inference › Compositional Semantics: Functions, Quantifiers, and Scope
Language AI HandbookAll chapters Sentence Meaning and Natural Language Inference › Compositional Semantics: Functions, Quantifiers, and ScopeSection view · Sections in this chapter5 / 12 ↓
Reading tools Definitions, links & notes
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Compositionality is easiest to see when we treat word meanings as functions. An adjective like "red" can be modeled as a function from entities to truth values, or equivalently as a set of red things. At a fixed world , write for the set of entities satisfying a predicate expression . This is an entity set, distinct from the set of worlds used for complete sentences. For an intersective use of "red," combining it with "car" intersects the two entity sets:
where:
- : the set of red cars, i.e., the meaning of the phrase "red car"
- : the set of red things
- : the set of cars
- : set intersection, so the phrase denotes things that are both red and cars
This works for intersective adjectives. But not all adjectives are intersective, and the difference has direct consequences for entailment.
- "Former" is non-intersective and introduces a past-time condition. A former president need not hold the relevant presidency now. The phrase is not formed by intersecting presidents with a context-free set of "former things"; offices, times, and tenures matter.
- "Fake" is privative. A fake gun is not a gun in the relevant sense. It is designed to look like one, but the whole point is that it fails the ordinary criteria for being a gun.
- "Big" is subsective and gradable. A big mouse is big for a mouse, not necessarily big in absolute terms. A big mouse is still a mouse, so "big mouse" does entail "mouse," but the size is relative to the noun.
These distinctions matter for NLI. "Alice is a former president" does not entail "Alice is a president." "This is a fake gun" does not entail "This is a gun." A model that treats all adjectives as intersective will make systematic errors, because it will assume that every adjective-noun phrase entails the bare noun. The lexicon has to tell the model which adjectives behave which way.
Quantifiers as Set Relations
Quantifiers are another core part of compositional meaning. Generalized quantifier theory treats determiners as relations between sets. This perspective unifies the meanings of "every," "some," "no," and "most" under a single scheme, and it makes their entailment patterns easy to state.
- "Every dog barks": the set of dogs is a subset of the set of barkers.
where:
-
: the restrictor set (e.g., the set of dogs)
-
: the scope set (e.g., the set of barkers)
-
: true when the determiner "every" relates and
-
: set inclusion
-
"Some dog barks": the set of dogs intersects the set of barkers.
where:
-
: the restrictor set (e.g., the set of dogs)
-
: the scope set (e.g., the set of barkers)
-
: true when the determiner "some" relates and
-
: set intersection
-
: the intersection is nonempty, so at least one element is in both sets
-
"No dog barks": the set of dogs and the set of barkers are disjoint.
where:
-
: the restrictor set (e.g., the set of dogs)
-
: the scope set (e.g., the set of barkers)
-
: true when the determiner "no" relates and
-
: set intersection
-
: the empty set, so no element is in both and
-
"Most dogs bark": in this finite-set model, more than half of the dogs are in the set of barkers. With no dogs, the strict majority condition is false.
where:
- : the restrictor set (e.g., the set of dogs)
- : the scope set (e.g., the set of barkers)
- : true when the determiner "most" relates and
- : the set of elements of that are also in
- : set cardinality (number of elements)
- : more than half the elements of are in
These definitions support entailments. "No dogs bark" entails "No poodles bark" because the set of poodles is a subset of the set of dogs. If no dogs are in the barking set, no poodles are either. "Every dog barks" does entail "Every poodle barks" if poodles are dogs: if every dog barks, and every poodle is a dog, then every poodle barks. The direction depends on monotonicity, which we turn to next.
Monotonicity
Monotonicity describes how entailments behave when you replace a constituent with a broader or narrower term.
- Upward entailing contexts preserve entailments from a narrower term to a broader term. "A poodle barked" entails "A dog barked." If you replace "poodle" with the broader "dog," the sentence remains true.
- Downward entailing contexts reverse the direction. "No dog barked" entails "No poodle barked." Here you replace "dog" with the narrower "poodle," and the entailment still holds.
Negation creates downward entailing contexts. "The door is not open" entails "The door is not ajar" if "ajar" is a way of being open. The broader term "open" is replaced by the narrower "ajar" under negation, and the entailment still holds precisely because negation reverses the direction of inference.
Monotonicity appears in analyses of negative polarity items such as "any," but it is a partial generalization rather than a complete licensing rule. Broader accounts also address contexts beyond downward entailment. Free-choice "any," as in "Any student may apply," needs to be distinguished from the negative-polarity use. For NLI, monotonicity gives a narrower, direct benefit: once a context's entailment direction and lexical inclusion relation are specified, they license controlled replacement pairs.
Scope and Ambiguity
Quantifier scope is a major source of NLI difficulty. Consider:
Every student read a book.
This has at least two readings:
- Every student read some book or other, possibly different books.
- There is a shared book that every student read, without requiring it to be the only such book.
The first reading is:
where:
- : a variable ranging over the entity domain, restricted by
- : a variable ranging over the entity domain, restricted by
- : true if is a student
- : true if is a book
- : true if read
- : universal quantifier over domain entities, with the implication restricting the assertion to students
- : existential quantifier over books
- : logical implication
The second is:
where:
- : a variable ranging over the entity domain, restricted by
- : a variable ranging over the entity domain, restricted by
- : true if is a book
- : true if is a student
- : true if read
- : existential quantifier selecting a shared book witness , without asserting uniqueness
- : universal quantifier over domain entities, with the implication restricting the assertion to students
- : logical conjunction
Now consider the hypothesis:
There is a book that every student read.
Under the first reading of the premise, the hypothesis is not entailed. The students might each have read a different book. Under the second reading, it is entailed directly. An evaluation that supplies one label for this pair must fix the intended scope reading. A robust NLI system needs to represent scope, or at least be sensitive to it, because otherwise it cannot tell which reading of the premise it is working with.
Negation scope is equally important. "All that glitters is not gold" is famously ambiguous between "Not everything that glitters is gold" and "Everything that glitters is not gold." The proverb usually means the first, but the surface order suggests the second. Models that ignore scope will mislabel such cases. Scope is not a decorative flourish; it changes the truth conditions, and therefore it changes the entailment relations.
Comparatives, Temporal Relations, and Transitivity
Comparatives and temporal relations have their own entailment patterns.
- "Alice is taller than Bob" entails "Bob is shorter than Alice."
- "Alice is taller than Bob and Bob is taller than Carol" entails "Alice is taller than Carol" by transitivity.
- "Alice left before Bob arrived" entails "Bob arrived after Alice left."
- "Alice left after Bob arrived" entails "Bob arrived before Alice left," though tense and aspect can complicate temporal inference in other cases.
Temporal inference is especially tricky because it depends on event boundaries, aspect, and world knowledge. "Alice was reading when Bob arrived" entails that Alice was reading at the time Bob arrived. "Alice read a book when Bob arrived" is compatible with Alice starting to read after Bob arrived. The difference between progressive and simple past matters. A model that treats every "when" clause the same way will conflate two quite different temporal structures.
Idioms and Non-Compositionality
Not all phrase meaning follows from combining the literal word senses. Idioms like "kick the bucket" mean "die," but the individual words do not compose to that meaning in the usual way. "Spill the beans" means "reveal a secret." An analysis that combines only the literal word senses misses the idiomatic reading; the phrase-level interpretation must be represented somehow.
Metaphor and sarcasm require contextual interpretation. "That meeting was a roller coaster" need not describe an amusement park ride, and "Great, another delay" can convey frustration. A model that combines only literal word senses misses these readings. Compositionality itself does not impose that limitation: a meaning function can incorporate context or treat a conventional phrase as a lexical unit. Interpreting the utterance also draws on convention and world knowledge.
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!