Knowledge Enhanced Masked Language Model for Stance Detection

Kornraphop Kawintiranon, Lisa SinghNAACL 2021

Introduction

Stance detection is the task of determining whether a text expresses a supportive, opposing, or neutral position toward a specific target. This task is particularly challenging on social media platforms like Twitter, where language is informal, highly contextual, and rapidly evolving. Unlike general sentiment analysis, stance is target-specific; a user might express a positive sentiment while taking an opposing stance toward a candidate's loss.

Standard language models like BERT often struggle with this nuance because their default training objective—Masked Language Modeling (MLM)—masks tokens at random. In short tweets, masking generic words like "the" or "is" provides little signal for understanding political leanings. To address this, researchers at Georgetown University developed the Knowledge Enhanced Masked Language Model (KE-MLM), which prioritizes the masking of stance-informative tokens.

Methodology: Injecting Domain Knowledge

The KE-MLM framework improves stance detection through a two-stage process that identifies and emphasizes stance-relevant vocabulary.

Stance Knowledge Mining

The first step involves identifying "stance-relevant" tokens—words or hashtags that appear significantly more frequently in one stance category than others. The researchers utilized a weighted log-odds-ratio with informative Dirichlet priors to statistically surface these high-signal terms. This method successfully captured timely and polarizing tokens such as #maga, bluewave, and americafirst.

Table 1: Examples of stance-relevant words identified for Biden and Trump targets across Support and Oppose categories.

Targeted Masking and Hybrid Fine-Tuning

During the fine-tuning phase, KE-MLM deviates from random masking. Instead, it specifically targets the identified stance-relevant tokens for masking. This forces the model to learn the deep contextual relationships surrounding the most informative words in the political discourse. To prevent the model from overfitting or losing its grasp on general linguistic structures, a hybrid strategy is employed: one epoch of standard fine-tuning followed by one epoch of targeted KE-MLM.

Experimental Setup

The model was evaluated using a new benchmark: the Election 2020 Dataset. This includes over 5 million unlabeled tweets related to the 2020 US Presidential election. For evaluation, a labeled set of 2,500 tweets (1,250 each for Joe Biden and Donald Trump) was manually annotated into Support, Opposition, and Neutral categories.

Results and Discussion

KE-MLM demonstrated superior performance over several baselines, including vanilla BERT and SKEP (a sentiment-enhanced model).

Table 2: Performance comparison (F1-scores) of KE-MLM against baseline models for Biden and Trump stance detection.

As shown in the results, KE-MLM achieved a macro F1-score of 0.7577 for Biden and 0.7877 for Trump, representing significant improvements over the original pre-trained BERT (o-BERT). Qualitative analysis revealed that KE-MLM was particularly effective at identifying stances in tweets containing highly specific political tokens where standard models often defaulted to a "Neutral" prediction.

The researchers also noted the importance of tokenizer updates. By adding crucial stance-specific hashtags to the vocabulary (a-BERT), they achieved a baseline performance boost even before applying the targeted masking strategy.

Conclusion and Future Work

The success of KE-MLM highlights that for domain-specific tasks like stance detection, selective attention to informative vocabulary is more effective than random masking. However, the authors acknowledge that political language evolves rapidly; the "knowledge" mined for 2020 would likely require updating for future election cycles. Future research may explore optimizing masking probabilities to further balance domain-specific knowledge with general language semantics.

Summary updated

BibTeX
@inproceedings{kawintiranon2021knowledge,
  author = {Kornraphop Kawintiranon and Lisa Singh},
  title = {{Knowledge Enhanced Masked Language Model for Stance Detection}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.naacl-main.376},
}
Figure