Model reference · open weights
e5-small is an open-weight embedding model from intfloat, listed in the AxForge catalogue. AxForge can bring it up on EU-owned hardware for you on request — with the licence handled where one is required.
About
E5-small-v2 Text Embeddings by Weakly-Supervised Contrastive Pre-training. Liang Wang, Nan Yang, Xiaolong Huang, Binxing Jiao, Linjun Yang, Daxin Jiang, Rangan Majumder, Furu Wei, arXiv 2022 This model has 12 layers and the embedding size is 384. Usage Below is an example to encode queries and passages from the MS-MARCO passage ranking dataset. Training Details Please refer to our paper at https://arxiv.org/pdf/2212.03533.pdf. Benchmark Evaluation Check out unilm/e5 to reproduce evaluation results on the BEIR and MTEB benchmark. Support for Sentence Transformers Below is an example for usage with sentencetransformers. Package requirements pip install sentencetransformers~=2.2.2 Contributors: michaelfeil FAQ 1. Do I need to add the prefix "query: " and "passage: " to input texts? Yes, this is how the model is trained, otherwise you will see a performance degradation. Here are some rules of thumb: - Use "query: " and "passage: " correspondingly for asymmetric tasks such as passage retrieval in open QA, ad-hoc information retrieval. - Use "query: " prefix for symmetric tasks such as semantic similarity, paraphrase retrieval. - Use "query: " prefix if you want to use embeddings as features, such as linear probing classification, clustering. 2. Why are my reproduced results slightly different from reported in the model card? Different versions of transformers and pytorch could cause negligible but non-zero performance differences. 3. Why does the cosine similarity scores distribute around 0.7 to 1.0? This is a known and expected behavior as we use a low temperature 0.01 for InfoNCE contrastive loss. For text embedding tasks like text retrieval or semantic similarity, what matters is the relative order of the scores instead of the absolute values, so this should not be an issue. Citation If you find our paper or models helpful, please consider cite as follows: Limitations This model only works for English texts. Long texts will be truncated to at most 512 tokens.
Summarised from the published model card. Read the full card on the HuggingFace links below.
Specifications
| Maker | intfloat |
|---|---|
| Type | Embedding models |
| Parameters (lead) | 33M |
| Context | 512 tokens |
| Variants | 1 |
| Runs with | sentence-transformers |
| Released | 2023-05-19 |
| Popularity | 666k downloads / month |
| Likes | 122 |
| Licence | Open weights |
How it works
Variants
Open weights ship in several sizes and precisions. One page, all the variants — pick the one that fits your GPU. VRAM figures are estimates from model size.
| Variant | Params | Precision | VRAM | Fits 16 GB | Weights |
|---|---|---|---|---|---|
| e5-small-v2 | 33M | BF16 | ~0.1 GB | ✓ | Weights ↗ |
Benchmarks
As published on the model card — the maker's own numbers, not measured by AxForge.
| Task | Dataset | Metric | Score |
|---|---|---|---|
| Classification | MTEB AmazonCounterfactualClassification (en) | accuracy | 77.597 |
| Classification | MTEB AmazonCounterfactualClassification (en) | ap | 41.671 |
| Classification | MTEB AmazonCounterfactualClassification (en) | f1 | 71.865 |
| Classification | MTEB AmazonPolarityClassification | accuracy | 91.266 |
| Classification | MTEB AmazonPolarityClassification | ap | 87.676 |
| Classification | MTEB AmazonPolarityClassification | f1 | 91.243 |
| Classification | MTEB AmazonReviewsClassification (en) | accuracy | 45.882 |
| Classification | MTEB AmazonReviewsClassification (en) | f1 | 45.081 |
| Retrieval | MTEB ArguAna | map_at_1 | 20.697 |
| Retrieval | MTEB ArguAna | map_at_10 | 33.975 |
| Retrieval | MTEB ArguAna | map_at_100 | 35.223 |
| Retrieval | MTEB ArguAna | map_at_1000 | 35.26 |
| Retrieval | MTEB ArguAna | map_at_3 | 29.777 |
| Retrieval | MTEB ArguAna | map_at_5 | 32.035 |
| Retrieval | MTEB ArguAna | mrr_at_1 | 20.982 |
| Retrieval | MTEB ArguAna | mrr_at_10 | 34.094 |
| Retrieval | MTEB ArguAna | mrr_at_100 | 35.343 |
| Retrieval | MTEB ArguAna | mrr_at_1000 | 35.38 |
| Retrieval | MTEB ArguAna | mrr_at_3 | 29.884 |
| Retrieval | MTEB ArguAna | mrr_at_5 | 32.142 |
| Retrieval | MTEB ArguAna | ndcg_at_1 | 20.697 |
| Retrieval | MTEB ArguAna | ndcg_at_10 | 41.668 |
| Retrieval | MTEB ArguAna | ndcg_at_100 | 47.397 |
| Retrieval | MTEB ArguAna | ndcg_at_1000 | 48.305 |
Using it via the API
Once AxForge deploys e5-small for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (e5-small below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/embeddings \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"e5-small","input":"text to embed"}'
Details
Languages
Tags
Papers
Licence
Open weights under mit — commercial use is permitted. Deploy it on AxForge EU hardware on request. Read the licence ↗
Explore