Introduction
Pre-trained language models like BERT, GPT, and ELMo have fundamentally shifted the landscape of Natural Language Processing (NLP) by providing deep contextualized word representations. However, these models primarily rely on "plain" contextual features, predicting words based on their immediate neighbors without an explicit, structured understanding of sentence meaning. This often leaves models vulnerable to adversarial attacks or results in semantically incomplete answers in complex tasks like machine reading comprehension.
SemBERT (Semantics-aware BERT) addresses this limitation by explicitly incorporating structured semantic information—specifically "who did what to whom" clues—derived from Semantic Role Labeling (SRL). By fusing these explicit semantic frames with BERT’s contextual embeddings, the model achieves state-of-the-art results across multiple natural language understanding (NLU) tasks.
Architecture and Methodology
The SemBERT framework integrates explicit linguistic knowledge into the neural architecture through three primary components: Semantic Role Labeling, Semantic Embedding, and Integration/Alignment.
1. Semantic Role Labeling (SRL)
An out-of-the-box, pre-trained SRL labeler (based on a deep BiLSTM) annotates the input text. It identifies various "predicate-argument" structures, such as the verb (predicate), the subject (agent), the object (theme), and modifiers like time or location. This labeler is kept frozen during training, making the framework easy to implement on top of existing BERT checkpoints.
2. Semantic Embedding
Because a single sentence can contain multiple predicates, the model generates multiple sequences of semantic labels. These labels are mapped to embeddings and processed through a BiGRU to capture the dependencies between labels within a sequence.
3. Integration and Alignment
A significant challenge in this fusion is the mismatch in tokenization: BERT uses subword "WordPiece" tokenization, while SRL labels are assigned to full words. SemBERT resolves this using a CNN with Max Pooling to aggregate BERT’s subword representations back into word-level representations. Finally, the word-level BERT features and the semantic label embeddings are concatenated and passed through a fully connected layer to create a joint representation for downstream tasks.
Experimental Results
The authors evaluated SemBERT on a wide array of NLU benchmarks, including the GLUE suite, SQuAD 2.0, and SNLI. In all cases, the addition of explicit semantic information provided a measurable performance boost.
Key Performance Metrics:
- GLUE Benchmark: SemBERT outperformed the BERT baseline across all tasks. Notably, on the CoLA task (linguistic acceptability), SemBERT-base improved the score from 52.1 to 57.8.
- SNLI: The model achieved a new state-of-the-art test accuracy of 91.6% for a single model.
- SQuAD 2.0: SemBERT significantly boosted the F1 score over the BERT-large baseline, rising from 83.6 to 87.9 when utilizing data augmentation.
Discussion and Insights
SemBERT’s success highlights several key insights into the nature of language understanding in neural models:
- Explicit vs. Implicit Semantics: While BERT implicitly learns some syntax during pre-training, providing an explicit signal helps the model focus on the most meaningful structural parts of a sentence. NLU tasks naturally map to the goals of SRL; for instance, question answering is essentially the process of identifying "who did what."
- Robustness to Noise: Interestingly, the model remains effective even if the SRL labeler makes mistakes (up to a 40% error rate). This suggests that even noisy structural clues provide a better inductive bias than no structural clues at all.
- Small Data Advantage: SemBERT showed particularly strong gains on smaller datasets like RTE and CoLA. This implies that explicit semantics act as a helpful guide when there isn't enough data for the model to learn complex structures from scratch.
Conclusion
SemBERT demonstrates that explicitly modeling the relationship between predicates and their arguments significantly enhances the performance and robustness of pre-trained language models. Despite adding these semantic layers, the model remains relatively lightweight, with the extra SRL embedding volume accounting for less than 15% of the original encoder size. Future work may involve extending this framework to other languages and exploring unsupervised SRL methods to reduce dependency on labeled data.
Summary updated