Generalised Spherical Text Embedding

Souvik Banerjee, Bamdev Mishra, Pratik Jawanpuria, Manish Shrivastava

Abstract

This paper aims to provide an unsupervised modelling approach that allows for a more flexible representation of text embeddings. It jointly encodes the words and the paragraphs as individual matrices of arbitrary column dimension with unit Frobenius norm. The representation is also linguistically motivated with the introduction of a metric for the ambient space in which we train the embeddings that calculates the similarity between matrices of unequal number of columns. Thus, the proposed modelling and the novel similarity metric exploits the matrix structure of embeddings. We then go on to show that the same matrices can be reshaped into vectors of unit norm and transform our problem into an optimization problem in a spherical manifold for optimization simplicity. Given the total number of matrices we are dealing with, which is equal to the vocab size plus the total number of documents in the corpus, this makes the training of an otherwise expensive non-linear model extremely efficient. We also quantitatively verify the quality of our text embeddings by showing that they demonstrate improved results in document classification, document clustering and semantic textual similarity benchmark tests.

Introduction

Most unsupervised text embedding models, such as Word2vec, GloVe, or JoSE, represent words and paragraphs as single dense vectors in Euclidean or spherical space. While computationally efficient, this approach creates a "semantic bottleneck." A single vector often struggles to represent polysemy—where one word has multiple meanings (e.g., "bank" as a financial institution vs. a river bank). Similarly, a single vector for a long document often fails to capture the variety of topics discussed within it. Forcing these complex entities into a single point in space leads to "meaning mixing," where the most frequent sense of a word dominates and obscures others.

Methodology

The proposed framework represents words and documents as matrices $X \in \mathbb{R}^{p \times r}$ with a unit Frobenius norm. This approach offers several key advantages:

  • Matrix Representation: Instead of a vector of length $p$, the model uses a matrix with $r$ columns. Each column acts as a latent variable representing a specific context or topic.
  • Hierarchical Complexity: The model allows for hierarchical flexibility, where words can have fewer columns ($r_1$) than documents ($r_2$). This aligns with the linguistic intuition that documents are semantically broader than individual words.
  • Novel Similarity Metric: To compare matrices of different sizes, the authors introduce a metric $g(A, B)$ that calculates the average dot product between all pairs of columns from the two matrices.
  • Manifold Optimization: Training is made efficient by reshaping matrices with unit Frobenius norms into long vectors with unit Euclidean norms. This allows for the use of Riemannian gradient descent on a high-dimensional spherical manifold while maintaining the matrix-based logic for similarity and loss.

Evaluation and Results

The model was evaluated on standard NLP benchmarks, including the 20 Newsgroup dataset (clustering and classification), the Movie Review Dataset (sentiment classification), and the STS Benchmark (semantic similarity).

Document Clustering

On the 20 Newsgroup dataset, increasing the document matrix size ($r_2$) significantly improved clustering performance. The Normalized Mutual Information (NMI) score rose from a baseline of 0.58 (where $r=1$, equivalent to the JoSE model) to 0.62 when $r_2$ was increased to 6.

Clustering performance on 20 Newsgroup dataset as $r_2$ increases ($r_1=1$).

Classification and Similarity

For 20 Newsgroup classification, the F1-macro score improved from 0.74 to 0.78. Similarly, on the STS Benchmark, the Pearson correlation on the development set saw a significant jump from 0.51 to 0.54 as the matrix dimensions were optimized.

Classification results (F1-macro) for different matrix dimensions $r_1$ and $r_2$.

Discussion

The primary insight is that increasing the number of columns ($r$) consistently improves performance on document-level tasks, confirming that documents benefit from additional "room" to store diverse topics. This flexibility is more linguistically sound than traditional vector-based approaches. Furthermore, by framing matrix optimization as spherical vector optimization, the approach remains computationally practical for large datasets.

However, word-level similarity tasks did not see comparable gains, suggesting that individual words may not always require multiple latent variables. Future work could explore more complex matrix structures, such as Symmetric Positive Definite (SPD) matrices, to further enhance semantic capture.

Summary updated

BibTeX
@inproceedings{banerjee2022generalised,
  author = {Souvik Banerjee and Bamdev Mishra and Pratik Jawanpuria and Manish Shrivastava},
  title = {{Generalised Spherical Text Embedding}},
  booktitle = {ICON},
  year = {2022},
  url = {https://openreview.net/forum?id=Nnrykn2Tov},
}
Figure