Are ELECTRA's Sentence Embeddings Beyond Repair? The Case of Semantic Textual Similarity

Ivan Rep, David Dukić, Jan Šnajder
2/20/2024
cs.CL

No official code found. Best implementation: ir2718/similarity-embedding-quality (1 star, MIT, last commit 2024-10-26).

Abstract

While BERT produces high-quality sentence embeddings, its pre-training computational cost is a significant drawback. In contrast, ELECTRA provides a cost-effective pre-training objective and downstream task performance improvements, but worse sentence embeddings. The community tacitly stopped utilizing ELECTRA's sentence embeddings for semantic textual similarity (STS). We notice a significant drop in performance for the ELECTRA discriminator's last layer in comparison to prior layers. We explore this drop and propose a way to repair the embeddings using a novel truncated model fine-tuning (TMFT) method. TMFT improves the Spearman correlation coefficient by over $8$ points while increasing parameter efficiency on the STS Benchmark. We extend our analysis to various model sizes, languages, and two other tasks. Further, we discover the surprising efficacy of ELECTRA's generator model, which performs on par with BERT, using significantly fewer parameters and a substantially smaller embedding size. Finally, we observe boosts by combining TMFT with word similarity or domain adaptive pre-training.

View on arXivView PDF

Code Implementations(1)

MIT

[EMNLP 2024 Findings] Are ELECTRA's Sentence Embeddings Beyond Repair? The Case of Semantic Textual Similarity

10Shell, PythonJul 17, 20231 years agoMIT
bert-modelelectra-modelsemantic-textual-similaritysentence-bertsentence-embeddings+3 more

Similar Papers

Cite this paper

@article{rep2024electras,
  title  = {Are ELECTRA's Sentence Embeddings Beyond Repair? The Case of Semantic Textual Similarity},
  author = {Ivan Rep and David Dukić and Jan Šnajder},
  year   = {2024},
  eprint = {2402.13130},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.13130v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.13130.svg)](https://codeofpaper.com/paper/2402.13130)

Discussion