Abstract
Out-of-vocabulary (OOV) words—rare terms, jargon, or neologisms—frequently degrade the performance of pre-trained natural language processing models. While context-based methods fail in isolated settings and sub-word-based methods often overlook complex relational structures, this paper proposes Graph-based Relation Mining (GRM). GRM constructs a Word Relationship Graph (WRG) to connect OOV words to known vocabulary through shared morphemes. By employing Graph Attention Networks (GAT) and contrastive learning, the model effectively "mines" semantic attributes from known words. GRM demonstrates substantial improvements in word similarity, analogy, and downstream tasks like NER and POS tagging, outperforming state-of-the-art sub-word-based approaches.
Introduction
The efficacy of pre-trained models like BERT or Word2Vec is inherently limited by their fixed vocabularies. Encountering OOV words typically leads to performance drops. Existing solutions generally follow two paths: context-based approaches, which require surrounding text, and sub-word-based approaches, which decompose words into constituent pieces. However, context is not always available (e.g., in short queries), and simple sub-word summation fails to capture the intricate relationships between morphemes and the broader vocabulary. GRM addresses these limitations by modeling the internal relational structure of word formation.
Methodology
The core of the GRM framework is the Word Relationship Graph (WRG) and a specialized neural architecture designed to process it.
Word Relationship Graph Construction
For each OOV word, a two-layer undirected graph is built:
- Layer 1: Links the OOV word to its constituent "wordpieces" or morphemes.
- Layer 2: Connects these wordpieces to "relevant words"—known vocabulary terms that share the same sub-units.
This structure creates a semantic bridge, allowing the model to derive meaning from established words with similar morphological roots.
Model Architecture
The GRM model processes the WRG through several stages:
- Initialization: A character-level self-attention mechanism generates an initial embedding for the OOV word based on its spelling.
- Message Passing: A multi-layer Graph Attention Network (GAT) aggregates information from neighbors. Position embeddings are added to edges to preserve the sequence of sub-words.
- Readout Block: A Graph Convolutional Network (GCN) produces the final embedding. To ensure robustness, the OOV word's own embedding is masked during this stage, forcing the model to rely on relational data.
- Contrastive Learning: The model is trained using a contrastive loss (NT-Xent), aligning OOV embeddings with synonyms and relevant words while distancing them from unrelated terms.
Experimental Results
GRM was evaluated on a diverse set of benchmarks, including intrinsic word similarity/analogy tasks and extrinsic downstream applications.
Intrinsic Evaluation
On word similarity tasks (e.g., RareWord, SimLex-999), GRM achieved an average Spearman’s correlation of 43.53, significantly higher than the previous state-of-the-art, LOVE (40.09). In the Google Analogy task, GRM reached 54.73% accuracy, nearly a 15% improvement over previous methods.
Extrinsic Evaluation
When integrated with Word2Vec for Named Entity Recognition (NER), GRM provided a massive boost. For instance, on the CoNLL dataset, F1-scores rose from 61.19 to 86.10. Similar gains were observed in Part-of-Speech (POS) tagging across various datasets.
Key Insights
- The Morpheme Bridge: By connecting "dehydrate" to "hydrous" via "hydr", the model "borrows" well-trained semantic attributes from known words.
- Relational Mining: Moving beyond simple summation allows the model to capture associations humans naturally use to decipher new words.
- Robustness through Masking: Masking the OOV word during readout prevents the model from over-relying on the initial character-level guess, ensuring it learns from the graph structure.
Conclusion and Future Work
GRM offers a powerful solution for context-free OOV word embedding. While its impact on BERT is more modest due to BERT's native sub-word tokenization, its performance on static embeddings and downstream tasks is transformative. Future research will focus on extending GRM to languages with non-concatenative morphology and developing hybrid models that combine graph-based relational mining with contextual information.
Summary updated