Table of Contents
Fetching ...

Disentangling Linguistic Features with Dimension-Wise Analysis of Vector Embeddings

Saniya Karwa, Navpreet Singh

TL;DR

The paper addresses the interpretability of high-dimensional neural embeddings by introducing LDSP-10 and the Embedding Dimension Importance ($EDI$) score to identify which embedding dimensions encode distinct linguistic properties. It develops a generalizable, dimension-wise analysis framework using Wilcoxon tests, mutual information, and recursive feature elimination to map dimensions to nine linguistic properties plus a control across models like BERT, GPT-2, and MPNet. Key contributions include the LDSP-10 dataset, a quantitative $EDI$ metric, and a cross-model analysis revealing strong dimension-specific encoding for negation and polarity, with more diffuse patterns for other properties such as synonymy. The findings offer concrete insights for interpretability and bias mitigation, suggesting that targeted, dimension-focused adjustments could improve transparency and controllability in language models, while also highlighting limitations in capturing all linguistic nuances. Overall, the framework provides a principled, model-agnostic approach to dissect embedding spaces and guide responsible AI deployment.

Abstract

Understanding the inner workings of neural embeddings, particularly in models such as BERT, remains a challenge because of their high-dimensional and opaque nature. This paper proposes a framework for uncovering the specific dimensions of vector embeddings that encode distinct linguistic properties (LPs). We introduce the Linguistically Distinct Sentence Pairs (LDSP-10) dataset, which isolates ten key linguistic features such as synonymy, negation, tense, and quantity. Using this dataset, we analyze BERT embeddings with various methods, including the Wilcoxon signed-rank test, mutual information, and recursive feature elimination, to identify the most influential dimensions for each LP. We introduce a new metric, the Embedding Dimension Impact (EDI) score, which quantifies the relevance of each embedding dimension to a LP. Our findings show that certain properties, such as negation and polarity, are robustly encoded in specific dimensions, while others, like synonymy, exhibit more complex patterns. This study provides insights into the interpretability of embeddings, which can guide the development of more transparent and optimized language models, with implications for model bias mitigation and the responsible deployment of AI systems.

Disentangling Linguistic Features with Dimension-Wise Analysis of Vector Embeddings

TL;DR

The paper addresses the interpretability of high-dimensional neural embeddings by introducing LDSP-10 and the Embedding Dimension Importance () score to identify which embedding dimensions encode distinct linguistic properties. It develops a generalizable, dimension-wise analysis framework using Wilcoxon tests, mutual information, and recursive feature elimination to map dimensions to nine linguistic properties plus a control across models like BERT, GPT-2, and MPNet. Key contributions include the LDSP-10 dataset, a quantitative metric, and a cross-model analysis revealing strong dimension-specific encoding for negation and polarity, with more diffuse patterns for other properties such as synonymy. The findings offer concrete insights for interpretability and bias mitigation, suggesting that targeted, dimension-focused adjustments could improve transparency and controllability in language models, while also highlighting limitations in capturing all linguistic nuances. Overall, the framework provides a principled, model-agnostic approach to dissect embedding spaces and guide responsible AI deployment.

Abstract

Understanding the inner workings of neural embeddings, particularly in models such as BERT, remains a challenge because of their high-dimensional and opaque nature. This paper proposes a framework for uncovering the specific dimensions of vector embeddings that encode distinct linguistic properties (LPs). We introduce the Linguistically Distinct Sentence Pairs (LDSP-10) dataset, which isolates ten key linguistic features such as synonymy, negation, tense, and quantity. Using this dataset, we analyze BERT embeddings with various methods, including the Wilcoxon signed-rank test, mutual information, and recursive feature elimination, to identify the most influential dimensions for each LP. We introduce a new metric, the Embedding Dimension Impact (EDI) score, which quantifies the relevance of each embedding dimension to a LP. Our findings show that certain properties, such as negation and polarity, are robustly encoded in specific dimensions, while others, like synonymy, exhibit more complex patterns. This study provides insights into the interpretability of embeddings, which can guide the development of more transparent and optimized language models, with implications for model bias mitigation and the responsible deployment of AI systems.

Paper Structure

This paper contains 59 sections, 5 equations, 95 figures, 12 tables, 3 algorithms.

Figures (95)

  • Figure 1: Dimensions of BERT embeddings that encode the most information about each LP. Relevance is determined by Embedding Dimension Importance (EDI) scores above 0.8, a threshold chosen in relation to the general EDI score distribution.
  • Figure 2: Distribution of BERT embedding dimension 0 of control LDSPs for $\color{blue} S_1$ and $\color{orange} S_2$. For control, all dimensions had equivalent Wilcoxon $p$-values, so dimension 0 represents the most and least significant $p$-value.
  • Figure 3: Distribution of BERT embedding dimensions 544 (top) and 489 (bottom), lowest and highest $p$-values respectively, of negation LDSPs for $\color{blue} S_1$ and $\color{orange} S_2$. There is a discernible shift to the right in dimension 544, for sentences that are negated.
  • Figure 4: Distribution of BERT embedding dimensions 445 (top) and 489 (bottom), lowest and highest $p$-values respectively, of intensifier LDSPs for $\color{blue} S_1$ and $\color{orange} S_2$. Intensified sentences have values in dimension 445 that tend to be lower, as seen by the distributional shift to the left.
  • Figure 5: Combined analysis graph for control: shows the top 25 important dimensions selected by each of the three methods in § \ref{['sec:method']}. Bar height represents mutual information (MI); bars above the dashed line are in the top 25 MI scores. Blue bars signify the lowest Wilcoxon test $p$-values. Green triangles indicate a dimension that was selected by recursive feature elimination (RFE) with num_features set to 25. In the case for control, all dimensions had equivalent Wilcoxon $p$-values, so the first 25 are selected.
  • ...and 90 more figures