[论文解读] Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
SBERT 对 BERT 进行西马斯/三元架构微调,以产生固定大小的句子嵌入,使得基于余弦的语义相似性、聚类和检索速度更快,同时保持强精度。
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 在大规模相似性搜索和聚类方面有哪些计算优势?
主要发现
| 模型 | STS12 | STS13 | STS14 | STS15 | STS16 | STSb | SICK-R | 平均值 |
|---|---|---|---|---|---|---|---|---|
| 平均 GloVe 嵌入 | 55.14 | 70.66 | 59.73 | 68.25 | 63.66 | 58.02 | 53.76 | 61.32 |
| 平均 BERT 嵌入 | 38.78 | 57.98 | 57.98 | 63.15 | 61.06 | 46.35 | 58.40 | 54.81 |
| BERT CLS 向量 | 20.16 | 30.01 | 20.09 | 36.88 | 38.08 | 16.50 | 42.63 | 29.19 |
| InferSent - GloVe | 52.86 | 66.75 | 62.15 | 72.77 | 66.87 | 68.03 | 65.65 | 65.01 |
| Universal Sentence Encoder | 64.49 | 67.80 | 64.61 | 76.83 | 73.18 | 74.92 | 76.69 | 71.22 |
| SBERT-NLI-base | 70.97 | 76.53 | 73.19 | 79.09 | 74.30 | 77.03 | 72.91 | 74.89 |
| SBERT-NLI-large | 72.27 | 78.46 | 74.90 | 80.99 | 76.25 | 79.23 | 73.75 | 76.55 |
| SRoBERTa-NLI-base | 71.54 | 72.49 | 70.80 | 78.74 | 73.69 | 77.77 | 74.46 | 74.21 |
| SRoBERTa-NLI-large | 74.53 | 77.00 | 73.18 | 81.85 | 76.82 | 79.10 | 74.29 | 76.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 生成,并经人工编辑审核。