Abstract
Pretrained Language Models (PLMs) have revolutionized natural language processing, yet they often lack a deep understanding of synonymous expressions. This deficiency leads to model brittleness under synonym-substitution attacks and performance degradation in tasks requiring semantic equivalence. We present Sem4SAP, a framework designed to mine massive sets of synonyms from Open Knowledge Graphs (Open-KGs) and inject this knowledge into PLMs through synonym-aware pretraining. By utilizing Shannon entropy for property selection and novel boosting tasks, Sem4SAP significantly improves model robustness and performance across major benchmarks like GLUE and CLUE.
Introduction
While models such as BERT and RoBERTa excel at predicting masked tokens based on context, they frequently fail to recognize that different words or phrases can be interchangeable. This "shallow" understanding results in two primary vulnerabilities: brittleness and semantic blindness. A model might fail a classification task if a single word is replaced by a synonym (e.g., "U.S." to "United States"), or it may fail to link entities that represent the same concept but use different phrasing (e.g., "gender: male" vs. "man gender").
Existing linguistic resources like WordNet are often too constrained or formal to address the diversity of modern language. Sem4SAP addresses this by tapping into crowd-sourced Open Knowledge Graphs (Open-KGs) like DBpedia, which capture evolving internet language and diverse synonymous expressions.
Methodology
The Sem4SAP framework operates in three distinct stages: mining, expansion, and pretraining.
1. Synonymous Value Mining
The first stage involves extracting "synsets" (groups of synonyms) from Open-KGs. To identify high-quality candidates, the authors employ Shannon entropy to distinguish between "categorical properties" (e.g., nationality) and unique relations (e.g., specific addresses). Properties with low entropy are more likely to contain synonymous values. Once properties are selected, expressions are grouped using a hybrid similarity metric that integrates textual features (TF-IDF weighted by character frequency) and semantic features derived from LM embeddings.
2. Synset Expansion
To increase the diversity of the mined data, the framework identifies the "core semantic" components of an expression. Using Point-wise Mutual Information (PMI) and neighborhood richness of word pieces, the system distinguishes essential terms (e.g., "male") from auxiliary components (e.g., "gender"). By swapping these components, the system generates new synonymous variations, broadening the training signal.
3. Synonym-Aware Pretraining (SAP)
The core of the framework is the injection of this mined knowledge into PLMs via two novel tasks:
- Token-level Synonym Boosting: This task pulls the vector representations of synonymous expressions closer together within the model's latent space.
- Sentence-level Synonym Boosting: This ensures that two sentences differing only by a synonym substitution result in nearly identical output representations.
To prevent the model from losing its original general-purpose knowledge—a phenomenon known as semantic drift—the authors implement an "Anti-Drift" constraint. This mechanism halts the boosting process once synonyms reach a predefined proximity in the latent space.
Experimental Setup and Results
Datasets
The framework was evaluated using English DBpedia and Chinese CN-DBpedia for mining. Performance was measured across ten major benchmarks:
- GLUE (English): SST-2, MRPC, QQP, MNLI-mm, RTE.
- CLUE (Chinese): AFQMC, TNEWS, IFLYTEK, CMNLI, CSL.
Performance and Robustness
Sem4SAP consistently outperformed vanilla BERT and RoBERTa, as well as specialized synonym-injection baselines like LIBERT and PICSO. A key highlight of the results was the model's stability under attack. The researchers tested robustness using "back-translated" datasets (translating text to another language and back to simulate synonym substitution). While standard models experienced significant performance drops, Sem4SAP maintained high accuracy, demonstrating a much more resilient understanding of semantics.
Furthermore, the benefits of Sem4SAP scaled effectively. When applied to larger architectures like RoBERTa-large, the framework still provided a noticeable performance boost, suggesting that even massive models benefit from explicit synonym-aware training.
Discussion and Conclusion
Sem4SAP demonstrates that crowdsourced knowledge is a superior teacher for understanding the nuances of human language compared to static dictionaries. By using unsupervised methods like Shannon entropy to filter properties, the framework efficiently identifies high-quality synonyms without the need for manual labeling. The primary innovation lies in representational alignment—forcing the model's internal geometry to treat synonyms as semantically equivalent points.
Limitations
Despite its success, the framework's effectiveness is tied to the quality of the underlying Open-KG. Additionally, while the "Anti-Drift" trick helps, balancing synonymy with context-dependent ambiguity remains a complex challenge. Future work may involve manual refinement of mined synsets to create even higher-quality public resources for the NLP community.
In summary, Sem4SAP provides a robust pathway for teaching language models the art of the paraphrase, making them more resilient to adversarial attacks and more capable in real-world semantic tasks.
Summary updated