NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Examining Structure of Word Embeddings with PCA

Tomás Musil

Abstract

This paper investigates the internal geometric structure of Czech word embeddings across various neural models, including Neural Machine Translation (NMT), word2vec, and sentiment analysis. While probing classifiers confirm that linguistic information like Part-of-Speech (POS) tags is present in all these spaces, we show that the training task fundamentally dictates how this information is organized. Using Principal Component Analysis (PCA), we find that NMT decoders prioritize grammatical structure in their primary dimensions, whereas word2vec distributes this information across higher dimensions. Our findings suggest that models represent information more directly when it is critical to their specific objective.

Introduction

In Natural Language Processing, word embeddings are dense vectors containing rich morphological, syntactic, and semantic information. While "probing" studies demonstrate that this information can be extracted, they often fail to reveal the internal "geography" of the vector space. This study examines Czech—a morphologically rich language—to determine if specific training objectives (e.g., translation vs. sentiment prediction) alter the geometric representation of POS tags and sentiment.

Methodology

We employ a two-step analytical approach:

  1. Probing Classifiers: A simple Multi-Layer Perceptron (MLP) is trained to predict POS tags from fixed embeddings to confirm information presence.
  2. PCA Correlation: We apply PCA to identify directions of maximum variance and calculate the correlation between these principal components and binary vectors representing categorical POS data. High correlation in early dimensions indicates that the model has prioritized that linguistic feature as a primary organizational factor.

Datasets

  • CzEng: A large Czech-English parallel corpus for NMT and word2vec (Skip-gram) training.
  • CSFD CZ: A dataset of Czech movie reviews for sentiment analysis.
  • MorfFlex: A high-quality morphological dictionary for ground-truth POS tags.

Key Results

Our analysis reveals that the specific task shapes the embedding space significantly. While all models achieved high POS probing accuracy (93.36% to 97.77%), their internal structures varied:

  • NMT Decoder Organization: The RNN NMT Decoder is highly organized by POS. Its first PCA dimension distinguishes adjectives from nouns, and the second isolates verbs, reflecting the strict grammatical requirements of sentence generation.
  • NMT Encoder vs. word2vec: In the NMT Encoder, the primary PCA dimensions strongly distinguish verbs from nouns. Conversely, word2vec embeddings appear more normally distributed initially, with categorical linguistic structure only becoming apparent in dimensions 3 through 5.
  • Sentiment Alignment: The sentiment model's embedding space ignores syntax, showing near-zero correlation with POS tags in primary dimensions. Instead, it organizes words into a "valence-intensity" triangle, where the first dimension represents valence (positive vs. negative) and the second represents intensity.
Correlation heatmaps between PCA dimensions and POS tags for NMT Encoder, Decoder, and word2vec models.

Discussion and Insights

The high degree of organization in the NMT decoder suggests that grammatical information is more critical for machine translation than for general-purpose word embeddings like word2vec. Furthermore, PCA reveals functional clustering; for instance, word2vec separates infinitive verbs from modal verbs, and NMT models isolate proper nouns into distinct sub-clusters. These findings demonstrate that models naturally group words based on their functional roles within the specific training task.

Limitations and Future Work

While PCA effectively reveals significant structure, its linear nature may miss complex, non-linear manifolds. Additionally, this study focuses on Czech; while findings likely generalize to other morphologically rich languages, the specific geometric "shapes" may differ for analytic languages like English. Future research should explore how other information types, such as semantic roles or syntactic dependencies, are represented across different tasks and languages.

Summary updated

BibTeX
@inproceedings{musil2019examining,
  author = {Tomás Musil},
  title = {{Examining Structure of Word Embeddings with PCA}},
  booktitle = {TSD},
  year = {2019},
  url = {https://openreview.net/forum?id=UsB8mleB3PM},
}
Figure