Model reference · open weights
bge-m3-unsupervised is an open-weight embedding model from BAAI. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | BAAI |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Parameters (lead) | 568M |
| Context | 8194 tokens |
| Runs with | sentence-transformers |
| Released | 2024-01-28 |
| Popularity | 895 downloads / month |
| Licence | Open weights |
About
For more details please refer to our github repo: https://github.com/FlagOpen/FlagEmbedding
In this project, we introduce BGE-M3, which is distinguished for its versatility in Multi-Functionality, Multi-Linguality, and Multi-Granularity.
Some suggestions for retrieval pipeline in RAG: We recommend to use following pipeline: hybrid retrieval + re-ranking.
| Model Name | Dimension | Sequence Length | Introduction |
|---|---|---|---|
| BAAI/bge-m3 | 1024 | 8192 | multilingual; unified fine-tuning (dense, sparse, and colbert) from bge-m3-unsupervised |
| BAAI/bge-m3-unsupervised | 1024 | 8192 | multilingual; contrastive learning from bge-m3-retromae |
| BAAI/bge-m3-retromae | -- | 8192 | multilingual; extend the max_length of xlm-roberta to 8192 and further pretrained via retromae |
| BAAI/bge-large-en-v1.5 | 1024 | 512 | English model |
| BAAI/bge-base-en-v1.5 | 768 | 512 | English model |
| BAAI/bge-small-en-v1.5 | 384 | 512 | English model |
| Dataset | Introduction |
|---|---|
| MLDR | Docuemtn Retrieval Dataset, covering 13 languages |
1. Introduction for different retrieval methods
2. Comparison with BGE-v1.5 and other monolingual models
BGE-M3 is a multilingual model, and its ability in monolingual embedding retrieval may not surpass models specifically designed for single languages. However, we still recommend trying BGE-M3 because of its versatility (support for multiple languages and long texts). Moreover, it can simultaneously generate multiple representations, and using them together can enhance accuracy and generalization, unlike most existing models that can only perform dense retrieval.
In the open-source community, there are many excellent models (e.g., jina-embedding, colbert, e5, etc), and users can choose a model that suits their specific needs based on practical considerations, such as whether to require multilingual or cross-language support, and whether to process long texts.
3. How to use BGE-M3 in other projects?
For embedding retrieval, you can employ the BGE-M3 model using the same approach as BGE. The only difference is that the BGE-M3 model no longer requires adding instructions to the queries. For sparse retrieval methods, most open-source libraries currently do not support direct utilization of the BGE-M3 model. Contributions from the community are welcome.
In our experiments, we use Pyserini and Faiss to do hybrid retrieval. Now you can ou can try the hybrid mode of BGE-M3 in Vespa. Thanks @jobergum.
4. How to fine-tune bge-M3 model?
You can follow the common in this example to fine-tune the dense embedding.
Our code and data for unified fine-tuning (dense, sparse, and multi-vectors) will be released.
Install:
git clone https://github.com/FlagOpen/FlagEmbedding.git
cd FlagEmbedding
pip install -e .
or:
pip install -U FlagEmbedding
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys bge-m3-unsupervised for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (bge-m3-unsupervised 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":"bge-m3-unsupervised","input":"text to embed"}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.