[Paper Review] SemGloVe: Semantic Co-occurrences for GloVe from BERT
This paper proposes SemGloVe, a method that enhances GloVe word embeddings by distilling semantic co-occurrences from BERT, using either self-attention weights or masked language model logits to generate more semantically relevant co-occurrence counts. Experiments show SemGloVe outperforms GloVe on word similarity and downstream NLP tasks, achieving better clustering and accuracy by capturing broader, more meaningful word pairs beyond local windows.
GloVe learns word embeddings by leveraging statistical information from word co-occurrence matrices. However, word pairs in the matrices are extracted from a predefined local context window, which might lead to limited word pairs and potentially semantic irrelevant word pairs. In this paper, we propose SemGloVe, which distills semantic co-occurrences from BERT into static GloVe word embeddings. Particularly, we propose two models to extract co-occurrence statistics based on either the masked language model or the multi-head attention weights of BERT. Our methods can extract word pairs without limiting by the local window assumption and can define the co-occurrence weights by directly considering the semantic distance between word pairs. Experiments on several word similarity datasets and four external tasks show that SemGloVe can outperform GloVe.
Motivation & Objective
- To address the limitations of GloVe’s local window-based co-occurrence counting, which restricts word pair discovery and uses heuristic distance functions.
- To improve the quality of global word co-occurrence matrices by replacing statistical counts with semantic relevance derived from BERT.
- To generate static, non-contextual word embeddings that retain rich semantic information from contextualized BERT representations.
- To evaluate whether BERT-derived semantic co-occurrences lead to better performance on intrinsic (e.g., word similarity) and extrinsic (e.g., POS tagging, NER) NLP tasks.
Proposed method
- SemGloVe uses BERT’s multi-head self-attention weights as a semantic similarity measure to define co-occurrence scores between word pairs, replacing GloVe’s position-based distance function.
- The first model, SemGloVe sd, extracts top-k context words based on attention weights and uses these to build a co-occurrence matrix with attention scores as weights.
- The second model, SemGloVe md, masks the target word in BERT and uses the output logits of the masked token prediction as co-occurrence weights, enabling global context capture beyond local windows.
- A division-based distance function is introduced to normalize and scale the attention or MLM logits into effective co-occurrence weights.
- The resulting co-occurrence matrix is then factorized using GloVe’s objective function to learn static word embeddings.
- The method allows for subword-level co-occurrence counting, enriching semantic representation through subword pairings (e.g., 'egyptologist' with 'egypt' and 'archaeologist').
Experimental results
Research questions
- RQ1Can BERT’s contextual representations be effectively distilled into a global co-occurrence matrix to improve static word embeddings?
- RQ2Does replacing GloVe’s position-based distance function with BERT’s attention or MLM logits lead to more semantically meaningful co-occurrence counts?
- RQ3Can SemGloVe discover relevant word pairs that GloVe misses due to local window constraints?
- RQ4Does SemGloVe achieve better performance on intrinsic word similarity and extrinsic NLP tasks compared to GloVe?
- RQ5How do different components of SemGloVe (e.g., attention vs. MLM, window size) affect the final embedding quality?
Key findings
- SemGloVe outperforms GloVe on word similarity datasets, with SemGloVe md achieving the best results, indicating that BERT-derived co-occurrences improve semantic representation.
- The model successfully captures semantic word pairs that GloVe misses, such as 'king-crown' and 'himself-one', which are not in the local window but are semantically relevant.
- SemGloVe md generates significantly higher co-occurrence counts for semantically related pairs—e.g., 'egyptologist-egyptian' at 8.58×10³ compared to GloVe’s 11.32—demonstrating richer semantic signal.
- t-SNE visualization shows SemGloVe md produces tighter, more separable clusters across word classes (e.g., city, time, politics), unlike GloVe’s scattered outliers.
- Ablation studies show that reducing the window size in SemGloVe md degrades performance, while SemGloVe sd with larger context (10 words) still outperforms GloVe, indicating robustness to window size.
- SemGloVe sdR, which replaces SemGloVe sd’s counts with GloVe’s, performs nearly identically to GloVe, confirming that the improvement comes from the semantic co-occurrence mechanism, not window size.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.