wikillm

Paper · 2022-12-07 · cs.CL, cs.IR

Text Embeddings by Weakly-Supervised Contrastive Pre-training

Contrastive pre-training of a BERT-family bi-encoder with in-batch negatives (batch 32,768, temperature 0.01) on CCPairs, about 270M web and forum text pairs kept by a consistency filter, then optional fine-tuning on NLI, MS-MARCO and NQ. Author-reported: E5-PT-base 42.9 nDCG@10 on BEIR vs BM25 41.7; fine-tuned E5-base 60.4 on MTEB.

Contrastive learningWeakly-supervised learningDataset curationKnowledge distillationtext-embeddingcontrastive-learningdense-retrievalweak-supervisiondata-curation

arXivPDFCodeMarkdown17 min read

AI-compiled by claude-haiku-5-5 on 2026-10-18, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

In plain words

Search, clustering and "find similar things" all work better when every piece of text is turned into a list of numbers, and texts with similar meaning get similar lists. Older text models were built for other jobs and do this poorly without extra tuning. The usual fix is to train on pairs of texts that belong together, such as a question and its answer, but labelled pairs are scarce and pairs scraped automatically are often noisy.

This paper builds a large set of text pairs from forums, encyclopedias, papers and web pages, and throws out the weakest pairs with a cleaning step. A model is then trained to pull each pair together and push apart the other texts in the same training batch. The result is a general-purpose embedding model, called E5, that works without labels. A short extra training round on a few labelled datasets improves it further.

TL;DR

  • E5 is a BERT-family encoder trained with a contrastive loss on CCPairs, a cleaned set of about 270M text pairs §3 tab. 9.
  • Negatives come from the same batch, and the batch is large (32,768) §4.1 tab. 11.
  • Author-reported: unsupervised E5-PT-base beats BM25 on the 15 public BEIR datasets (average nDCG@10 42.9 vs 41.7) tab. 1.
  • Author-reported: fine-tuned E5-base averages 60.4 on the 56 English MTEB datasets, above GTR-xxl (59.0) and Sentence-T5-xxl (59.5) tab. 3.
  • Pitfall: the code in the repository covers evaluation only. Pre-training, data construction and fine-tuning cannot be checked against code.

Problem

Pre-trained language models give token-level or sentence-level features, but they are not ideal for retrieval and matching, where one vector per text is wanted for speed and simplicity §1. Contrastive training works well for single-vector embeddings, but labelled pair data is small. Automatically built pairs (inverse cloze task, random cropping, neighbouring text spans) are plentiful but noisy, and according to the paper they do not match BM25 on BEIR without further fine-tuning §1 §2. The authors' premise is that data quality, not only quantity, decides the outcome §3 §4.

Method

Overview. The method has two stages, pre-training on unlabelled pairs and optional fine-tuning on labelled data, and the resulting embeddings are used without further training of the encoder for retrieval and classification §4 fig. 1.

Stage 0: build CCPairs §3.

  1. Collect (query, passage) pairs from semi-structured sources: Reddit (post, comment), Stackexchange (question, upvoted answer), Wikipedia (entity name plus section title, passage), Scientific papers (title and abstract, citations), Common Crawl and news (title, passage) §3. Subsets from existing datasets are reused §3 app. A.
  2. Apply heuristic filters: drop Reddit comments longer than 4096 characters or with score below 1, and drop Common Crawl passages with high perplexity §3. This leaves about 1.3 billion pairs, mostly from Reddit and Common Crawl §3.
  3. Remove pairs that also occur in the evaluation sets, by exact string match app. A.
  4. Consistency filter §3: train a model on the 1.3B pairs; rank each pair's passage against a pool of 1 million random passages; keep the pair only if its passage is in the top k = 2. About 270M pairs remain §3. The authors motivate this with the memorisation of clean labels before noisy ones §3.
  5. S2ORC pairs are down-weighted to a sample weight of 0.3 to avoid over-fitting the scientific domain app. A.

Stage 1: contrastive pre-training §4.1.

  • Bi-encoder: one shared pre-trained Transformer encodes queries and passages. Each text is average-pooled over its output tokens to get a fixed-size vector §4.1.
  • Score: cosine similarity divided by a temperature τ = 0.01 §4.1 eq. 2.
  • Loss: InfoNCE over one positive and the negatives §4.1 eq. 1.
  • Negatives: the other passages in the batch (in-batch negatives). The authors report that this beat MoCo when the batch is large §4.1 tab. 8.
  • Asymmetry: the prefix "query: " is added to queries and "passage: " to passages, so one encoder can serve both roles §4.1. For pairs where neither side is clearly the query (citation pairs), the side is chosen at random §4.1.
