Language Models Use Monotonicity to Assess NPI Licensing

Jaap Jumelet, Milica Denić, Jakub Szymanik, Dieuwke Hupkes, Shane Steinert-Threlkeld

TL;DR

Researchers have discovered that Language Models (LMs) don't just memorize word patterns to handle tricky grammar; they actually develop a general semantic understanding of "monotonicity." By using novel probing techniques, the authors show that LMs categorize linguistic environments as "downward monotone" and use this internal knowledge to decide when words like "any" or "ever" are acceptable.

What Problem Does This Paper Address?

While we know modern LMs are surprisingly good at syntax, their grasp of formal semantics—the "logic" of language—is less understood. A classic test case is Negative Polarity Item (NPI) licensing.

NPIs are words like any, ever, or at all that are only "licensed" (acceptable) in specific environments. For example:

  • Licensed: "I do not have any cookies." (Negation creates a valid environment).
  • Unlicensed: "I have any* cookies." (Positive sentences do not).

Linguists have long argued that NPIs are licensed by monotonicity. Specifically, they appear in "downward monotone" (DM) environments—places where you can validly infer from a general term to a specific one (e.g., if "No one ate cookies" is true, then "No one ate chocolate cookies" must also be true).

The authors ask: Do LMs actually learn this abstract semantic property, or are they just using shallow statistical shortcuts?

Methods

The authors used a multi-pronged experimental pipeline to look "under the hood" of 2-layer LSTM language models:

  1. Diagnostic Classifiers (DCs): They trained small linear probes on the LM's hidden states to see if the model internally distinguishes between DM and Upward Monotone (UM) environments.
  2. NPI Acceptability Task: They measured if the LM assigns a higher probability to an NPI (like ever) when it follows a DM licensor versus a UM one.
  3. DC Ranking (Novel): To prove the LM actually uses the monotonicity information it encodes, they introduced a ranking method. They compared the weights of the monotonicity probe (the DC) with the weights of the LM's own decoder. If the NPIs (like any) rank highly in similarity to the DC's weights, it suggests the LM uses the same internal features for both monotonicity detection and NPI prediction.
  4. Corpus Filtering: They trained new LMs on "lobotomized" datasets—one where all NPIs were removed entirely, and others where NPIs were removed from specific environments (e.g., removing any from conditional "if" statements).
The experimental pipeline showing how hidden states are used for both probing and acceptability tasks.

Datasets

  • Training: A 90-million-token English Wikipedia corpus (Gulordava et al., 2018).
  • Evaluation: The NPI corpus from Warstadt et al. (2019), which features 9 distinct linguistic environment classes (Adverbs, Conditionals, Superlatives, etc.) in both DM and UM versions.

Key Insights and Ideas

  • Monotonicity is an Independent Category: Perhaps the most striking finding is that LMs learn to identify DM environments even if they have never seen an NPI during training. This suggests monotonicity is a fundamental semantic feature the model picks up from general language structure, not just a byproduct of learning where any goes.
  • Generalization over Memorization: When the researchers removed NPIs from a specific environment (like "Only"), the model could still correctly license NPIs in that environment by "extrapolating" from its general understanding of monotonicity learned elsewhere.
  • The "Aha" Moment on DC Ranking: The DC Ranking experiment (Figure 2) confirmed a tight link between the probe and the model's inner workings. The NPIs were consistently among the top tokens most similar to the monotonicity probe's weights, meaning the model's "decision" to predict an NPI is driven by the same features the probe uses to identify monotonicity.
Figure 4: The DC Ranking experiment, in which we investigate whether the monotonicity DC and the LM decoder base their predictions on similar cues, by com- puting and ranking the cosine similarities between the DC weights and the decoder weights of each token.

Key Results

  • Probing Accuracy: The diagnostic classifier achieved 97% accuracy in distinguishing DM from UM environments across all classes.
  • Acceptability Success: The LMs were highly successful at NPI licensing, even in complex environments like "Embedded Questions" (85% accuracy).
  • Robustness: In the "Full \ NPI" experiment (no NPIs in training), the monotonicity probing accuracy barely dropped (95% vs 97%), proving the semantic category is robustly learned from other cues.
  • Ranking: The median rank for NPIs in the similarity task was 9 out of 50,000 tokens—an extremely strong signal that the LM's decoder is specifically tuned to monotonicity for these words.

Limitations and Future Work

  • Simple Questions: The models struggled with "Simple Questions" (e.g., "Did the boy ever listen?"). The authors note that question licensing depends on the overall sentence structure rather than a specific "trigger" word, which might be harder for the LSTM to capture.
  • Inference vs. Proxy: While the models categorize these environments, it is still unclear if they truly understand the inferential properties (the logic of going from general to specific) or if they are relying on a different shared property of DM environments.
  • Architecture: This study focused on LSTMs. Future work could apply the "DC Ranking" method to Transformers (like BERT or GPT) to see if attention mechanisms organize this semantic information differently.

Summary updated

Abstract

We investigate the semantic knowledge of language models (LMs), focusing on (1) whether these LMs create categories of linguistic environments based on their semantic monotonicity properties, and (2) whether these categories play a similar role in LMs as in human language understanding, using negative polarity item licensing as a case study. We introduce a series of experiments consisting of probing with diagnostic classifiers (DCs), linguistic acceptability tasks, as well as a novel DC ranking method that tightly connects the probing results to the inner workings of the LM. By applying our experimental pipeline to LMs trained on various filtered corpora, we are able to gain stronger insights into the semantic generalizations that are acquired by these models.
BibTeX
@inproceedings{jumelet2021language,
  author = {Jaap Jumelet and Milica Denić and Jakub Szymanik and Dieuwke Hupkes and Shane Steinert-Threlkeld},
  title = {{Language Models Use Monotonicity to Assess NPI Licensing}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
}

Loading related content...

Figure