Abstract
Traditional sentence embedding techniques, often referred to as Sen2Vec, represent sentences as static points in a high-dimensional vector space. However, these point estimates fail to capture the inherent uncertainty present in natural language. We present Sen2Pro (Sentence to Probability), a "plug-and-play" framework that models sentences as probability distributions rather than single vectors. By capturing both model and data uncertainty without requiring expensive retraining of massive Pre-trained Language Models (PLMs), Sen2Pro significantly enhances performance in text classification, semantic similarity, and linguistic analogy tasks, particularly in low-resource settings.
1. Introduction
In modern Natural Language Processing (NLP), the standard approach to representing text involves mapping a sentence to a single fixed-length vector. While this method has powered the success of models like BERT and RoBERTa, it treats language as a deterministic system. This "point estimate" approach ignores the nuances of linguistic ambiguity and the internal stochasticity of the models themselves.
Sen2Pro addresses this by shifting the paradigm from point-based embeddings to probabilistic distributions. By representing a sentence as a distribution (characterized by a mean and a covariance matrix), we can better capture the "neighborhood" of meanings a sentence might inhabit, leading to more robust and expressive representations.
2. The Problem of Uncertainty
The authors identify two primary types of uncertainty that standard point estimates fail to address:
- Model Uncertainty: Even with a fixed input, a model's internal state can vary. For instance, techniques like dropout introduce randomness during inference. A single forward pass only provides a snapshot of the model's potential representation.
- Data Uncertainty: Language is inherently "many-to-one." Different linguistic structures, such as paraphrases or slight syntactic variations, can convey the same underlying meaning. A single vector cannot easily represent the range of possible expressions for a single concept.
Previous attempts to create probabilistic embeddings often required training models from scratch on massive datasets. Given the computational cost of state-of-the-art PLMs, such retraining is often prohibitive. Sen2Pro offers a solution that works on top of existing, frozen models.
3. Methodology
The Sen2Pro framework operates in two distinct stages: Sampling and Estimation.
3.1 Sampling Stage
To capture the necessary variance, the framework generates multiple samples for each sentence:
- Capturing Model Uncertainty: The system employs Monte Carlo (MC) Dropout. By passing the same sentence through the PLM multiple times with dropout enabled, it collects a set of varying embeddings that reflect the model's internal uncertainty.
- Capturing Data Uncertainty: The system uses word-level augmentations—such as dropping, swapping, or replacing words—to create variations of the input sentence. These variations are then passed through the model to collect a diverse set of embeddings.
3.2 Estimation Stage
Once the samples are collected, Sen2Pro estimates the underlying distribution. Rather than simply averaging the samples into a single vector, it calculates a mean ($\mu$) and a covariance matrix ($\Sigma$).
In high-dimensional spaces (e.g., the 768 dimensions of BERT-base), a full covariance matrix is computationally expensive and statistically unstable. To solve this, the authors utilize a banding estimator. This approach focuses primarily on the diagonal entries of the matrix, which provides a more robust and efficient estimation of the distribution. For downstream tasks, the mean and variance are either concatenated for classification or compared using specialized distance metrics that account for both the difference in central tendency and the "spread" of the distributions.
4. Experimental Setup and Results
The researchers evaluated Sen2Pro across a diverse array of benchmarks, including text classification (AG News, IMDB), Semantic Textual Similarity (STS-12 through STS-B), dialogue evaluation, and machine translation evaluation.
4.1 Key Findings
- Few-Shot Dominance: Sen2Pro demonstrates its greatest strength when training data is scarce. In 10-shot classification tasks, it outperformed standard point-based embeddings by significant margins (e.g., a +4.9% improvement on AGNews). This suggests that the probabilistic distribution acts as a rich semantic prior that aids generalization.
- Semantic Similarity: The framework improved average scores across all STS datasets, providing a notable +3.01 point gain for BERT-base models.
- Linguistic Analogy: In tasks measuring the understanding of relations (e.g., negation), Sen2Pro reduced error metrics significantly, dropping the error from 21.3 to 14.7 in BERT-based tests.
- Efficiency of Banding: The results confirmed that the banding estimator is not only more computationally efficient than standard sample covariance but also yields higher accuracy by reducing noise in high-dimensional space.
5. Conclusion and Future Work
Sen2Pro demonstrates that uncertainty in sentence embeddings is a feature, not a bug. By treating sentences as distributions, we can extract richer semantic information from existing PLMs without the need for retraining. While the multiple forward passes required for sampling increase inference time, the gains in accuracy and robustness—especially in few-shot scenarios—make it a powerful tool for high-stakes NLP applications.
Future research will focus on optimizing the sampling process to reduce computational overhead and exploring "uncertainty-aware" pre-training, where models are designed from the outset to output probabilistic distributions.
Summary updated