Introduction
In Natural Language Processing (NLP), sentence embeddings are essential for representing text as numerical vectors. However, standard dense embeddings often function as "black boxes," where individual dimensions lack human-understandable meanings. This paper investigates the hypothesis that interpretability in sentence embeddings is fundamentally linked to sparsity. By ensuring that only a small subset of dimensions is active for any given sentence, the authors aim to learn representations where each dimension corresponds to a distinct semantic concept.
Methodology
The researchers utilized a Sequence-to-Sequence (seq2seq) GRU autoencoder as their base architecture and explored three primary methods for inducing sparsity:
- Post-Processing (k-SVD): A standard dense model is first trained, followed by the application of the k-SVD dictionary learning algorithm to map dense vectors into a sparse space.
- k-Sparse Layer: An end-to-end approach incorporating a custom layer that retains only the $k$ largest activations during training, setting all others to zero.
- Sparsemax: A differentiable alternative to the Softmax function that can produce exact zeros, enabling the model to learn per-sample sparsity levels dynamically.
Automated Interpretability Metric
To quantify interpretability without extensive human evaluation, the authors adapted "topic coherence" from topic modeling. They rank sentences based on their activation in a specific dimension and measure the semantic similarity of the top-ranked sentences. High similarity suggests that the dimension captures a coherent concept. Word Mover’s Distance (WMD) served as the primary similarity measure for this metric.
Key Results and Discussion
Quantitative Evaluation
The models were evaluated on the MS COCO Captions and Cornell Movie-Dialogs datasets. Results indicate that end-to-end sparsity (k-Sparse) generally outperforms post-processing methods in terms of interpretability.
As shown in the table above, the k-Sparse model achieved notable improvements in coherence scores. For instance, on the MS COCO dataset, the WMD-based coherence score for a dense model was -3.00, while the k-Sparse model ($k=15$) improved this to -2.86, indicating significantly more coherent and thus interpretable dimensions.
Qualitative Interpretability
Qualitatively, sparse models successfully isolated specific semantic concepts. For instance, dimensions were found to activate for concepts like "objects in water" or "people riding vehicles."
As illustrated in the figure above, a single dimension can capture a very specific semantic concept—in this case, the action of "laying"—across diverse contexts involving people, animals, and objects. This level of disentanglement is rarely achieved in standard dense embeddings.
The Price of Interpretability
A clear trade-off exists between interpretability and reconstruction accuracy. As sparsity increases (lower $k$), reconstruction error typically rises because the model is forced to discard fine-grained details to fit the sentence into a limited number of semantic "slots." Interestingly, while sparse models showed slightly lower performance on some downstream tasks, they improved results in sentiment analysis (SST2 and SST5), suggesting that interpretable features can serve as effective automated feature engineering for specific classification tasks.
Conclusion and Future Work
This research demonstrates that sparsity is a viable path toward interpretable sentence embeddings. The introduced automated metric provides a scalable way to evaluate these models. Future work includes applying these constraints to more advanced architectures like Transformers and addressing the "stop word" problem, where dimensions might capture frequent but semantically uninteresting words.
Summary updated