Sentence Embeddings

41 beliefs (41 IN, 0 OUT)

The Sentence Embeddings topic in this knowledge base traces the arc from distributional semantics as a theoretical foundation (distributional-semantics-foundation-embeddings) through the early development of word-level vectors and into the modern sentence-level paradigm. Mikolov's 2010 RNN-based language modeling work established the basis for distributed word representations (mikolov-2010-rnn-language-modeling-word-embeddings), which matured into Word2Vec with its CBOW and Skip-gram architectures (word2vec-two-architectures-cbow-skipgram, word2vec-mikolov-embeddings). Word2Vec and GloVe are explicitly distinguished as learning similar embeddings from fundamentally different training signals: a predictive next-word objective versus factorization of a global co-occurrence matrix (word2vec-vs-glove-distinct-training-objectives). ALBERT extended the transformer lineage by sharing parameters across layers and replacing the NSP objective with Sentence-Order Prediction (albert-shared-params-sop-replaces-nsp). A recurring finding across several beliefs is that naive extraction of sentence representations from these models fails: BERT's raw [CLS] token performs worse than averaging non-contextual word vectors (bert-cls-token-poor-sentence-embedding), and simply averaging BERT's output layer or reading [CLS] yields results worse than averaging GloVe vectors (sbert-naive-bert-worse-than-glove). The stated quality progression runs CBOW < Skip-Thought < InferSent < SBERT, positioning SBERT as state of the art at the time of writing (sentence-embedding-quality-ordering). Bias concerns are also noted, with word2vec vectors trained on Google News reproducing and even amplifying gender and racial stereotypes (bolukbasi-2016-gender-analogies-word2vec-google-news).

SBERT, authored by Reimers and Gurevych at TU Darmstadt and published at EMNLP 2019 (sbert-emnlp-2019-authors), is the central subject of the belief set, and its key contribution is demonstrating that additional NLI fine-tuning of a pretrained transformer beyond BERT's pre-training significantly improves sentence embedding quality (mteb-sbert-finetuning-contribution). Architecturally, SBERT uses a siamese structure where two BERT encoders share tied weights (sbert-siamese-tied-weights), with MEAN pooling over all token vectors as the default strategy (sbert-default-pooling-mean). Ablation on STSb confirms MEAN (80.78) outperforms CLS (79.80) and MAX (79.07) (sbert-pooling-ablation-mean-best), and on raw BERT the gap is stark: MEAN achieves 77.03 Spearman correlation versus 29.19 for [CLS] (sbert-mean-vs-cls-stsb-77-03-vs-29-19). Training uses three distinct objectives—cross-entropy classification, MSE regression, and triplet margin loss (sbert-three-objectives)—with the specific NLI configuration drawing on SNLI and MultiNLI for roughly 1 million pairs (sbert-training-config-snli-multinli). The triplet loss uses Euclidean distance with margin 1 (sbert-triplet-loss-euclidean-margin-1), and Wikipedia section triplet training yields 80.78 accuracy, beating a BiLSTM baseline at 74.00 (sbert-wikipedia-triplet-80-78-vs-bilstm-74, sbert-wiki-sec-triplet-data-size). At inference time, only cosine similarity on raw embeddings is used; the richer combination vector (u, v, |u-v|) serves exclusively during classifier training (sbert-inference-no-combination-vector), and adding the element-wise product u*v actually hurts performance (sbert-uv-product-hurts-performance). Speed is a major advantage: finding the most similar pair among 10,000 sentences takes roughly 65 hours with a BERT cross-encoder but about 5 seconds with SBERT embeddings (sbert-10k-sentence-speed-comparison), and smart batching achieves roughly 89% speedup on CPU and 48% on GPU (sbert-smart-batching-speedup-89-cpu-48-gpu), pushing throughput to 2042 sentences/second on GPU (sbert-smart-batching-throughput-83-cpu-2042-gpu). On GPU, SBERT with smart batching is about 9% faster than InferSent and 55% faster than Universal Sentence Encoder, reversing InferSent's 65% CPU advantage (sbert-gpu-faster-than-infersent-and-use, inferent-benchmark-137-cpu-1876-gpu). Backbone choice matters less than expected: RoBERTa yields only minor differences (roberta-no-significant-gain-over-bert-sbert), XLNet underperforms BERT (sbert-xlnet-underperformed-bert), and poly-encoders are unsuitable for symmetric O(n squared) tasks due to their asymmetric scoring and computational cost (sbert-poly-encoders-unsuitable-on2).

Evaluation methodology and downstream use round out the topic. The SemEval STS shared task series from 2012 through 2017 serves as the standard benchmark (sem-eval-sts-tasks-2012-2017), and Spearman rank correlation is the canonical metric, with Pearson correlation deemed "badly suited" for STS evaluation (sbert-spearman-not-pearson-metric). The SBERT pipeline of NLI fine-tuning, mean pooling, cosine similarity, and Spearman correlation is validated as the de-facto standard in both the original paper and the MTEB benchmark's STS protocol (embedding-evaluation-pipeline-consistency). Ablation experiments report averages over 10 random seeds per configuration (sbert-10-random-seeds-ablation), and speed benchmarks were run on specific hardware: Intel i7-5820K, Nvidia Tesla V100, CUDA 9.2 (sbert-benchmark-hardware-specs). On cross-topic AFS, a notable gap appears: BERT-AFS-large achieves 62.02 Pearson r while SBERT-AFS-large reaches 53.82, an roughly 8-point difference (sbert-afss-cross-topic-pearson-gap). In practical systems, Sentence-BERT embeddings from the sentence-transformers/multi-qa-mpnet-base-dot-v1 model are used to retrieve irrelevant evidence passages in the Chameleon distractor experiment (chameleon-sentence-bert-irrelevant-retrieval), and MeLLo embeds fact statements using the Contriever model for retrieval indexing (mello-uses-contriever-embedding). The reference implementation is the sentence-transformers Python library (sbert-sentence-transformers-repo).

In terms of belief status, every belief in this group carries an IN designation; none have been retracted or marked OUT. This means the knowledge base currently holds a fully coherent and uncontradicted account of sentence embeddings, spanning theoretical foundations, architectural details, training procedures, evaluation protocols, and downstream applications, with no internal conflicts or withdrawn claims to reconcile.