TL;DR
This paper introduces a simple, closed-form method for aligning word embeddings from different sources or mechanisms. By optimally rotating, translating, and scaling embeddings, they can be brought into a common space, preserving and even enhancing linguistic properties like synonyms and analogies, and enabling more effective ensemble methods.
What Problem Does This Paper Address?
Word embeddings, like those from GloVe or word2vec, are powerful tools for representing words in a high-dimensional space, capturing semantic relationships like synonyms and analogies. However, embeddings derived from different datasets or generated by different algorithms often exist in separate, non-comparable spaces. This makes it difficult to directly compare them, combine them into ensembles, or transfer knowledge between them. Existing methods for alignment are often complex or don't fully optimize the transformation. This paper addresses the need for a simple, optimal, and generalizable method to align these disparate embedding spaces.
Methods
The core of the paper is a family of closed-form techniques for aligning point sets, inspired by the "absolute orientation" problem in computer vision. These methods aim to find an optimal transformation (rotation, translation, and scaling) to align one set of word vectors (from a source embedding) to another (a target embedding).
- Absolute Orientation (AO): The primary method uses Singular Value Decomposition (SVD) to find an optimal rotation that minimizes the Root Mean Squared Error (RMSE) between corresponding word vectors. This is a generalization of 3D shape alignment techniques.
- Extensions: The authors extend this to include optimal translation and scaling. They prove new results for optimal scaling and demonstrate that these transformations can be applied sequentially or in combination.
- Cosine Similarity Maximization: They also show that the same AO-ROTATION method, when applied to normalized vectors, maximizes the average cosine similarity, which is a common metric for evaluating word embeddings.
- Ensemble Methods: The alignment technique is crucial for creating effective ensembles of embeddings. By aligning embeddings from different sources, they can be averaged to produce a single, more robust embedding.
- Contextual Embeddings: A simple extension is proposed to handle contextual embeddings (like BERT or ELMO) by aligning the average representations of word instances within different contexts.
Datasets
The paper uses several large-scale datasets for training and evaluation:
- Wikipedia: A 4.57 billion token English Wikipedia dump is used as a primary source for generating embeddings.
- Common Crawl: Embeddings derived from various sizes of Common Crawl data (42 billion and 840 billion tokens) are used.
- Google News: Embeddings from the Google News dataset (100 billion tokens) are utilized.
- Spanish and French Corpora: Used for cross-lingual alignment experiments.
The paper also discusses using subsets of these datasets (e.g., top 100K or 10K words) for experiments and calibration.
Key Insights and Ideas
- Alignment is Crucial for Comparison: Directly comparing embeddings from different sources without alignment yields very poor results on similarity and analogy tasks. Alignment unlocks their comparative potential.
- Rotation is Key, Scaling is Important for Different Mechanisms: Optimal rotation is essential for alignment. Scaling becomes particularly important when aligning embeddings generated by different mechanisms (e.g., GloVe vs. word2vec) to bring them to a comparable scale. Translation offers minor but consistent improvements.
- Weighting by Norm Improves Robustness: Instead of normalizing all vectors, weighting words by their norms during alignment emphasizes more stable, higher-frequency words, leading to better results.
- Dataset Matters More Than Mechanism: Changing the underlying dataset has a more significant impact on alignment error (RMSE) than changing the embedding mechanism, suggesting that the data distribution is a primary driver of embedding differences.
- Ensembles Boost Performance: Aligning and averaging embeddings from different sources significantly boosts performance on similarity and analogy tests, often surpassing individual embeddings, even those trained on much larger datasets.
- Cross-Lingual Alignment is Effective: The alignment techniques enable effective translation between languages, even when embeddings are derived from different mechanisms, by aligning them to a common space.
Key Results
- Significant Improvement on Similarity and Analogy Tests: After alignment, performance on synonym and analogy tests dramatically improves, often reaching scores comparable to or better than the original embeddings. For instance, on SIMLEX, they improve scores by almost 10% in Spearman correlation.
- Effective Ensemble Performance: Combined embeddings (e.g., GloVe + word2vec) consistently outperform individual embeddings on various benchmark tests, with the best scores often coming from these combined models.
- Cross-Lingual Translation Accuracy: Alignment significantly improves translation accuracy between languages. For example, aligning Spanish and French embeddings to English, or directly to each other, leads to substantial gains in finding correct translations among nearest neighbors.
- Robustness to Noise: The alignment method is shown to be relatively robust to unstructured noise added to the input data.
- Scalability: The SVD-based approach is scalable to high dimensions (d=300) and large datasets, requiring only a dxd matrix decomposition, unlike some baseline methods that require n x n matrices.
Limitations and Future Work
- Computational Cost: While the core alignment is closed-form, working with extremely large datasets or a vast number of contextualized embeddings can still be computationally expensive.
- Contextual Embeddings: The proposed extension for contextual embeddings involves averaging, which might not capture all nuances of polysemy.
- Future Work: The authors suggest exploring applications in aligning heterogeneous embeddings (graphs, images), handling more complex multi-way alignments, and further investigating the impact of weighting and scaling for different types of data. They also propose using these techniques for analyzing customer data over time and across subsidiaries.
Summary updated