CoolFace
Modelpublic

danielpark/sentence-transformers-all-mini-lm-l6-v2

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
1likes108downloads
Model Card

Sentence Transformers

We are forking sentence-transformers/all-MiniLM-L6-v2 as it is similar to the targeting dataset and use case. For more details, please check the pre-trained model weight repository.

Fine-tuning

  • —Fine-tune the model using a contrastive objective.
  • —Compute the cosine similarity from each possible sentence pairs from the batch.
  • —Then apply the cross entropy loss by comparing with true pairs.
Hyper parameters
  • —Train the model during 100k steps using a batch size of 1024 (128 per TPU core).
  • —Use a learning rate warm up of 500.
  • —The sequence length was limited to 128 tokens.
  • —Used the AdamW optimizer with a 2e-5 learning rate.
  • —The full training script is accessible in this current repository: train_script.py.
Performance
Model NamePerformance Sentence Embeddings (14 Datasets)Performance Semantic Search (6 Datasets)Avg. PerformanceSpeedModel Size
all-mpnet-base-v269.5757.0263.302800420 MB
multi-qa-mpnet-base-dot-v166.7657.6062.182800420 MB
all-distilroberta-v168.7350.9459.844000290 MB
all-MiniLM-L12-v268.7050.8259.767500120 MB
multi-qa-distilbert-cos-v165.9852.8359.414000250 MB
all-MiniLM-L6-v2 (This model)68.0649.5458.801420080 MB
multi-qa-MiniLM-L6-cos-v164.3351.8358.081420080 MB
paraphrase-multilingual-mpnet-base-v265.8341.6853.752500970 MB
paraphrase-albert-small-v264.4640.0452.25500043 MB
paraphrase-multilingual-MiniLM-L12-v264.2539.1951.727500420 MB
paraphrase-MiniLM-L3-v262.2939.1950.741900061 MB
distiluse-base-multilingual-cased-v161.3029.8745.594000480 MB
distiluse-base-multilingual-cased-v260.1827.3543.774000480 MB
Datasets
DatasetPaperNumber of training tuples
Reddit comments (2015-2018)paper726,484,430
S2ORC Citation pairs (Abstracts)paper116,288,806
WikiAnswers Duplicate question pairspaper77,427,422
PAQ (Question, Answer) pairspaper64,371,441
S2ORC Citation pairs (Titles)paper52,603,982
S2ORC (Title, Abstract)paper41,769,185
Stack Exchange (Title, Body) pairs-25,316,456
Stack Exchange (Title+Body, Answer) pairs-21,396,559
Stack Exchange (Title, Answer) pairs-21,396,559
MS MARCO tripletspaper9,144,553
GOOAQ: Open Question Answering with Diverse Answer Typespaper3,012,496
Yahoo Answers (Title, Answer)paper1,198,260
Code Search-1,151,414
COCO Image captionspaper828,395
SPECTER citation tripletspaper684,100
Yahoo Answers (Question, Answer)paper681,164
Yahoo Answers (Title, Question)paper659,896
SearchQApaper582,261
Eli5paper325,475
Flickr 30kpaper317,695
Stack Exchange Duplicate questions (titles)304,525
AllNLI (SNLI and MultiNLIpaper SNLI, paper MultiNLI277,230
Stack Exchange Duplicate questions (bodies)250,519
Stack Exchange Duplicate questions (titles+bodies)250,460
Sentence Compressionpaper180,000
Wikihowpaper128,542
Altlexpaper112,696
Quora Question Triplets-103,663
Simple Wikipediapaper102,225
Natural Questions (NQ)paper100,231
SQuAD2.0paper87,599
TriviaQA-73,346
Total1,170,060,424