• Community
  • Model
  • mxbai-embed-large-v1

mxbai-embed-large-v1

The Mxbai-embed-large-v1 is a state-of-the-art, versatile sentence embedding model trained on a unique dataset for superior performance across a wide range of NLP tasks and is on the top of MTEB Leaderboard

Notes

Introduction

The Mxbai-embed-large-v1 is a state-of-the-art (SOTA) sentence embedding model designed to capture the nuanced semantics of text across a wide range of domains and tasks. Leveraging advanced training techniques and a vast, high-quality dataset, this model sets new benchmarks in the performance of natural language understanding tasks.

Mxbai-embed-large Model

  • Model Name: mxbai-embed-large-v1
  • Training Technique: The model is trained using AnglE loss, a technique that ensures the model learns high-quality, context-rich embeddings.
  • Data Scale: Training was conducted on a large-scale, high-quality dataset comprising over 700 million pairs and fine-tuned on more than 30 million high-quality triplets.
  • Performance Benchmark: Achieves SOTA performance on BERT-large scale, demonstrating its effectiveness in capturing complex text representations.

Run Mxbai-embed-large with an API

Running the API with Clarifai's Python SDK

You can run the Mxbai-embed-large Model API using Clarifai’s Python SDK.

Export your PAT as an environment variable. Then, import and initialize the API Client.

Find your PAT in your security settings.

export CLARIFAI_PAT={your personal access token}
from clarifai.client.model import Model

text = '''In India Green Revolution commenced in the early 1960s that led to an increase in food grain production, especially in Punjab, Haryana, and Uttar Pradesh. Major milestones in this undertaking were the development of high-yielding varieties of wheat. The Green revolution is revolutionary in character due to the introduction of new technology, new ideas, the new application of inputs like HYV seeds, fertilizers, irrigation water, pesticides, etc. As all these were brought suddenly and spread quickly to attain dramatic results thus it is termed as a revolution in green agriculture.
'''

# Model Predict
model_prediction = Model("https://clarifai.com/mixedbread-ai/embed/models/mxbai-embed-large-v1").predict_by_bytes(text.encode(), "text")
# print(model_prediction.outputs[0].data.text.raw)

embeddings = model_prediction.outputs[0].data.embeddings[0].vector

num_dimensions= model_prediction.outputs[0].data.embeddings[0].num_dimensions

You can also run Mxbai-embed-large API using other Clarifai Client Libraries like Java, cURL, NodeJS, PHP, etc here.

For Retrieval 

For retrieval you need to pass your prompt in following format:

prompt = f'Represent this sentence for searching relevant passages: {text}'

from clarifai.client.model import Model

text = '''In India Green Revolution commenced in the early 1960s that led to an increase in food grain production, especially in Punjab, Haryana, and Uttar Pradesh. Major milestones in this undertaking were the development of high-yielding varieties of wheat. The Green revolution is revolutionary in character due to the introduction of new technology, new ideas, the new application of inputs like HYV seeds, fertilizers, irrigation water, pesticides, etc. As all these were brought suddenly and spread quickly to attain dramatic results thus it is termed as a revolution in green agriculture.
'''

prompt = f'Represent this sentence for searching relevant passages: {text}'

# Model Predict
model_prediction = Model("https://clarifai.com/mixedbread-ai/embed/models/mxbai-embed-large-v1").predict_by_bytes(prompt.encode(), "text")

embeddings = model_prediction.outputs[0].data.embeddings[0].vector

num_dimensions= model_prediction.outputs[0].data.embeddings[0].num_dimensions

Use Cases

The Mxbai-embed-large model is versatile, supporting a wide range of applications including, but not limited to:

  • Text classification
  • RAG
  • Semantic textual similarity (STS)
  • Information Retrieval
  • Content summarization
  • Document clustering Its robust performance across various domains and tasks makes it an ideal choice for both academic research and commercial NLP applications.

Evaluation

The model has undergone comprehensive evaluation, particularly on the Multilingual Text Embedding Benchmark (MTEB), showcasing exceptional performance:

MTEB evaluates models on seven tasks across 56 datasets. The mxbai-embed-large-v1 model demonstrates superior performance, especially in classification, pair classification, and semantic textual similarity (STS) tasks.

  • Overall Ranking: Ranked first among embedding models of similar size.
  • Comparative Performance: Outperforms OpenAI's text-embedding-3-large model and matches the performance of models 20 times its size, such as echo-mistral-7b.
  • Generalization: Demonstrates strong generalization across tasks and domains, attributed to the rigorous dataset selection and training process.

Below is the evaluation results table formatted for clarity, showing the performance of the Mxbai-embed-large-v1 model compared to other notable models across various tasks measured in the Multilingual Text Embedding Benchmark (MTEB):

ModelAvg (56 datasets)Classification (12 datasets)Clustering (11 datasets)Pair Classification (3 datasets)Re-ranking (4 datasets)Retrieval (15 datasets)STS (10 datasets)Summarization (1 dataset)
mxbai-embed-large-v164.6875.6446.7187.260.1154.3985.0032.71
bge-large-en-v1.564.2375.9746.0887.1260.0354.2983.1131.61
mxbai-embed-2d-large-v163.2574.1446.0785.8958.9451.4284.931.55
nomic-embed-text-v162.3974.1243.9185.1555.6952.8182.0630.08
jina-embeddings-v2-base-en60.3873.4541.7385.3856.9847.8780.731.6
OpenAI text-embedding-3-large64.5875.4549.0185.7259.1655.4481.7329.92
Cohere embed-english-v3.064.4776.4947.4385.8458.0155.0082.6230.18
OpenAI text-embedding-ada-00260.9970.9345.9084.8956.3249.2580.9730.80

Dataset

The model benefits from a carefully curated training dataset, constructed by:

  • Scraping a large portion of the internet.
  • Cleaning the data to ensure high quality.
  • Ensuring zero overlap with MTEB test sets or any potential test candidates, maintaining the integrity of the evaluation process. This extensive and meticulously prepared dataset underpins the model's SOTA performance and broad applicability.

Advantages

  • High Performance: Achieves benchmark-setting performance on a wide range of NLP tasks.
  • Generalization Capability: Performs well across different domains and text lengths, indicative of its robust training and dataset diversity.
  • Ethical Training Practices: Avoids any overlap with MTEB test sets or training on potential test candidates, ensuring a fair and genuine evaluation of its capabilities.

Limitations

  • Despite its robust performance, the model has some limitations that will be addressed in version 2.
  • ID
  • Name
    mxbai-embed-large-v1
  • Model Type ID
    Text Embedder
  • Description
    The Mxbai-embed-large-v1 is a state-of-the-art, versatile sentence embedding model trained on a unique dataset for superior performance across a wide range of NLP tasks and is on the top of MTEB Leaderboard
  • Last Updated
    Mar 13, 2024
  • Privacy
    PUBLIC
  • Use Case
  • License
  • Share
    • Badge
      mxbai-embed-large-v1