Abstract
This paper introduces an unsupervised method to estimate the class separability of text datasets from a topological point of view. Using persistent homology, we demonstrate how tracking the evolution of embedding manifolds during training can inform about class separability. More specifically, we show how this technique can be applied to detect when the training process stops improving the separability of the embeddings. Our results, validated across binary and multi-class text classification tasks, show that the proposed method’s estimates of class separability align with those obtained from supervised methods. This approach offers a novel perspective on monitoring and improving the fine-tuning of sentence transformers for classification tasks, particularly in scenarios where labeled data is scarce.
Introduction
In modern natural language processing, the quality of text embeddings is often defined by their "separability"—the degree to which examples from distinct classes form well-defined, isolated clusters in vector space. While supervised metrics like Accuracy or ROC-AUC are standard for measuring this, they require labeled validation sets which are often unavailable or expensive to produce. Existing unsupervised metrics, such as the Calinski-Harabasz (CH) Index, frequently fail to signal when a model has reached its performance plateau, often continuing to increase even as classification performance saturates. This research proposes a novel unsupervised metric based on Persistent Homology (PH) to bridge this gap.
Methodology: Topological Data Analysis
The core of the proposed method lies in Topological Data Analysis (TDA), specifically focusing on the 0-dimensional homology group ($H_0$). This technique tracks the "connected components" of a dataset as a proximity parameter (radius) increases.
As the radius grows, data points merge into components. The "birth" and "death" of these components are recorded, and the difference is defined as the persistence time. The authors hypothesize that as a model learns, the embedding space simplifies topologically: data organizes into a few highly persistent components representing the true classes, while noisy components merge and "die" quickly.
A key innovation is the Persistence Score ($S$), a summary statistic derived from the distribution of these persistence times. To enhance the clarity of this topological structure, the authors utilize unit sphere normalization for embeddings, forcing the model to rely on angular distance for class separation.
Key Results and Insights
The proposed Persistence Score was validated across various benchmarks, including amazon_counterfactual, sst2, emotion, and financial_phrasebank, using models like all-MiniLM-L6-v2 and TinyBERT.
Alignment with Supervised Metrics
A critical finding is that the Persistence Score tracks remarkably well with supervised metrics. Unlike the CH Index, which often provides a misleading signal by continuing to rise as clusters become denser, the Persistence Score saturates alongside Accuracy and ROC-AUC. This makes it an ideal candidate for an unsupervised early stopping criterion.
As shown in the experimental results, the Persistence Score (green) mirrors the trajectory of Accuracy (purple) and ROC-AUC (red). In contrast, the Calinski-Harabasz index (orange) continues to climb steeply even after the classification performance has plateaued, failing to capture the diminishing returns of further fine-tuning.
Conclusion and Future Work
Persistent homology offers a robust, unsupervised framework for monitoring the evolution of embedding manifolds. By capturing the global topological simplification of data during training, the Persistence Score provides a reliable proxy for class separability in low-label environments.
Future research will address the computational complexity of the Vietoris-Rips algorithm, which currently limits scalability. Additionally, exploring higher-dimensional topological features (like $H_1$ loops or $H_2$ voids) may yield deeper insights into more complex data structures beyond simple classification tasks.
Summary updated