Pseudocode
# Contrastive pre-training with in-batch negatives  [§4.1] [eq. 1] [eq. 2]
# Input:  B (query, passage) texts; B = 32768 in pre-training  [tab. 11]
# Output: scalar loss

def pretraining_loss(queries, passages, temperature):
    # Prefixes break the symmetry between the two roles  [§4.1]
    queries = ["query: " + text for text in queries]
    passages = ["passage: " + text for text in passages]
    # One shared encoder, average pooling over tokens  [§4.1]
    query_vecs = normalize(mean_pool(encoder(queries)))    # (B, d)
    passage_vecs = normalize(mean_pool(encoder(passages)))  # (B, d)
    # Cosine similarity divided by the temperature  [eq. 2]
    scores = query_vecs @ passage_vecs.T / temperature      # (B, B)
    # Other passages in the batch are the negatives; the positive
    # for query i is passage i, on the diagonal  [§4.1] [eq. 1]
    return cross_entropy(scores, targets=arange(B)).mean()

Stage 2: fine-tuning on labelled data §4.2.

  • Datasets: NLI (in the SimCSE release), MS-MARCO passage ranking and Natural Questions (NQ), concatenated §4.2 §5.1.
  • Hard negatives: MS-MARCO and NQ use mined hard negatives and cross-encoder scores reused from SimLM. NLI contradiction sentences serve as hard negatives §4.2 §5.1.
  • Distillation: the student's probabilities are trained toward the cross-encoder teacher's probabilities with a KL term, plus α times the contrastive loss, with α = 0.2 §4.2 eq. 3 tab. 11.
  • Per example: 7 hard negatives. NLI has only one hard negative per example, so 6 sentences are sampled at random from the corpus §5.1.
Pseudocode
# Fine-tuning loss  [§4.2] [eq. 3]
# Input:  a query, its positive, hard negatives (7 per example)  [§5.1]
# Output: scalar loss

def finetuning_loss(query, positive, hard_negatives, teacher_probs):
    # Student probabilities over the candidates; the candidate set
    # for the KL term is not stated  [§4.2]
    student_probs = softmax(scores(query, [positive] + hard_negatives))
    # Distil the cross-encoder's soft labels  [§4.2] [eq. 3]
    distill = kl_divergence(teacher_probs, student_probs)
    # Contrastive loss on the hard labels, alpha = 0.2  [tab. 11]
    contrast = info_nce(query, positive, hard_negatives)
    return distill + alpha * contrast

Use as an embedding §4.3.

  • Zero-shot retrieval: index passage embeddings offline, embed the query, and return the top-k by cosine similarity §4.3.
  • Few-shot classification: train a linear classifier on frozen embeddings with a few labelled examples §4.3.
  • Zero-shot classification: write each label as a sentence from a manual template and predict the nearest label embedding. The example in the paper uses "movie review: " as the input prefix and a "terrible/great movie review" label text §4.3.
  • Semantic similarity: cosine similarity, evaluated by rank correlation §4.3.
  • Clustering: standard algorithms such as k-means §4.3.
  • For tasks other than zero-shot classification and retrieval, the query prefix embedding is used by default §4.3.

Hyperparameters

Values for the three sizes are listed in the order small / base / large. Model sizes are in tab. 10. The paper's text also gives these settings in §5.1 and app. B.

