Skip to main content
QUICK REVIEW

[Paper Review] Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text Models

Jianmo Ni, Gustavo Hernández Ábrego|arXiv (Cornell University)|Aug 19, 2021
Topic ModelingComputer Science62 citations
TL;DR

This paper studies how to extract high-quality sentence embeddings from pre-trained T5 models, compares encoder-only and encoder-decoder strategies, uses contrastive fine-tuning, and scales up to 11B parameters to achieve strong transfer and STS performance, introducing SentGLUE for broader transfer evaluation.

ABSTRACT

We provide the first exploration of sentence embeddings from text-to-text transformers (T5). Sentence embeddings are broadly useful for language processing tasks. While T5 achieves impressive performance on language tasks cast as sequence-to-sequence mapping problems, it is unclear how to produce sentence embeddings from encoder-decoder models. We investigate three methods for extracting T5 sentence embeddings: two utilize only the T5 encoder and one uses the full T5 encoder-decoder model. To support our investigation, we establish a new sentence representation transfer benchmark, SentGLUE, which extends the SentEval toolkit to nine tasks from the GLUE benchmark. Our encoder-only models outperforms Sentence-BERT and SimCSE sentence embeddings on both SentEval and SentGLUE transfer tasks, including semantic textual similarity (STS). Scaling up T5 from millions to billions of parameters is found to produce consistent further improvements. Finally, our encoder-decoder method achieves a new state-of-the-art on STS when using sentence embeddings. Our models are released at https://tfhub.dev/google/collections/sentence-t5/1.

Motivation & Objective

  • Investigate how to obtain sentence embeddings from pre-trained T5 models (encoder-only vs encoder-decoder).
  • Assess raw vs fine-tuned T5 embeddings on transfer and semantic similarity tasks.
  • Evaluate the impact of contrastive learning for fine-tuning ST5 representations.
  • Examine the benefits of scaling model size on sentence embedding quality.
  • Introduce SentGLUE as a transfer benchmark for sentence representations.

Proposed method

  • Three strategies to extract sentence representations from T5 (ST5): encoder first token, encoder mean pooling, and encoder-decoder first token.
  • Dual-encoder architecture with shared T5 modules initialized from pre-trained checkpoints and a projection + L2 normalization for fixed-length embeddings.
  • Contrastive learning losses: in-batch softmax with positive/negative pairs, with optional additional negatives in the denominator.
  • Two-stage training: first on mined Community QA data, then fine-tune on NLI with a contrastive loss.
  • Evaluation on SentEval (transfer + STS) and introduction of SentGLUE (nine GLUE tasks) to assess sentence representations.

Experimental results

Research questions

  • RQ1What is the best way to extract sentence representations from T5?
  • RQ2How do raw T5 sentence embeddings perform on downstream transfer and STS tasks?
  • RQ3How does contrastive learning improve T5 sentence embeddings?
  • RQ4Does increasing model capacity improve sentence embeddings, and by how much?

Key findings

  • Encoder-only mean pooling for T5 outperforms encoder-decoder start token on transfer tasks, and scales well with model size.
  • Encoder-decoder variants excel on STS tasks, achieving strong correlation scores nearing state-of-the-art.
  • Two-stage contrastive fine-tuning (QA mining followed by NLI) yields large gains on both transfer and STS benchmarks.
  • Scaling ST5 to 11B parameters provides consistent improvements in transfer, and encoder-decoder 11B achieves top STS performance.
  • SentGLUE provides nine GLUE-derived tasks for sentence representation transfer evaluation, with ST5-Enc Base outperforming SBERT-RoBERTa Base and SimCSE-RoBERTa Base on most tasks.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.