Abstract
We generalize principal component analysis (PCA) for embedding words into a vector space. This generalization occurs at two levels: first, by defining the corpus as a counting process with flexible vocabulary, feature sets, and contexts; and second, by introducing a two-stage transformation process. This process includes a quadratic transformation for weighting and an adaptive non-linear transformation to reshape data distributions for PCA. We also introduce a memory-efficient randomized SVD algorithm to handle sparse matrices. Our evaluation shows that Principal Word Vectors (PWE) exhibit higher spread and discriminability than existing methods, performing on par with or better than popular embeddings like word2vec and GloVe in word similarity and dependency parsing tasks.
Introduction
Modern word embedding techniques, such as word2vec and GloVe, often rely on neural architectures or specific matrix factorization tricks that can function as "black boxes." While Principal Component Analysis (PCA) is a well-understood statistical method for dimensionality reduction, its application to word-context matrices is historically difficult due to the challenge of sparsity vs. density.
Standard PCA requires "centering" the data by subtracting the mean, which transforms a massive sparse matrix into a dense one, often exceeding memory limits. Furthermore, standard PCA does not inherently account for the unique statistical distributions of language, such as Zipf’s Law, which typically necessitates rigid, hand-tuned transformations. This paper introduces Principal Word Vectors (PWE) to address these limitations through a generalized PCA framework.
Methodology
Generalized PCA (GPCA)
The PWE framework introduces two levels of transformation to make PCA more effective for linguistic data:
- Quadratic Transformation: This stage utilizes metric and weight matrices to account for the varying importance of vocabulary units and contextual features, such as weighting rare words more heavily.
- Adaptive Non-linear Transformation: This stage reshapes the data distribution to maximize entropy, making it more suitable for PCA. By applying a monotonically increasing concave function, the model "compresses" over-represented top dimensions and "expands" the information-rich tail.
Centred-SVD Algorithm
To overcome the memory constraints of centering sparse matrices, the authors developed a randomized Singular Value Decomposition (SVD) algorithm. This method estimates the principal components of a mean-centered matrix without ever explicitly constructing the dense centered matrix. This allows the model to leverage data sparsity while maintaining the mathematical rigor of centered PCA.
Experimental Setup
The researchers trained PWE on the English corpus from the CoNLL-2017 shared task, which contains approximately 11.3 billion tokens. Evaluation was conducted across two main categories:
- Extrinsic Evaluation: A suite of 13 word similarity benchmarks and dependency parsing tasks using the Wall Street Journal (WSJ) portion of the Penn Treebank.
- Intrinsic Evaluation: Metrics for "spread" (generalized variance) and "discriminability" (Fisher Discriminant Ratio) were used to assess how well the vectors captured syntactic and semantic distinctions.
Key Results and Insights
Performance and Efficiency
PWE achieved results on par with word2vec and GloVe across word similarity and dependency parsing tasks. Notably, PWE slightly outperformed GloVe in parsing accuracy (UAS/LAS) in specific configurations. In terms of efficiency, the dimensionality reduction step for PWE took approximately 900 seconds, significantly faster than GloVe (8040s) and word2vec (which can exceed 10 hours).
The Role of Non-linearity and Context
The study found that language data is "highly stretched" along a few top eigenvectors. Applying the adaptive non-linear transformation significantly improved the discriminability of the vectors, aiding the model in distinguishing between different parts of speech or entity types. Furthermore, formalizing "context" as a function allowed PWE to integrate various information types—such as window-based neighbors or dependency-based parent words—into a single mathematical framework.
Conclusion
Principal Word Vectors demonstrate that classic statistical methods, when implemented with attention to data sparsity and non-linear distributions, can be as effective and efficient as modern deep learning approaches. While the current model assumes feature independence for entropy estimation, future work may involve more complex joint features and cross-lingual contexts to further refine the embedding quality.
Summary updated