Interpretable Neural Embeddings with Sparse Self-Representation

Mingxue Xia, Hao ZhuarXiv 2023 · DOI

Introduction

Standard word embeddings, such as GloVe and Word2Vec, have become foundational in Natural Language Processing. However, these embeddings are inherently dense, meaning each dimension is a mathematical abstraction that rarely corresponds to a distinct human concept. This "black-box" nature limits the transparency of downstream models. While sparse coding techniques like Lasso have been employed to address this, they often suffer from instability, difficulty in handling rare words, and the arbitrary selection of correlated terms.

This paper introduces Sparse Words Self-Representation (SWSR), a method designed to transform dense vectors into highly sparse, human-readable embeddings. By leveraging the "self-expressiveness property" of data, SWSR creates representations that are more stable and semantically coherent than previous sparse coding approaches.

Methodology

The core of the SWSR model is the Self-Expressiveness Property (SEP). The fundamental assumption is that any word within a specific semantic subspace can be expressed as a linear combination of other words in that same subspace ($X = XC$, where $C$ is the self-representation matrix). This approach effectively treats the dataset itself as the dictionary, avoiding the instability associated with learning external dictionaries from scratch.

Neural Architecture and Loss Functions

SWSR utilizes a shallow neural network with a Capped-ReLU activation function. This function enforces a "hard" sparse boundary by forcing values to be exactly 0, between 0 and 1, or exactly 1. To optimize the model, the authors employ a triple-threat loss function:

  1. Reconstruction Loss (RL): Ensures the sparse representation can accurately reconstruct the original dense vector.
  2. Average Sparsity Loss (ASL): Penalizes deviations from a target sparsity ratio ($\rho$).
  3. Partial Sparsity Loss (PSL): Pushes values toward binary extremes (0 or 1) to increase discriminative power.

Interpretability and Sparsity

A primary goal of SWSR is to achieve high interpretability without sacrificing the expressive power of the vectors. Interpretability is measured via the Word Intrusion Task and the DistRatio metric, which quantifies the semantic coherence of the top words in a given dimension relative to a random intruder.

Table showing that SWSR achieves the highest sparsity (up to 99%) and the best interpretability scores (DistRatio) compared to GloVe, Word2Vec, and other sparse models.

As shown in the experimental results, SWSR achieves extreme sparsity levels between 95% and 99%. Despite this reduction in active dimensions, the model significantly outperforms baselines in interpretability, reaching a DistRatio of 1.34 when applied to Word2Vec vectors.

Downstream Performance

A common trade-off in machine learning is that increasing model interpretability often degrades performance on practical tasks. SWSR challenges this notion by demonstrating that high sparsity can actually improve performance by filtering out "noise" dimensions.

Comparative performance of SWSR against Word2Vec and other sparse models across various downstream NLP tasks, showing SWSR's superior accuracy in categories like Question Classification.

On downstream benchmarks such as the 20 Newsgroups classification and Question Classification, SWSR consistently performs as well as or better than dense baselines. For instance, in Question Classification, SWSR achieved an accuracy of 93.49%, compared to 89.02% for the original dense Word2Vec vectors.

Conclusion

Sparse Words Self-Representation (SWSR) provides a robust framework for generating interpretable word embeddings. By utilizing the data itself as a basis for representation and employing a specialized loss function for sparsity, the model achieves state-of-the-art interpretability and competitive performance on downstream NLP tasks. This approach offers a path toward more transparent and repeatable neural language models.

Summary updated

BibTeX
@misc{xia2023interpretable,
  author = {Mingxue Xia and Hao Zhu},
  title = {{Interpretable Neural Embeddings with Sparse Self-Representation}},
  year = {2023},
  eprint = {2306.14135},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.14135},
}
Figure