Skip to main content
QUICK REVIEW

[Paper Review] Quantifying the Contextualization of Word Representations with Semantic Class Probing

Mengjie Zhao, Philipp Dufter|arXiv (Cornell University)|Apr 25, 2020
Topic Modeling4 citations
TL;DR

This paper quantifies contextualization in BERT by probing semantic class (s-class) inference from contextualized word embeddings. It finds that lower layers contribute most to contextualization, local context (±5 words) is sufficient, and finetuning preserves pretrained contextualization knowledge while making top layers more task-specific.

ABSTRACT

Pretrained language models have achieved a new state of the art on many NLP tasks, but there are still many open questions about how and why they work so well. We investigate the contextualization of words in BERT. We quantify the amount of contextualization, i.e., how well words are interpreted in context, by studying the extent to which semantic classes of a word can be inferred from its contextualized embeddings. Quantifying contextualization helps in understanding and utilizing pretrained language models. We show that top layer representations achieve high accuracy inferring semantic classes; that the strongest contextualization effects occur in the lower layers; that local context is mostly sufficient for semantic class inference; and that top layer representations are more task-specific after finetuning while lower layer representations are more transferable. Finetuning uncovers task related features, but pretrained knowledge is still largely preserved.

Motivation & Objective

  • To quantitatively measure how effectively BERT interprets words in context using semantic class inference.
  • To investigate the contribution of individual network layers to contextualization in BERT.
  • To evaluate the impact of context window size on word representation contextualization.
  • To analyze how finetuning alters the contextualization capacity of BERT representations.
  • To assess the preservation of pretrained contextualization knowledge after finetuning.

Proposed method

  • Probing contextualized BERT word embeddings with a diagnostic classifier to predict semantic classes (s-classes) of target words.
  • Using a Wikipedia-based semantic class resource (Wiki-PSE) to define and label s-classes for word sense disambiguation.
  • Evaluating s-class inference performance across BERT layers, context window sizes, and pretrained vs. finetuned models.
  • Measuring contextualization via F1 scores on s-class prediction, with higher scores indicating stronger contextual interpretation.
  • Comparing representations from full-sentence context to local context windows (e.g., ±5 words) to assess context length requirements.
  • Analyzing changes in s-class inference performance before and after finetuning on downstream tasks to study representation adaptation.

Experimental results

Research questions

  • RQ1To what extent can BERT’s contextualized word embeddings infer the semantic class of a word in context?
  • RQ2Which BERT layers contribute most to contextualization, and how does this vary across layers?
  • RQ3How much context (in terms of word window size) is required for effective word contextualization?
  • RQ4How does finetuning affect the contextualization capacity of BERT representations?
  • RQ5To what extent is pretrained contextualization knowledge preserved after finetuning?

Key findings

  • BERT achieves high s-class inference performance (F1 ≈ 85%), indicating strong contextualization, but with room for improvement.
  • The strongest contextualization effects occur in the lower layers of BERT, with minimal incremental gains from the top two layers.
  • Local context within a 10-word window (±5 words) is sufficient for effective contextualization, suggesting full-sentence attention may be unnecessary.
  • Finetuning causes significant changes in top-layer representations for word-level tasks like part-of-speech tagging, but less so for sentence-level tasks like paraphrase classification.
  • Pretrained knowledge about contextualization is well preserved after finetuning, especially in lower layers, which remain highly transferable.
  • Top-layer representations become more task-specific after finetuning, while lower-layer representations maintain general contextualization capacity.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.