Paraphrastic Representations at Scale

John Wieting, Kevin Gimpel, Graham Neubig, Taylor Berg-Kirkpatrick

Introduction

Measuring Semantic Textual Similarity (STS) is foundational for tasks such as paraphrase detection and parallel text mining. While Large Language Models (LLMs) and Transformer-based encoders like BERT provide high accuracy, they suffer from a "speed tax" due to quadratic complexity in cross-attention mechanisms. This makes them impractical for large-scale applications, such as searching through hundreds of millions of web pages. The P-SP (PARAGRAM-SP) system addresses this by providing a lightweight alternative that maintains high accuracy without the computational overhead.

Methodology

The P-SP model utilizes a deceptively simple word-averaging approach. Sentences are tokenized into subword units via SentencePiece, and the final sentence representation is the arithmetic mean of the learned subword embeddings. This architecture contains no hidden layers, LSTMs, or Transformers.

The model's effectiveness stems from its training regime:

  1. Contrastive Learning: A margin-based loss ensures sentence embeddings are closer to known paraphrases than to dissimilar "negative" examples.
  2. Mega-batching: Large batches are used to identify the most challenging negative examples during training, enhancing the model's discriminative power.
  3. Efficient Data Handling: Integration with HDF5 allows training on tens of millions of sentence pairs (e.g., the 25.85M pairs in ParaNMT) directly from disk, bypassing RAM limitations.

Experimental Results

P-SP was evaluated against several strong baselines, including Sentence-BERT and LASER, across English and multilingual benchmarks.

Accuracy on Semantic Similarity

On English STS benchmarks (2012-2016), P-SP achieved an average Pearson correlation of 74.6, outperforming Sentence-BERT (70.9) and significantly exceeding standard BERT variants. This demonstrates that for semantic tasks, simple averaging can be more effective than complex deep learning architectures.

Table 1: Semantic Textual Similarity (STS) performance comparison across various models and years.

Inference Speed and Scalability

The primary advantage of P-SP is its efficiency. Because the model relies on simple lookups and averaging, it is highly optimized for both GPU and CPU environments. On a single CPU core, P-SP processes over 12,000 sentences per second, whereas models like LASER or Sentence-BERT drop to significantly lower throughput. This makes P-SP uniquely suited for "at scale" processing where hardware resources may be limited.

Table 2: Inference speed comparison (sentences per second) on GPU and CPU hardware.

Conclusion

P-SP demonstrates that simple averaging models can outperform multi-billion parameter Transformers on unsupervised semantic similarity tasks. While slightly less effective at literal bitext mining compared to specialized models like LaBSE, its extreme speed and high paraphrastic accuracy make it an ideal candidate for large-scale NLP pipelines. Future work will explore expanding language coverage and utilizing these embeddings for fine-tuning generative models.

Summary updated

BibTeX
@inproceedings{wieting2022paraphrastic,
  author = {John Wieting and Kevin Gimpel and Graham Neubig and Taylor Berg-Kirkpatrick},
  title = {{Paraphrastic Representations at Scale}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-demos.38},
}
Figure