NameValueWhereNotes
Encoder init (pre-training)MiniLM / bert-base-uncased / bert-large-uncased-whole-word-masking§5.1E5-small, E5-base, E5-large
Model size12 layers, 384 hidden, 33M / 12 layers, 768 hidden, 110M / 24 layers, 1024 hidden, 330Mtab. 10"300M" in §5.4 text for E5-large (see Pitfalls)
Pre-training batch size32,768§5.1 tab. 11in-batch negatives
Pre-training learning rate3e-4 / 2e-4 / 1e-4§5.1 tab. 11linear decay §5.1
Pre-training warmup1,000 steps§5.1 tab. 11
Pre-training steps20k (about 2.5 epochs over CCPairs)§5.1 tab. 11
Pre-training max length128tab. 11tokens
Pre-training GPUs16 / 32 / 64 V100§5.1 tab. 111 / 1 / 2 days
Pre-training weight decay0.01tab. 11optimizer AdamW §5.1
Temperature τ0.01§4.1 tab. 11pre-training and fine-tuning
Fine-tuning learning rate3e-5 / 2e-5 / 1e-5§5.1 tab. 11
Fine-tuning warmup400 steps§5.1 tab. 11
Fine-tuning epochs3§5.1 tab. 11
Fine-tuning batch size256§5.1 tab. 11on 8 GPUs §5.1
Fine-tuning max length192tab. 11tokens
Hard negatives per example7§5.1 tab. 11NLI: 1 mined + 6 random
Distillation / contrastive weight α0.2§4.2 tab. 11see Pitfalls on eq. 3
Weight decay (fine-tuning)0.01tab. 11
Position embeddingsfrozen during pre-training and fine-tuningapp. B
Evaluation max length512app. B
Precisionmixed precision and gradient checkpointing during training§5.1
Evaluation prefixes"query: " for queries, "passage: " for passages; Quora uses "query: " on both sidesapp. B

Results

Author-reported. Setup: BEIR (15 public datasets, nDCG@10) and MTEB (56 English datasets, mean over categories) §5.2. Emphasis marks from the paper are omitted; "-" means not reported.

Table 1: unsupervised, BEIR nDCG@10 tab. 1. cpt₃₀₀M is available only through a paid API and is missing some datasets. LaPraDor uses no BM25 ensemble tab. 1.

DatasetBM25SimCSELaPraDorContrievercpt300ME5-PT-sE5-PT-bE5-PT-l
MS MARCO22.89.416.920.619.925.426.026.2
Trec-Covid65.626.222.727.452.952.061.061.8
NFCorpus32.59.931.131.732.029.335.833.7
NQ32.911.718.125.4-37.339.041.7
HotpotQA60.319.830.348.151.546.052.452.2
FiQA23.69.820.324.534.138.340.043.2
ArguAna31.538.345.937.938.742.542.244.4
Touche-202036.78.99.419.321.019.916.919.8
CQADupStack29.913.222.028.4-35.035.438.9
Quora78.978.078.783.568.185.885.786.1
DBPedia31.315.025.029.227.234.535.437.1
Scidocs15.85.513.314.9-19.921.121.8
Fever75.321.136.868.257.162.563.468.6
Climate-Fever21.311.813.815.515.814.515.415.7
Scifact66.525.755.564.965.468.573.772.3
Average41.720.329.336.0-40.842.944.2

The paper states that E5-PT-base beats BM25 by 1.2 points on average, that this is the first unsupervised model to do so on BEIR, and that E5-PT-large reaches 44.2 §5.3.

Table 2: supervised fine-tuning, BEIR nDCG@10 tab. 2. ANCE, ColBERT and Contriever values come from Izacard et al. tab. 2. MS-MARCO and NQ are in-domain for the fine-tuned E5 models; the other datasets are zero-shot transfer §5.3.

DatasetANCEGTR-baseColBERTContrievercpt300MGTR-largeE5-sE5-bE5-l
MS MARCO38.842.040.140.7-43.042.343.144.1
Trec-Covid65.453.967.759.667.955.776.879.678.3
NFCorpus23.730.830.532.833.232.933.936.636.1
NQ44.649.552.449.8-54.758.760.062.9
HotpotQA45.653.559.363.859.457.956.362.263.3
FiQA29.534.931.732.938.442.434.836.438.6
ArguAna41.551.123.344.647.052.546.751.449.4
Touche-202024.020.520.223.028.521.926.828.327.2
CQADupStack29.635.735.034.5-38.436.138.939.4
Quora85.288.185.486.570.689.087.787.988.2
DBPedia28.134.739.241.336.239.138.641.042.4
Scidocs12.214.914.516.5-15.816.419.020.1
Fever66.966.077.175.872.171.253.558.265.0
Climate-Fever19.824.118.423.718.526.215.815.422.4
Scifact50.760.067.167.767.263.965.673.172.6
Average40.544.044.446.6-47.046.048.750.0

Table 3: MTEB English, category means tab. 3. Glossary: Class. = Classification, Clust. = Clustering, PairClass. = Pair Classification, Retr. = Retrieval, Summ. = Summarization. Category counts: 12, 11, 3, 4, 15, 10, 1 (56 datasets). The caption refers readers to app. B for the detailed version, but in the LaTeX order that table is tab. 13 in app. C.

