Improving negation detection with negation-focused pre-training

Thinh Hung Truong, Timothy Baldwin, Trevor Cohn, Karin Verspoor

TL;DR

Negation is a fundamental linguistic feature that current NLP models often struggle to generalize across different domains. This paper introduces a negation-focused pre-training strategy—combining targeted data augmentation with a novel "negation cue masking" objective—to significantly boost the performance and robustness of negation detection models.

What Problem Does This Paper Address?

Despite the ubiquity of negation in natural language (e.g., "no," "not," "never"), it remains a persistent thorn in the side of modern NLP. Standard benchmarks often underrepresent negation, and even state-of-the-art models like BERT frequently stumble when a sentence's meaning is flipped by a single word.

The challenge is two-fold:

  1. Diversity of Expression: Negation looks different depending on the context. A clinical note ("No serious complications") uses negation differently than a product review ("Not the best quality") or a Sherlock Holmes novel.
  2. Domain Transfer: Because of this diversity, models trained on one type of text (e.g., reviews) perform poorly when tested on another (e.g., biomedical papers).

Negation detection itself consists of two sub-tasks: cue detection (identifying the word that triggers the negation) and scope resolution (determining exactly which part of the sentence is being negated).

Methods

The authors propose a two-pronged strategy to bake "negation awareness" into language models:

  1. Negation-Focused Data Collection: They curated a massive dataset of ~1.38 million sentences containing negations. They pulled data from two distinct sources to ensure variety: the clinical trials registry (TREC-CDS) for biomedical context and Wikipedia (wikitext) for general domain language. They used an extended version of the NegEx lexicon to filter for sentences containing at least one negation cue.
  2. Negation-Focused Pre-training (CueNB): Instead of standard random masking, they introduced a novel objective. They explicitly identified negation cues in their pre-training data and replaced them with a special [CUE] token. The model is then tasked with reconstructing the original cue word. This forces the model to learn the specific contextual patterns that signal negation.

For their experiments, they upgraded the baseline NegBERT by replacing its BERT encoder with RoBERTa and applying whole-word masking to ensure a fair and modern comparison.

Datasets

The researchers evaluated their approach across four diverse benchmarks to test cross-domain generalizability:

  • BioScope (Abstracts & Full Papers): Biological research papers.
  • SFU: A collection of product reviews.
  • Sherlock: Short literary works.
  • VetCompass: Informal clinical notes from the veterinary domain, characterized by heavy use of abbreviations and unique cues.
Dataset statistics showing the variety in sentence counts and unique cues across benchmarks.

Key Insights and Ideas

  • Explicit Masking is the "Secret Sauce": While simply training on more negation-rich data (the "AugNB" model) helped, the explicit cue masking (the "CueNB" model) provided the most significant gains. This suggests that forcing the model to "fill in the blank" for negation cues helps it internalize the underlying logic of negation better than random masking.
  • Handling Speculation: A common error for standard models is confusing negation with speculation (e.g., "not sure if..."). The authors found that their pre-training strategy helped the model distinguish between a definitive negation and a phrase expressing uncertainty.
  • Complex Scope Boundaries: The new model proved much better at identifying non-contiguous or multiple scopes. For example, in the clinical phrase "thorac ausc and abdo palp NAD" (where NAD is the cue for "no abnormality detected"), the model correctly identified that the negation applied to both physical exams, whereas the baseline only caught the nearest one.

Key Results

The proposed CueNB model consistently outperformed the baseline across almost all settings.

  • Same-Dataset Performance: When training and testing on the same corpus, CueNB saw an average F1-score improvement of +1.34 for cue detection and +1.62 for scope resolution.
  • Cross-Dataset Generalizability: The gains were even more pronounced when testing on "unseen" domains, with average improvements of +3.31 for cues and +1.72 for scope.
Aggregated results showing consistent gains for CueNB in both same-dataset and cross-dataset settings.

Detailed breakdowns in the paper show that the biomedical datasets (BioScope and VetCompass) saw particularly strong improvements, likely due to the highly structured but domain-specific nature of their negations.

Table 2: Cue detection results. Gray cells denote the same-dataset setting, and green cells indicate the highest score for each evaluation dataset. Results of AugNB and CueNB are relative changes compared to NegBERT

Limitations and Future Work

The authors noted that Sherlock remained a difficult outlier. This is largely due to inconsistent annotation schemes; for instance, Sherlock includes the scope to the left of the cue, whereas BioScope and SFU typically annotate only to the right.

Future work could involve:

  • Standardizing Annotations: Re-annotating existing datasets with a common scheme to reduce noise during cross-domain training.
  • Beyond Cues: Exploring pre-training objectives that focus on the scope of the negation, rather than just the cue word.
  • Informal Text: Further refining models for highly informal text like VetCompass, where abbreviations and non-standard grammar still pose a challenge.

Summary updated

BibTeX
@inproceedings{truong2022improving,
  author = {Thinh Hung Truong and Timothy Baldwin and Trevor Cohn and Karin Verspoor},
  title = {{Improving negation detection with negation-focused pre-training}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.naacl-main.309},
}
Figure