An Empirical Study on Post-processing Methods for Word Embeddings

Shuai Tang, Mahta Mousavi, Virginia R. de SaarXiv 2019

Abstract

Word embeddings learnt from large corpora have been adopted in various applications in natural language processing and served as the general input representations to learning systems. Recently, a series of post-processing methods have been proposed to boost the performance of word embeddings on similarity comparison and analogy retrieval tasks, and some have been adapted to compose sentence representations. The general hypothesis behind these methods is that by enforcing the embedding space to be more isotropic, the similarity between words can be better expressed. We view these methods as an approach to shrink the covariance/gram matrix, which is estimated by learning word vectors, towards a scaled identity matrix. By optimising an objective in the semi-Riemannian manifold with Centralised Kernel Alignment (CKA), we are able to search for the optimal shrinkage parameter, and provide a post-processing method to smooth the spectrum of learnt word vectors which yields improved performance on downstream tasks.

Introduction

Standard word embeddings, such as Word2Vec or GloVe, are foundational to modern NLP. However, they frequently suffer from a "geometry problem": instead of occupying the embedding space uniformly (isotropy), they tend to be "clumpy" and biased toward word frequency. This frequency bias often dominates the top principal components of the embedding matrix, potentially obscuring semantic signals.

While existing solutions often involve manually removing the top few principal components, these methods are often heuristic and require manual tuning. This paper introduces a mathematically rigorous, automatic post-processing method that treats the problem as "shrinkage estimation" on a semi-Riemannian manifold.

Methodology: Smoothing via Shrinkage

The proposed method reframes post-processing as a shrinkage estimation problem. In statistics, shrinkage improves an estimate by moving it toward a target (e.g., an identity matrix) to reduce noise.

Geometric Framework

The authors treat Gram matrices (all-pairs similarity matrices) as points on a semi-Riemannian manifold, a geometry naturally suited for positive semi-definite matrices. To compare word vector spaces, they utilize Centralized Kernel Alignment (CKA). CKA is particularly effective here because it is invariant to rotations and isotropic scaling—essential properties when only relative angles between vectors carry semantic meaning.

Automatic Optimization

Rather than manually selecting components to remove, the method optimizes a "mixing parameter" ($\beta$). By deriving a lower bound for the log-CKA between the ideal word relationships and the shrunken estimate, the authors identify an "elbow point" where the second derivative of the objective function is minimized. This data-driven approach allows for fully automatic smoothing of the embedding spectrum.

Experimental Setup

The method was evaluated using embeddings trained on a 4.6-billion-token Wikipedia corpus across Skip-gram, CBOW, and GloVe architectures. Evaluation tasks included:

  • Word-Level: 8 similarity tasks (e.g., SimLex999), 3 analogy tasks, and 6 categorization tasks.
  • Translation: Supervised and unsupervised translation via the MUSE dataset.
  • Sentence-Level: Semantic Textual Similarity (STS) tasks from SemEval 2012–2016.

Key Results

Performance and Robustness

The proposed method consistently outperformed raw embeddings and established "top-component removal" baselines across 17 word-level tasks. A significant finding is the method's robustness to data scarcity. As shown in the comprehensive evaluation across architectures and dimensions, the smoothing approach maintains high performance even when trained on only a fraction of the original corpus.

Performance across varying data fractions and embedding dimensions.

Stability Across Dimensions

Unlike heuristic methods that can be sensitive to hyperparameters, the shrinkage approach provides stable improvements across a wide range of embedding dimensions (200 to 600).

Performance stability of CBOW embeddings across different dimensions.

Conclusion

By smoothing the spectrum of word embeddings rather than simply removing components, this geometric approach provides a principled way to enhance semantic representations. The use of CKA on a semi-Riemannian manifold allows for an automatic, data-driven post-processing step that is robust to training data size and embedding dimensionality, outperforming traditional manual tuning methods.

Summary updated

BibTeX
@misc{tang2019empirical,
  author = {Shuai Tang and Mahta Mousavi and Virginia R. de Sa},
  title = {{An Empirical Study on Post-processing Methods for Word Embeddings}},
  year = {2019},
  eprint = {1905.10971},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1905.10971},
}
Figure