ModelClass.Clust.PairClass.RerankRetr.STSSumm.Avg
Unsupervised
Glove57.327.770.943.321.661.928.942.0
BERT61.730.156.343.410.654.429.838.3
SimCSE-BERT-unsup62.529.070.346.520.374.331.245.5
E5-PT-small67.041.778.253.140.868.832.754.3
E5-PT-base67.943.479.253.542.969.531.155.6
E5-PT-large69.044.380.354.444.269.932.656.6
Supervised
SimCSE-BERT-sup67.333.473.747.521.879.123.348.7
BERT-FT-base68.733.982.650.541.579.229.055.2
Contriever66.741.182.553.141.976.530.456.0
GTR-large67.141.685.355.447.478.229.558.3
Sentence-T5-large72.341.785.054.036.781.829.657.1
E5-small71.739.585.154.546.080.931.458.9
E5-base72.642.185.155.748.781.031.060.4
E5-large73.143.385.956.550.082.131.061.4
Larger models
GTR-xxl67.442.486.156.748.578.430.659.0
Sentence-T5-xxl73.443.785.156.442.282.630.159.5

The paper states that E5-base (110M) is competitive with GTR-xxl and Sentence-T5-xxl (4.8B) and that E5-large is more than 10× smaller than those two §1 §5.4. It also says that the difference between BERT-FT-base and E5-base isolates the effect of contrastive pre-training on CCPairs §5.4.

Table 4: zero-shot text classification, SST-2 dev accuracy tab. 4.

ModelMajorityZero-shot BERT-baseE5-smallE5-baseE5-largeFull FT BERT-baseFull FT BERT-large
SST-250.958.979.781.385.393.594.9

Table 5: batch size, base models tab. 5.

Batch sizeNFCorpusNQFiQAQuoraDBPediaScifactAvg
32k35.839.040.085.735.473.751.6
8k33.338.537.685.734.071.850.2
1k28.233.130.484.030.169.145.8

Table 6: labelled fine-tuning mix, base models tab. 6.

Fine-tuned onRetrievalSTSClassificationSumm.MTEB Avg
No fine-tuning42.969.567.931.155.6
MS-MARCO + NQ50.378.368.330.659.0
NLI38.381.172.631.657.3
All above48.781.073.131.060.4

Table 7: consistency filter, base models tab. 7. The top two rows train on 1M random pairs; the bottom two on all pairs.

# of pairsFilterNFCorpusNQFiQAQuoraDBPediaScifactAvg
1Mw/o filter23.015.118.583.118.251.434.9
1Mw/ filter26.822.724.585.027.557.540.7
Allw/o filter34.535.439.185.732.972.550.0
Allw/ filter35.839.040.085.735.473.751.6

Table 8: negative sampling, base models tab. 8.

Negatives# negativesNFCorpusNQFiQAQuoraDBPediaScifactAvg
In batch32k35.839.040.085.735.473.751.6
+ pre-batch64k29.427.229.484.625.064.343.3
MoCo130k29.736.132.081.629.963.645.5

Table 9: CCPairs sources after filtering tab. 9. The "random example" column of the paper is not reproduced here.

Data sourceType of text pairs# of pairs
Wikipedia(entity + section title, passage)24M
Reddit(post, upvoted comment)60M
Common Crawl(title, passage)69M
Stackexchange(title, answer); (title + description, answer)19M
S2ORC(title, abstract); (title, citation title); (abstract, citation abstract)90M
News(title, passage); (highlight, passage)3M
Othersmisc. (SimpleWiki, GooAQ, WikiHow, Yahoo Answers)6M
All~270M

Table 10: model configurations tab. 10.

Model# layershidden size# params
E5-small1238433M
E5-base12768110M
E5-large241024330M

Table 11: hyperparameters tab. 11.

SettingPT-smallPT-basePT-largeFT-smallFT-baseFT-large
learning rate3e-42e-41e-43e-52e-51e-5
GPUs163264888
warmup steps100010001000400400400
batch size32K32K32K256256256
max steps20K20K20Kn.a.n.a.n.a.
max length128128128192192192
epochsn.a.n.a.n.a.333
τ0.010.010.010.010.010.01
αn.a.n.a.n.a.0.20.20.2
weight decay0.010.010.010.010.010.01
hard negatives000777

PT = contrastive pre-training (E5-PT); FT = fine-tuning (E5).

Table 12: in-domain results tab. 12. "Target pre-train" marks models that first receive extra pre-training on the target corpus, before supervised fine-tuning. The NQ columns follow DPR's passage retrieval setup. MS-MARCO results use RocketQA document titles app. B.

