Introduction
Generic sentence embeddings—the mathematical representations used to compare texts—often suffer from being too broad. While standard Semantic Textual Similarity (STS) models can determine if two texts are generally related, they often fail to distinguish between specific dimensions of similarity. For example, a biography of Albert Einstein and a biography of Angela Merkel might be flagged as similar because both subjects are famous Germans, even if a user is specifically looking for similarity in their professions or historical eras.
Similarity is inherently subjective and context-dependent. To address this, the researchers behind AspectCSE propose a shift from generic similarity to Aspect-based Semantic Textual Similarity (A-STS). By leveraging structured knowledge from Wikidata, AspectCSE creates targeted embeddings that allow users to ask: "Are these texts similar regarding Aspect X?"
The AspectCSE Framework
AspectCSE is built on a supervised contrastive learning framework, extending the principles of SimCSE. The core mechanism involves training the model using triplets: an anchor text, a positive sample (text sharing the same aspect label), and negative samples (texts with different labels or random samples from the same batch). The objective is to minimize the distance between the anchor and the positive sample in the vector space while maximizing the distance from negatives.
Multi-Aspect Training Strategies
The paper's most significant contribution is the introduction of multi-aspect training. Rather than training a model for a single isolated aspect (e.g., just "Industry"), the authors utilize Wikidata properties to create complex training samples:
- Intersection: A positive sample is defined as matching the anchor on multiple criteria (e.g., both Aspect A and Aspect B).
- Union: A positive sample matches the anchor on at least one criteria (e.g., either Aspect A or Aspect B).
By fine-tuning BERT-based models (such as SciBERT for scientific domains) using these strategies, the model learns to navigate the nuances of overlapping and distinct semantic categories.
Experimental Setup and Datasets
The researchers evaluated AspectCSE across two distinct domains to test its versatility:
- Papers with Code (PwC): This dataset consists of research abstracts annotated with three specific aspects: Task, Method, and Dataset. This allows for testing how well the model can distinguish between the "how" (Method) and the "what" (Task) of scientific research.
- Wikipedia + Wikidata: By linking Wikipedia company introductions to structured Wikidata properties, the authors focused on Industry and Country. To prevent the model from simply identifying "company-like" text, they included 10,000 random articles as "hard negatives."
Key Insights and Results
Performance Gains
AspectCSE demonstrated a significant performance leap, achieving an average improvement of 3.97% in Mean Reciprocal Rank (MRR) across all information retrieval tasks compared to the previous state-of-the-art (Multiple Negative Ranking). The gap between generic and aspect-based models was particularly stark in specialized domains; for instance, on the "Task" aspect of the PwC dataset, AspectCSE achieved an MRR of 0.776, while generic models like SPECTER only reached 0.521.
The "Union" Advantage
One of the more surprising findings was that training on the Union of aspects (e.g., matching either Industry or Country) outperformed single-aspect models even when tested on a single specific aspect. This suggests that multi-aspect training provides the model with a richer context and more data, leading to more robust general representations of the underlying entities.
Emergent Semantic Clusters
The model demonstrated an ability to learn latent semantic relationships. For the "Country" aspect, the embedding space naturally clustered geographically related countries (e.g., African nations) together, despite the model never being explicitly taught geographic proximity. This indicates that the model captures deep semantic relationships through text descriptions alone.
Conclusion and Future Work
AspectCSE proves that incorporating structured knowledge into contrastive learning can produce highly effective, explainable, and targeted sentence embeddings. While the method currently relies on high-quality structured data and significant GPU compute (specifically Nvidia V100s), it opens the door for more precise information retrieval.
Future research will look toward increasing the granularity of the model—moving from paragraph-level abstracts to identifying specific aspects within individual, shorter sentences—and expanding the framework to domains where structured knowledge may be less abundant.
Summary updated