You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -120,7 +120,7 @@ For advanced usage, please refer to our [usage documentation](https://github.com
120
120
121
121
## Updates & Announcements
122
122
123
-
-**12/02/2024**: We released **Model2Vec training**, allowing you to fine-tune your own classification models on top of Model2Vec models. Find out more in our [documentation](https://github.com/MinishLab/model2vec/blob/main/model2vec/train/README.md) and in our [blog post](LINK).
123
+
-**12/02/2024**: We released **Model2Vec training**, allowing you to fine-tune your own classification models on top of Model2Vec models. Find out more in our [training documentation](https://github.com/MinishLab/model2vec/blob/main/model2vec/train/README.md) and [results](results/README.md#training-results).
124
124
125
125
-**30/01/2024**: We released two new models: [potion-base-32M](https://huggingface.co/minishlab/potion-base-32M) and [potion-retrieval-32M](https://huggingface.co/minishlab/potion-retrieval-32M). [potion-base-32M](https://huggingface.co/minishlab/potion-base-32M) is our most performant model to date, using a larger vocabulary and higher dimensions. [potion-retrieval-32M](https://huggingface.co/minishlab/potion-retrieval-32M) is a finetune of [potion-base-32M](https://huggingface.co/minishlab/potion-base-32M) that is optimized for retrieval tasks, and is the best performing static retrieval model currently available.
126
126
@@ -133,6 +133,7 @@ For advanced usage, please refer to our [usage documentation](https://github.com
133
133
-**Lightweight Dependencies**: the base package's only major dependency is `numpy`.
134
134
-**Lightning-fast Inference**: up to 500 times faster on CPU than the original model.
135
135
-**Fast, Dataset-free Distillation**: distill your own model in 30 seconds on a CPU, without a dataset.
136
+
-**Fine-tuning**: fine-tune your own classification models on top of Model2Vec models.
136
137
-**Integrated in many popular libraries**: Model2Vec is integrated direclty into popular libraries such as [Sentence Transformers](https://github.com/UKPLab/sentence-transformers) and [LangChain](https://github.com/langchain-ai/langchain). For more information, see our [integrations documentation](https://github.com/MinishLab/model2vec/blob/main/docs/integrations.md).
137
138
-**Tightly integrated with HuggingFace hub**: easily share and load models from the HuggingFace hub, using the familiar `from_pretrained` and `push_to_hub`. Our own models can be found [here](https://huggingface.co/minishlab).
138
139
@@ -173,6 +174,7 @@ We provide a number of models that can be used out of the box. These models are
173
174
174
175
We have performed extensive experiments to evaluate the performance of Model2Vec models. The results are documented in the [results](results/README.md) folder. The results are presented in the following sections:
Loading pipelines in this way is _extremely_ fast. It takes only 30ms to load a pipeline from disk.
94
94
95
-
# Results
96
-
97
-
The main results are detailed in our training blogpost, but we'll do a comparison with vanilla model2vec here. In a vanilla model2vec classifier, you just put a scikit-learn `LogisticRegressionCV` on top of the model encoder. In contrast, training a `StaticModelForClassification` fine-tunes the full model, including the `StaticModel` weights. The Setfit model is trained on using [all-minilm-l6-v2](sentence-transformers/all-MiniLM-L6-v2) as a base model.
98
-
99
-
We use 14 classification datasets, using 1000 examples from the train set, and the full test set. No parameters were tuned on any validation set. All datasets were taken from the [Setfit organization on Hugging Face](https://huggingface.co/datasets/SetFit).
As you can see, full fine-tuning brings modest performance improvements in some cases, but very large ones in other cases, leading to a pretty large increase in average score. Our advice is to test both if you can use `potion-base-32m`, and to use full fine-tuning if you are starting from another base model.
124
-
125
-
The speed difference between model2vec and setfit is immense, with the full finetune being 35x faster than a setfit based on `all-minilm-l6-v2` on CPU.
Copy file name to clipboardExpand all lines: results/README.md
+46-2Lines changed: 46 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
1
# Results
2
2
3
-
This page contains the experiments results of the Model2Vec project. The results are presented in the following sections:
3
+
This document contains the results of the Model2Vec project. The results are presented in the following sections:
4
4
-[MTEB Results](#mteb-results)
5
+
-[Training Results](#training-results)
5
6
-[Ablations](#ablations)
6
7
7
8
## MTEB Results
@@ -51,7 +52,7 @@ NOTE: for fairness of comparison, we disabled multiprocessing for Model2Vec for
51
52
|*Figure: The average MTEB score plotted against sentences per second. The circle size indicates model size.*|
52
53
53
54
54
-
## Retrieval Results
55
+
###Retrieval Results
55
56
56
57
A subset of models we created and compare against are specifically designed for retrieval tasks. The results are shown in the table below, including two general-purpose models for comparison and a transformer.
57
58
@@ -65,6 +66,49 @@ A subset of models we created and compare against are specifically designed for
65
66
66
67
As can be seen, [potion-retrieval-32M](https://huggingface.co/minishlab/potion-retrieval-32M) model is the most performant static retrieval model, reaching 86.65%% of the performance of [all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) with a retrieval score of 36.35.
67
68
69
+
## Training Results
70
+
71
+
The main results for Model2Vec training are outlined in this section.
72
+
73
+
We compare three different architectures:
74
+
-`model2vec + logreg`: A model2vec model with a scikit-learn `LogisticRegressionCV` on top.
75
+
-`model2vec full finetune`: A model2vec classifier with the full model finetuned. This uses our `StaticModelForClassification`.
76
+
-`setfit`: A [SetFit](https://github.com/huggingface/setfit/tree/main) model trained using [all-minilm-l6-v2](sentence-transformers/all-MiniLM-L6-v2) as a base model.
77
+
78
+
We use 14 classification datasets, using 1000 examples from the train set, and the full test set. No parameters were tuned on any validation set. All datasets were taken from the [Setfit organization on Hugging Face](https://huggingface.co/datasets/SetFit).
As can be seen see, full fine-tuning brings modest performance improvements in some cases, but very large ones in other cases, leading to a pretty large increase in average score. Our advice is to test both if you can use `potion-base-32m`, and to use full fine-tuning if you are starting from another base model.
103
+
104
+
The speed difference between model2vec and setfit is immense, with the full finetune being 35x faster than a setfit based on `all-minilm-l6-v2` on CPU.
To better understand the factors contributing to the performance of Model2Vec, we conducted a comprehensive set of ablation studies, covering various aspects of the model's architecture and preprocessing methods. In these studies, we examined the impact of key elements such as PCA, Zipf weighting, and the use of Sentence Transformers versus regular transformer models. We also compared the performance of input embeddings versus output embeddings, since it would seem plausible that these should also work well. The results are shown in the table below.
0 commit comments