Modeltarget pre-trainMS-MARCO MRR@10MS-MARCO R@1kNQ R@20NQ R@100
ANCEno33.095.981.987.5
RocketQAv2no38.898.183.789.0
SimLMyes41.198.785.289.7
E5-smallno37.598.184.689.8
E5-baseno38.598.586.190.7
E5-largeno39.498.786.490.5

Table 13: per-dataset MTEB, non-retrieval tasks tab. 13. The 15 retrieval datasets are omitted here because they are the BEIR datasets in Tables 1 and 2.

DatasetPT-sPT-bPT-lE5-sE5-bE5-l
AmazonCounterfactualClassification71.773.670.476.279.777.7
AmazonPolarityClassification76.177.083.287.588.090.1
AmazonReviewsClassification35.035.837.442.642.743.0
Banking77Classification82.182.983.581.983.384.1
EmotionClassification42.244.243.546.949.448.1
ImdbClassification67.967.377.775.676.082.1
MassiveIntentClassification70.271.170.872.272.373.2
MassiveScenarioClassification74.675.475.975.876.877.4
MTOPDomainClassification91.392.393.292.193.293.9
MTOPIntentClassification71.974.074.273.274.876.4
ToxicConversationsClassification67.067.466.172.874.170.6
TweetSentimentExtractionClassification54.453.352.563.361.461.2
ArxivClusteringP2P47.949.349.444.144.646.2
ArxivClusteringS2S39.942.843.637.140.541.4
BiorxivClusteringP2P38.538.839.235.836.237.6
BiorxivClusteringS2S35.436.536.731.932.735.1
MedrxivClusteringP2P34.433.733.331.331.532.3
MedrxivClusteringS2S32.032.132.228.228.329.7
RedditClustering46.949.352.442.948.250.7
RedditClusteringP2P60.264.464.656.462.261.4
StackExchangeClustering57.760.263.359.163.965.0
StackExchangeClusteringP2P32.034.034.730.332.633.6
TwentyNewsgroupsClustering34.436.237.937.542.643.8
SprintDuplicateQuestions91.690.892.095.394.995.4
TwitterSemEval201560.062.864.774.274.476.1
TwitterURLCorpus83.284.084.185.886.086.3
AskUbuntuDupQuestions57.857.658.359.459.760.1
MindSmallReranking29.029.629.229.630.130.8
SciDocsRR81.182.684.379.882.983.9
StackOverflowDupQuestions44.444.245.849.150.151.3
BIOSSES69.271.969.784.285.184.7
SICK-R66.668.769.778.979.780.5
STS1260.757.954.775.274.275.9
STS1371.173.574.081.883.385.2
STS1464.264.065.378.578.580.5
STS1574.375.475.887.588.488.8
STS1676.679.880.184.684.285.3
STS1778.377.276.087.987.289.4
STS2259.256.262.863.862.963.0
STSBenchmark67.770.570.986.486.287.2
SummEval32.731.132.631.431.031.0

Negative results app. C. Adding one BM25 hard negative per pair gave about 0.5 BEIR points on a 15M-pair set but was too slow at 250M+ pairs app. C. RoBERTa initialisation was worse than BERT on most BEIR datasets app. C. An auxiliary MLM loss on 25% of pairs gave results on par with no auxiliary loss at higher cost app. C.

Paper vs code

The official repository is microsoft/unilm, MIT-licensed, at commit 31c5b904ca1bf2afb4c234a6675c683a4e5fc7cd, with the E5 code in e5/. The e5/ folder contains evaluation code only: BEIR and MTEB runners, a pooling and prompt helper, and model-name mappings. It has no pre-training, CCPairs construction, consistency-filter or fine-tuning code, so the training stages below are not checked against code. The README also lists later E5 models (v2, multilingual, Mistral-based) README.md.

Checked and consistent:

Discrepancies:

  • BEIR average for E5-base: README 48.8 README.md; Table 2 48.7 tab. 2 §5.3. The E5-small (46.0) and E5-large (50.0) values match. The README is a later snapshot, so the difference is probably a version difference. This cannot be settled from the code here.
  • Titles: the BEIR evaluation prepends each corpus document's title to its text mteb_beir_eval.py. The paper says titles are used for MS-MARCO in-domain results only app. B and says nothing about BEIR corpus documents.
  • Classification: for tasks typed "Classification", the code disables L2 normalisation mteb_except_retrieval_eval.py. The paper does not state this.
  • Precision: the evaluation loads the model in float16 and encodes under autocast mteb_beir_eval.py mteb_beir_eval.py. The paper does not state evaluation precision.
  • MTEB version: the code pins mteb==1.0.2 requirements.txt. The paper does not state the MTEB version it used.

