Learning High-Quality and General-Purpose Phrase Representations

Lihu Chen, Gaël Varoquaux, Fabian M. Suchanek

Abstract

Phrase representations play an important role in data science and natural language processing, benefiting various tasks like Entity Alignment, Record Linkage, Fuzzy Joins, and Paraphrase Classification. The current state-of-the-art method involves fine-tuning pre-trained language models for phrasal embeddings using contrastive learning. However, we have identified areas for improvement. First, these pre-trained models tend to be unnecessarily complex and require to be pre-trained on a corpus with context sentences. Second, leveraging the phrase type and morphology gives phrase representations that are both more precise and more flexible. We propose an improved framework to learn phrase representations in a context-free fashion. The framework employs phrase type classification as an auxiliary task and incorporates character-level information more effectively into the phrase representation. Furthermore, we design three granularities of data augmentation to increase the diversity of training samples. Our experiments across a wide range of tasks reveal that our approach generates superior phrase embeddings compared to previous methods while requiring a smaller model size.

Introduction

In Natural Language Processing (NLP), embedding full sentences or single words has reached high levels of maturity. However, phrases—such as "The New York Times" or "black pant men"—occupy a challenging middle ground. Existing state-of-the-art methods, like Phrase-BERT, typically rely on contextual information, requiring the surrounding sentence to interpret a phrase.

In real-world applications like search queries, database column names, or clinical reports, phrases often appear in isolation. Without context, current models struggle with morphological variations (e.g., failing to link "NYTimes" to "The New York Times") and semantic confusion (e.g., conflating "New York" the city with "The New York Times" the organization). Furthermore, these models are often unnecessarily large and computationally expensive.

Methodology: The PEARL Framework

We introduce PEARL (Phrase Embeddings by Augmented Representation Learning), a context-free contrastive learning framework designed to address these limitations. The architecture is built on three main pillars:

Dual-Encoder Strategy

PEARL utilizes a dual-encoder approach to capture both semantic and morphological features. It combines a phrase-level encoder (based on the E5 model) with a lightweight character-level encoder (LOVE). This hybrid approach ensures robustness against misspellings, abbreviations, and out-of-vocabulary words.

The PEARL architecture, featuring a dual-encoder strategy and an auxiliary phrase type prediction task to refine embeddings.

Multi-Granular Data Augmentation

To teach the model to recognize similarity across variations, we employ three levels of augmentation:

  1. Character-level: Swapping, dropping, or inserting letters (e.g., "Timse" vs "Times").
  2. Token-level: Swapping word order or replacing words with synonyms.
  3. Phrase-level: Utilizing generative models to create paraphrases (e.g., "The Times").

Phrase Type Classification

A key innovation in PEARL is the use of phrase type classification as an auxiliary task. The model is trained to predict both the lexical category (e.g., Noun Phrase) and the entity type (e.g., Organization vs. Geopolitical Entity). This forces the model to separate phrases that share many characters but belong to different semantic categories, such as "New York" and "The New York Times."

Key Results and Evaluation

PEARL was trained on 3.8 million phrases extracted from Wikipedia and evaluated against a wide range of benchmarks, including entity retrieval, clustering, and fuzzy joins.

Comparison of phrase similarity rankings across models, demonstrating PEARL's ability to distinguish between semantically distinct but lexically similar entities.

As shown in the evaluation above, PEARL significantly outperforms larger models in disambiguation. While Phrase-BERT and UCTopic (up to 253M parameters) incorrectly rank "New York Post" as more similar to "The New York Times" than actual variants like "nytimes.com," the compact PEARL-small (40M parameters) correctly identifies the organizational relationship.

Key performance highlights include:

  • Efficiency: PEARL-small (40M) outperformed UCTopic (240M) in clustering tasks by a significant margin.
  • Fuzzy Joins: On the AutoFJ benchmark, PEARL-base achieved 76.3% accuracy, setting a new state-of-the-art for embedding-based methods.
  • Generalizability: The framework can be integrated into other models like BERT or RoBERTa, consistently improving phrase-level performance by 17-21%.

Conclusion

PEARL demonstrates that context is not always necessary for high-quality phrase representations. By focusing on internal phrase structure—specifically morphology and type—PEARL achieves superior accuracy with a fraction of the parameters required by previous models. While the model is optimized for short-text morphology and does not capture long-distance dependencies in complex sentences, it provides a highly efficient and precise solution for a wide array of data science and NLP tasks.

Summary updated

BibTeX
@inproceedings{chen2024learning,
  author = {Lihu Chen and Gaël Varoquaux and Fabian M. Suchanek},
  title = {{Learning High-Quality and General-Purpose Phrase Representations}},
  booktitle = {EACL (Findings)},
  year = {2024},
  url = {https://openreview.net/forum?id=IL5L5gerf5},
}
Figure