Instructions to use amgix/static-retrieval-multilingual-69m-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Model2Vec
How to use amgix/static-retrieval-multilingual-69m-v1 with Model2Vec:
from model2vec import StaticModel model = StaticModel.from_pretrained("amgix/static-retrieval-multilingual-69m-v1") - sentence-transformers
How to use amgix/static-retrieval-multilingual-69m-v1 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("amgix/static-retrieval-multilingual-69m-v1") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
static-retrieval-multilingual-69m-v1
This Model2Vec model is a distilled version of ibm-granite/granite-embedding-97m-multilingual-r2 trained for multilingual retrieval tasks. It uses static embeddings, allowing text embeddings to be computed orders of magnitude faster on both GPU and CPU. It is designed for applications where computational resources are limited or where real-time performance is critical.
Preliminary Metrics
Numbers for base model and popular static models are presented for context.
Model Info
| model | vocab x dims | params | Size on Disk |
|---|---|---|---|
| ibm-granite/granite-embedding-97m-multilingual-r2 | 179,936 x 384 | 97M | 211M |
| potion-retrieval-32M | 63,091 x 512 | 32.3M | 125M |
| potion-multilingual-128M | 500,353 x 256 | 128.1M | 1003M |
| static-similarity-mrl-multilingual-v1 | 105,879 x 1024 | 108.4M | 417M |
| static-retrieval-multilingual-69m-v1 | 179,936 x 384 | 69.1M | 274M |
Embedding Performance
This is measured on a small test: 5000 texts, 354 chars/doc, 34 chars/query, 4 CPU cores, best of 10 runs.
| model | docs/s | queries/s |
|---|---|---|
| granite-embedding-97m-multilingual-r2 | 7 | 69 |
| potion-retrieval-32M | 8431 | 39632 |
| potion-multilingual-128M | 5148 | 37727 |
| static-similarity-mrl-multilingual-v1 | 7924 | 37731 |
| static-retrieval-multilingual-69m-v1 | 8974 | 44456 |
NanoBEIR Multilingual Results
The scores below are averages per language by model. The best value among static models is highlighted.
NOTE: When looking at the scores below it's important to keep in mind that potion-retrieval-32M is an English model and two multilingual static models (potion-multilingual-128M and static-similarity-mrl-multilingual-v1) were not trained for retrieval.
| Language | granite-embedding-97m-multilingual-r2 | potion-retrieval-32M | potion-multilingual-128M | static-similarity-mrl-multilingual-v1 | static-retrieval-multilingual-69m-v1 |
|---|---|---|---|---|---|
| ara-Arab | 0.4589 | 0.0988 | 0.2692 | 0.2860 | 0.3458 |
| deu-Latn | 0.5338 | 0.2537 | 0.3273 | 0.3454 | 0.4054 |
| eng-Latn | 0.5881 | 0.5107 | 0.3696 | 0.4352 | 0.4700 |
| fra-Latn | 0.5318 | 0.2828 | 0.3472 | 0.3702 | 0.4102 |
| ita-Latn | 0.5176 | 0.2752 | 0.3401 | 0.3683 | 0.3837 |
| jpn-Jpan | 0.4956 | 0.1142 | 0.3016 | 0.3190 | 0.3597 |
| kor-Kore | 0.4927 | 0.1171 | 0.3046 | 0.2763 | 0.3023 |
| nor-Latn | 0.4827 | 0.2532 | 0.3190 | 0.3314 | 0.3059 |
| por-Latn | 0.5193 | 0.2682 | 0.3364 | 0.3743 | 0.3992 |
| spa-Latn | 0.5295 | 0.2542 | 0.3369 | 0.3754 | 0.4145 |
| swe-Latn | 0.4991 | 0.2674 | 0.3154 | 0.3408 | 0.3208 |
| Average | 0.5136 | 0.2450 | 0.3243 | 0.3475 | 0.3743 |
RTEB
The best value in each test is highlighted.
| Test | Language | potion-retrieval-32M | potion-multilingual-128M | static-similarity-mrl-multilingual-v1 | static-retrieval-multilingual-69m-v1 |
|---|---|---|---|---|---|
| AILACasedocs | eng-Latn | 0.2157 | 0.2037 | 0.2202 | 0.2231 |
| AILAStatutes | eng-Latn | 0.1901 | 0.1598 | 0.1663 | 0.2100 |
| AppsRetrieval | eng-Latn, python-Code | 0.0431 | 0.0366 | 0.0127 | 0.0321 |
| ChatDoctorRetrieval | eng-Latn | 0.2470 | 0.1362 | 0.1535 | 0.2443 |
| CUREv1 | eng-Latn, eng-Latn | 0.3019 | 0.2152 | 0.2548 | 0.2984 |
| fra-Latn, eng-Latn | 0.0639 | 0.1325 | 0.1716 | 0.1694 | |
| spa-Latn, eng-Latn | 0.0276 | 0.1359 | 0.1615 | 0.1678 | |
| DS1000Retrieval | eng-Latn, python-Code | 0.2330 | 0.2037 | 0.2083 | 0.1595 |
| FinanceBenchRetrieval | eng-Latn | 0.3571 | 0.2626 | 0.2829 | 0.2580 |
| FinQARetrieval | eng-Latn | 0.4905 | 0.4395 | 0.4096 | 0.4067 |
| FreshStackRetrieval | eng-Latn, python-Code, javascript-Code, go-Code | 0.2005 | 0.1725 | 0.1654 | 0.1773 |
| HC3FinanceRetrieval | eng-Latn | 0.2701 | 0.1952 | 0.2025 | 0.3653 |
| HumanEvalRetrieval | eng-Latn, python-Code | 0.4271 | 0.3738 | 0.3461 | 0.3398 |
| LegalQuAD | deu-Latn | 0.3917 | 0.4326 | 0.4110 | 0.3707 |
| LegalSummarization | eng-Latn | 0.5473 | 0.5286 | 0.5496 | 0.5378 |
| MBPPRetrieval | eng-Latn, python-Code | 0.2585 | 0.2464 | 0.2624 | 0.2156 |
| MIRACLRetrievalHardNegatives | ara-Arab | 0.0413 | 0.1657 | 0.1971 | 0.3515 |
| ben-Beng | 0.0168 | 0.2388 | 0.2118 | 0.4738 | |
| deu-Latn | 0.1051 | 0.1268 | 0.1594 | 0.2459 | |
| eng-Latn | 0.2658 | 0.1391 | 0.1874 | 0.2446 | |
| fas-Arab | 0.0259 | 0.1464 | 0.1642 | 0.2909 | |
| fin-Latn | 0.2243 | 0.1501 | 0.2627 | 0.4206 | |
| fra-Latn | 0.0936 | 0.2027 | 0.1492 | 0.2307 | |
| hin-Deva | 0.0281 | 0.1773 | 0.1710 | 0.3357 | |
| ind-Latn | 0.1317 | 0.2174 | 0.1871 | 0.3355 | |
| jpn-Jpan | 0.0501 | 0.1261 | 0.1790 | 0.2826 | |
| kor-Kore | 0.0898 | 0.1178 | 0.2405 | 0.3905 | |
| rus-Cyrl | 0.0246 | 0.2299 | 0.1681 | 0.2592 | |
| spa-Latn | 0.1317 | 0.1838 | 0.2110 | 0.2701 | |
| swa-Latn | 0.1740 | 0.1478 | 0.2319 | 0.5065 | |
| tel-Telu | 0.0004 | 0.2628 | 0.1098 | 0.4842 | |
| tha-Thai | 0.0083 | 0.2577 | 0.0149 | 0.4425 | |
| yor-Latn | 0.2811 | 0.2853 | 0.3673 | 0.3509 | |
| zho-Hans | 0.0290 | 0.1742 | 0.1790 | 0.2497 | |
| SWEbenchCodeRetrieval | eng-Latn, python-Code | 0.0288 | 0.0243 | 0.0255 | 0.0227 |
| WikiSQLRetrieval | eng-Latn, sql-Code | 0.3465 | 0.1759 | 0.1512 | 0.1834 |
| Average | 0.1560 | 0.1858 | 0.2034 | 0.2561 |
Training
| Stage | Details |
|---|---|
| Base model | ibm-granite/granite-embedding-97m-multilingual-r2 |
| Pre-Training | C4. 101 languages: 'af', 'am', 'ar', 'az', 'be', 'bg', 'bg-Latn', 'bn', 'ca', 'ceb', 'co', 'cs', 'cy', 'da', 'de', 'el', 'el-Latn', 'en', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fil', 'fr', 'fy', 'ga', 'gd', 'gl', 'gu', 'ha', 'haw', 'hi', 'hi-Latn', 'hmn', 'ht', 'hu', 'hy', 'id', 'ig', 'is', 'it', 'iw', 'ja', 'ja-Latn', 'jv', 'ka', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo', 'lt', 'lv', 'mg', 'mi', 'mk', 'ml', 'mn', 'mr', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pl', 'ps', 'pt', 'ro', 'ru', 'ru-Latn', 'sd', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sq', 'sr', 'st', 'su', 'sv', 'sw', 'ta', 'te', 'tg', 'th', 'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'yo', 'zh', 'zh-Latn', 'zu' |
| Fine-Tuning | mMARCO ("arabic", "chinese", "dutch", "english", "french", "german", "hindi", "indonesian", "italian", "japanese", "portuguese", "russian", "spanish", "vietnamese"), GooAQ, S2ORC, Free-Law-Project/opinions-synthetic-query-512, FIQA, MIRACL ('ar', 'bn', 'en', 'es', 'fa', 'fi', 'fr', 'hi', 'id', 'ja', 'ko', 'ru', 'sw', 'te', 'th', 'zh') |
Installation
Install model2vec using pip:
pip install model2vec
Usage
Using Model2Vec
The Model2Vec library is the fastest and most lightweight way to run Model2Vec models.
Load this model using the from_pretrained method:
from model2vec import StaticModel
# Load a pretrained Model2Vec model
model = StaticModel.from_pretrained("amgix/static-retrieval-multilingual-69m-v1")
# Compute text embeddings
embeddings = model.encode(["Example sentence"])
Using Sentence Transformers
You can also use the Sentence Transformers library to load and use the model:
from sentence_transformers import SentenceTransformer
# Load a pretrained Sentence Transformer model
model = SentenceTransformer("amgix/static-retrieval-multilingual-69m-v1")
# Compute text embeddings
embeddings = model.encode(["Example sentence"])
Additional Resources
- Downloads last month
- 45