No other discrepancies found in the evaluation code.

Pitfalls

  • E5-large size. §5.4 says "300M parameters" for E5-large §5.4. Table 10 gives 330M tab. 10. The abstract's "40x more parameters" is the comparison of E5-base (110M) with the 4.8B GTR-xxl and Sentence-T5-xxl §1 §5.4. Use the table value.
  • Equation 3 weighting. The text calls the fine-tuning loss a "linear interpolation" §4.2, but eq. 3 is written as D_KL + α·L_cont, with no weight on the KL term. Table 11 gives α = 0.2 tab. 11. Whether the KL term is weighted (and by what) is not stated. The code for fine-tuning is not in the repository.
  • Teacher and candidates for distillation. The paper does not say how the cross-encoder scores are turned into probabilities, over which candidate set the KL is computed, or whether NLI has a teacher §4.2 §5.1. The text says NLI uses contradiction sentences as hard negatives §4.2.
  • Consistency filter. The paper does not name the model used for the filter, or say whether the pair's own passage is in the 1M pool before ranking, or how the pool is sampled §3. The value k = 2 comes from "manual inspection" §3, and iterated filtering is left for future work §3.
  • Warmup and decay. The schedule is "linear decay" with warmup §5.1. The decay horizon, final learning rate, Adam betas and epsilon, and dropout are not stated.
  • Cross-device negatives. The batch of 32,768 is spread across 16 to 64 GPUs §5.1 tab. 11. Whether negatives are gathered across devices is not stated. The 32k count of negatives holds only if they are.
  • Truncation and positions. Pre-training uses a maximum length of 128 tokens tab. 11, fine-tuning 192 tab. 11, and evaluation 512 app. B. Position embeddings are frozen during training, which is what makes the longer evaluation length possible app. B. The paper does not say how many texts exceed the training limits.
  • Quality filters are coarse. The Reddit length and score rules, the Common Crawl perplexity cut-off, and the exact contamination check §3 app. A are described qualitatively. Contamination removal is by exact string match only app. A, so near-duplicates may remain.
  • MS-MARCO titles. BEIR MS-MARCO has no titles, so its results are expected to be lower than the in-domain numbers, which use RocketQA titles app. B tab. 12.
  • In-domain vs zero-shot in averages. In the fine-tuned BEIR average tab. 2, MS-MARCO and NQ are in-domain for E5 §5.3. Compare averages only with that in mind.
  • Compute. Pre-training took 1 to 2 days on 16 to 64 V100 GPUs §5.1 tab. 11. CCPairs construction (about 1.3B pairs, then 270M kept) is a large data pipeline the paper describes only in outline §3.
  • Reproducing MTEB numbers. Results depend on the MTEB version and on the prompt and normalisation choices above. The paper's table caption refers to app. B for the detailed MTEB table, but that table sits in app. C tab. 3 tab. 13.
  • Figure. Figure 1 gives the data pipeline and architecture in one picture fig. 1. This card describes it in words only.

Lineage

  • Builds on: InfoNCE loss and in-batch negatives, following SimCLR [Chen et al. 2020] §4.1. Consistency filtering follows Promptagator §3. Hard negatives and cross-encoder scores are reused from SimLM §4.2 §5.1. The backbone is MiniLM for the small model and BERT for the base and large ones §5.1.
  • Compared against: BM25 tab. 1; SimCSE, LaPraDor, Contriever and cpt-300M tab. 1; ANCE, ColBERT and GTR tab. 2; GTR-large, Sentence-T5 and BERT-FT tab. 3; pre-batch negatives and MoCo tab. 8; RocketQAv2 and SimLM in-domain tab. 12.
  • Superseded by: not stated in this paper. The code README lists later E5 variants (see Paper vs code).

Source and license

Adapted from “Text Embeddings by Weakly-Supervised Contrastive Pre-training” by Liang Wang, Nan Yang, Xiaolong Huang, Binxing Jiao, Linjun Yang, Daxin Jiang, Rangan Majumder, Furu Wei (arXiv:2212.03533), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/microsoft/unilm at commit 31c5b904ca1b (MIT). Any quoted code is shown under that license.