NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

McPhraSy: Multi-Context Phrase Similarity and Clustering

Amir David Nissan Cohen, Hila Gonen, Ori Shapira, Ran Levy, Yoav Goldberg

Abstract

McPhraSy (Multi-context Phrase Similarity) is a novel approach that estimates phrase similarity by leveraging multiple real-world contexts at inference time. By aggregating representations from various sentences where a phrase appears, it moves beyond static embeddings to capture nuanced semantic signals. McPhraSy achieves new state-of-the-art results on standard benchmarks and excels at a newly introduced keyphrase clustering task for product reviews.

Introduction

In Natural Language Processing, determining if two phrases (e.g., "quick delivery" and "super fast shipping") are semantically equivalent is a significant challenge. Traditional methods typically represent phrases as single, static vectors. While some models incorporate context during training, they often ignore it at inference time, treating phrases in isolation. This leads to a loss of semantic nuance and a "lexical trap" where models over-rely on word overlap rather than functional meaning. McPhraSy addresses these issues by utilizing a multi-context approach that observes how phrases behave in diverse real-world usage.

Methodology

The McPhraSy framework operates in three distinct stages:

  1. Context Retrieval & Representation: For a target phrase, the system retrieves up to $m$ sentences from a large corpus. The phrase is masked within these contexts and processed via SpanBERT to generate contextualized representations. These are then concatenated with static embeddings from Phrase-BERT.
  2. The McPhraSy Embedder: The resulting vectors are passed through a 2-layer Multi-Layer Perceptron (MLP) trained with a triplet loss objective. This training minimizes the distance between different contexts of the same phrase while maximizing the distance to contexts of unrelated phrases.
  3. Distribution-Based Similarity: Rather than simple vector averaging, McPhraSy employs a similarity metric based on the Cumulative Distribution Function (CDF) of pairwise distances between context sets. This captures the spatial overlap of context distributions more effectively than point-based averages.
The McPhraSy architecture illustrating the flow from phrase input to multi-context embedding generation.

Experimental Setup and Results

The authors evaluated McPhraSy across three major benchmarks:

  • Turney (2012): A synonym selection task where McPhraSy achieved 71.3% accuracy, a 13.3 percentage point improvement over the previous state-of-the-art.
  • PPDB-filtered: A dataset controlled for lexical overlap, where the model reached 68.7% accuracy.
  • Keyphrase Clustering: A new dataset curated from Amazon Product Reviews. McPhraSy consistently outperformed baselines like GloVe and Phrase-BERT across V-measure and Adjusted Rand Index metrics.

Analysis: The Role of Context

A core finding of this research is that providing multiple contexts at inference time significantly disambiguates phrase meaning.

Performance impact of increasing the number of contexts, showing a sharp rise in accuracy followed by diminishing returns after approximately 100 contexts.

As shown in the analysis of context volume, performance improves drastically as the number of retrieved sentences increases. However, the model reaches a "sweet spot" at approximately 100 contexts, after which gains become marginal. Furthermore, by training only the MLP head on top of frozen transformer layers, the model learns to prioritize functional similarity over deceptive lexical overlap.

Discussion and Future Work

While McPhraSy sets a new performance standard, it introduces certain trade-offs. The method is dependent on a large "complementary corpus" for context retrieval, which may limit its effectiveness for rare or highly specialized domain phrases. Additionally, the computational cost of processing 100+ contexts per phrase is higher than standard embedding lookups. Future research may focus on optimizing this overhead and exploring the model's generalizability to low-resource text domains.

Summary updated

BibTeX
@inproceedings{cohen2022mcphrasy,
  author = {Amir David Nissan Cohen and Hila Gonen and Ori Shapira and Ran Levy and Yoav Goldberg},
  title = {{McPhraSy: Multi-Context Phrase Similarity and Clustering}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.findings-emnlp.259},
}
Figure