Abstract
Recent advancements in Natural Language Processing have been driven by contextualized word representations such as BERT. While "retrofitting"—the process of refining word embeddings using external semantic lexicons—has proven successful for static embeddings, its efficacy for contextualized models remains under-explored. This paper investigates two novel methods for injecting lexical knowledge into BERT: a training-set-based smoothing approach and a test-sentence-based counterfactual averaging approach. Through extensive evaluation on biomedical relation extraction and sentiment analysis tasks, we report a significant "negative result": standard retrofitting techniques provide negligible performance gains, suggesting that BERT’s deep attention mechanisms are inherently robust to the local semantic shifts that retrofitting aims to address.
Introduction
In the evolution of word embeddings, static models like Word2Vec and GloVe provided a single vector for each word, regardless of context. Researchers discovered that these vectors could be significantly improved by "retrofitting" them to human-curated lexicons (e.g., WordNet), ensuring that synonyms were positioned closely in the vector space.
With the advent of transformer-based models like BERT, embeddings became contextualized, meaning the vector for a word like "bank" changes based on its surrounding text. While BERT achieves state-of-the-art results across many benchmarks, it remains a "black box" regarding specific linguistic constraints. This study explores whether the success of retrofitting can be replicated in the contextualized era to further refine BERT’s internal representations.
Methodology
The authors propose two distinct methods for Contextualized Embedding Refinement (CER), focusing on the [CLS] token—the summary representation BERT uses for classification tasks.
Method A: Training-Set Based Refinement
This method attempts to refine a word's representation in a test sentence by leveraging its occurrences across the entire training corpus. For a target word, the model identifies all instances of that word and its synonyms in the training data, calculating a weighted average of these contexts to "smooth" the representation. The goal is to provide a more stable, knowledge-informed vector for the classifier.
Method B: Test-Sentence Based Refinement
This approach operates entirely at inference time without relying on the training set. For a given test sentence, the model generates "counterfactual" versions by replacing the target word with its synonyms from a lexicon. The final representation is an average of the [CLS] tokens generated by these variations. This method seeks to make the model's prediction invariant to synonym substitution.
Experimental Setup
The methods were evaluated across two high-stakes domains:
- Biomedical Relation Extraction: Utilizing the ChemProt, DDI, and i2b2 2010 corpora to identify interactions between drugs, proteins, and medical conditions.
- Sentiment Analysis: Utilizing the SST-2 (Stanford Sentiment Treebank) dataset.
Lexicons: The study utilized domain-specific biomedical verb clusters and general-purpose resources including WordNet, FrameNet, and the Paraphrase Database (PPDB).
Results and Discussion
Contrary to the success seen with static embeddings, the experiments yielded a "negative result," where retrofitting failed to provide meaningful improvements over the baseline BERT model.
The Robustness of BERT
A key finding was BERT's surprising indifference to individual word tokens. In several tests, replacing specific word embeddings with random noise or zeros resulted in almost no change to the final classification. This suggests that BERT’s power is derived from its global attention mechanisms and the structural context of the sentence, rather than the precise semantic coordinates of any single word vector.
Performance Metrics
- Method A: Consistently degraded performance. For example, on the DDI dataset, F1-scores dropped from 80.11 to 78.78. The authors suggest that the context of a word in the training set is often too distinct from its context in the test set, introducing harmful noise.
- Method B: Produced negligible gains. On ChemProt, the F1-score saw a minor increase from 72.61 to 72.63. On SST-2, accuracy moved from 92.00 to 92.11.
- Baselines: Simple strategies, such as "Weighted Majority Vote" (where different synonym-substituted sentences vote on the label), often outperformed the more complex embedding-level retrofitting.
The Oracle Gap
To determine if the failure lay in the concept or the execution, the authors calculated an "Oracle Topline"—a scenario where the model perfectly selects the best possible synonym replacement for every sentence. This oracle showed significant potential for improvement, indicating that while external knowledge could help, the mathematical averaging used in current retrofitting techniques is too blunt a tool to capture it.
Conclusion
This study highlights a fundamental difference between static and contextualized embeddings. While static embeddings benefit from global semantic alignment, BERT’s contextualized representations are highly specialized to their specific sentence structure. Future work should move away from simple averaging and toward more sophisticated, context-aware selection mechanisms that can identify which external knowledge is truly relevant to a specific instance.
Summary updated