Skip to main content
QUICK REVIEW

[论文解读] Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks

Nils Reimers, Iryna Gurevych|TUbilio (Technical University of Darmstadt)|Aug 27, 2019
Topic Modeling参考文献 38被引用 88
一句话总结

SBERT 对 BERT 进行西马斯/三元架构微调,以产生固定大小的句子嵌入,使得基于余弦的语义相似性、聚类和检索速度更快,同时保持强精度。

ABSTRACT

BERT (Devlin et al., 2018) and RoBERTa (Liu et al., 2019) has set a new state-of-the-art performance on sentence-pair regression tasks like semantic textual similarity (STS). However, it requires that both sentences are fed into the network, which causes a massive computational overhead: Finding the most similar pair in a collection of 10,000 sentences requires about 50 million inference computations (~65 hours) with BERT. The construction of BERT makes it unsuitable for semantic similarity search as well as for unsupervised tasks like clustering. In this publication, we present Sentence-BERT (SBERT), a modification of the pretrained BERT network that use siamese and triplet network structures to derive semantically meaningful sentence embeddings that can be compared using cosine-similarity. This reduces the effort for finding the most similar pair from 65 hours with BERT / RoBERTa to about 5 seconds with SBERT, while maintaining the accuracy from BERT. We evaluate SBERT and SRoBERTa on common STS tasks and transfer learning tasks, where it outperforms other state-of-the-art sentence embeddings methods.

研究动机与目标

  • 推动对大规模句子集合进行高效语义相似性和检索的需求
  • 提出一种对 BERT 的修改,产生适用于快速相似性搜索的固定大小句子嵌入
  • 证明 SBERT 在 STS 及相关基准上保持或提升最先进的性能
  • 展示 SBERT 相对于标准 BERT 在大规模任务中的计算优势

提出的方法

  • 使用西马斯和三元网络结构对预训练的 BERT/RoBERTa 进行句子嵌入微调
  • 对 BERT 输出进行池化(MEAN、CLS、MAX)以获得固定大小的句子向量(默认 MEAN)
  • 通过分类、回归或三元目标进行优化,以确保嵌入在语义上有意义
  • 计算句子嵌入之间的余弦相似性,以进行语义相关性任务
  • 在 SNLI 和 MultiNLI(NLI 数据)上训练,然后在 STSb 上微调(或在 NLI + STSb 上微调)以提高性能
  • 使用 STS 任务、AFS 和 SentEval 进行评估,以评估泛化和迁移

实验结果

研究问题

  • RQ1SBERT 是否能生成适用于余弦基于相似性度量的语义上有意义的句子嵌入?
  • RQ2对 BERT 进行西马斯/三元目标的微调,是否比以往的句子嵌入方法在 STS 和相关基准上有性能提升?
  • RQ3池化策略和目标选择如何影响嵌入质量及下游任务?
  • RQ4相较于跨编码器 BERT,SBERT 在大规模相似性搜索和聚类方面有哪些计算优势?

主要发现

模型STS12STS13STS14STS15STS16STSbSICK-R平均值
平均 GloVe 嵌入55.1470.6659.7368.2563.6658.0253.7661.32
平均 BERT 嵌入38.7857.9857.9863.1561.0646.3558.4054.81
BERT CLS 向量20.1630.0120.0936.8838.0816.5042.6329.19
InferSent - GloVe52.8666.7562.1572.7766.8768.0365.6565.01
Universal Sentence Encoder64.4967.8064.6176.8373.1874.9276.6971.22
SBERT-NLI-base70.9776.5373.1979.0974.3077.0372.9174.89
SBERT-NLI-large72.2778.4674.9080.9976.2579.2373.7576.55
SRoBERTa-NLI-base71.5472.4970.8078.7473.6977.7774.4674.21
SRoBERTa-NLI-large74.5377.0073.1881.8576.8279.1074.2976.68
  • SBERT 在多个 STS 数据集上显著提升 STS 相关性,相对于原始 BERT、InferSent 和 Universal Sentence Encoder
  • 在 STSb 上,SBERT-NLI-base 达到 77.03,SBERT-NLI-large 达到 79.23,使用 STSb 训练设置,接近或达到最先进水平
  • SBERT 在 SentEval 迁移任务上优于许多基线,在情感相关任务上有显著提升
  • 在 AFS 跨主题设置中,SBERT 在 10 倍交叉验证接近 BERT,但跨主题泛化存在更大差距,凸显领域挑战
  • SBERT-WikiSec 三元结果在维基百科章节数据上超过了先前的 BiLSTM 三元方法
  • SBERT 提供显著的计算效率提升,使大规模的相似性搜索和聚类成为可能

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。