Abstract
Word vector representations open up new opportunities to extract useful information from unstructured text. Word vector representations have been used in many applications such as word synonyms, word analogy, and syntactic parsing. GloVe, based on word contexts and matrix vectorization, is an effective vector-learning algorithm. However, the GloVe model fails to explicitly consider the order in which words appear within their contexts. In this paper, multiple methods of incorporating word order in GloVe word embeddings are proposed. Experimental results show that our Word Order Vector (WOVe) approach outperforms unmodified GloVe on analogy completion and word similarity. WOVe with direct concatenation slightly outperformed GloVe on the word similarity task, increasing average rank by 2%, and greatly improved on the word analogy task, achieving an average 36.34% improvement in accuracy.
Introduction
In Natural Language Processing (NLP), word embeddings like GloVe (Global Vectors) are fundamental tools that map words into a continuous vector space where semantic similarity is represented by spatial proximity. While GloVe is highly effective, it possesses a significant limitation: it is largely indifferent to word order. When constructing its co-occurrence matrix, GloVe records that words appear within a context window but does not distinguish their specific relative positions (e.g., whether a word appeared to the left or right of the target).
This "weighted bag-of-words" approach ignores critical syntactic information. In many languages, the position of a word relative to another often dictates its grammatical role. By overlooking these structural nuances, standard GloVe misses opportunities to capture deeper linguistic relationships. To address this, we propose WOVe (Word Order Vectors), an extension that explicitly encodes positional data.
Methodology
We explored three primary methods for incorporating word order into the embedding process:
- Direct Concatenation: This method involves creating separate co-occurrence matrices for every specific position within a context window. Separate vectors are trained for each position and then concatenated. For a window size $c$ and vector size $k$, the resulting WOVe vector has a dimensionality of $c \times k$.
- Reduced Concatenation: To maintain the original GloVe dimensionality ($k$), positional vectors are trained at a reduced size ($k/c$) before concatenation.
- Weighted Direct Concatenation: This variant applies GloVe’s standard distance-based weighting ($1/d$) to the positional vectors before merging them.
Experimental Setup
The models were trained on a 1.37 billion token subset of Wikipedia (2019 dump). Evaluation was conducted using the standard GloVe analogy dataset (19,544 questions) and five word similarity benchmarks: MC (Miller & Charles), RG (Rubenstein & Goodenough), WordSim-353, SCWS (Stanford’s Contextual Word Similarities), and RW (Rare Word Similarity Dataset).
Results and Analysis
Word Analogy Performance
The Direct Concatenation method emerged as the most effective variant. It achieved a substantial 36.34% average improvement in accuracy over the GloVe baseline across various window sizes.
Conversely, the Reduced Concatenation method performed poorly, with accuracy dropping by approximately 85%. This suggests that splitting co-occurrence data into positional bins creates data sparsity that cannot be adequately captured in smaller sub-vectors.
Word Similarity and Synonym Discovery
WOVe also demonstrated superior performance in identifying synonyms and determining word similarity. On average, the Direct Concatenation model improved the rank of true synonyms by 2% and discovered 34% more synonyms within the top 10 results compared to GloVe.
Notably, on the Rare Word (RW) dataset, WOVe showed a 46% improvement in synonym discovery, highlighting its ability to capture nuances even for less frequent terms.
Discussion and Conclusion
The success of Direct Concatenation underscores the importance of explicit positional encoding. By separating left-side and right-side contexts, WOVe captures syntactic roles more effectively than distance-weighted averages. While the increased dimensionality of WOVe vectors presents a computational trade-off, the significant gains in analogy and similarity tasks justify the approach for applications where precision is paramount.
Future research will focus on extending these "order-aware" principles to sentence-level embeddings and comparing WOVe's static representations against dynamic, transformer-based models.
Summary updated