MTEB: The Ultimate Benchmark for Text Embedding Models
Text embedding models are at the forefront of Natural Language Processing (NLP), transforming how we interpret and utilize textual data. To navigate the vast landscape of these models, researchers and practitioners need a robust way to evaluate their performance across various tasks. Enter MTEB, or the Massive Text Embedding Benchmark—an extensive evaluation platform designed to measure the effectiveness of text embedding models across a multitude of tasks and datasets.
Why Text Embeddings Matter
Text embeddings serve as the backbone of many NLP applications by converting text into numerical vectors that encapsulate semantic information. This transformation allows machines to perform complex computations, facilitating tasks like search engine optimization and text classification. For instance, Google employs sophisticated text embeddings to enhance search results, while models like SetFit leverage embeddings for efficient pattern recognition in large datasets. However, the effectiveness of text embeddings heavily relies on the underlying model. MTEB aims to simplify the quest for the best embedding models tailored to various applications.
What is MTEB?
MTEB stands as a comprehensive benchmark featuring 56 datasets across 8 distinct tasks, currently aggregating over 2,000 results on its leaderboard. This extensive collection ensures that users can evaluate models under diverse conditions and datasets.
Multilingual Capabilities
One of the standout features of MTEB is its multilingual support, boasting coverage of up to 112 languages. This diversity allows for the benchmarking of various multilingual models, particularly in tasks such as Bitext Mining and Semantic Textual Similarity (STS), making it a valuable resource for global NLP applications.
Extensible Framework
MTEB is not just a static benchmark; it’s an evolving platform. Contributions for new tasks, datasets, metrics, and leaderboard enhancements are actively encouraged. The GitHub repository serves as a hub for users to submit models or tackle open issues, fostering a collaborative effort to identify the best text embedding models available.
Overview of tasks and datasets in MTEB. Multilingual datasets are marked with a purple shade.
Exploring the Models
The initial benchmarking in MTEB focused on models that claim state-of-the-art performance and those widely recognized in the community. This approach led to a significant representation of transformer models, which dominate the current landscape of text embeddings.
Models by average English MTEB score (y) vs speed (x) vs embedding size (circle size).
Categories of Models
To help users easily navigate their options, models within MTEB are categorized based on three key attributes:
-
Maximum Speed: Models like GloVe are known for their rapid processing times but often lack contextual awareness, resulting in lower average MTEB scores.
-
Balanced Speed and Performance: Models such as
all-mpnet-base-v2andall-MiniLM-L6-v2strike a harmonious balance between speed and performance, making them ideal for many applications. - Maximum Performance: For those seeking top-tier performance, multi-billion parameter models like
ST5-XXL,GTR-XXL, andSGPT-5.8B-msmarcolead the pack. While they deliver exceptional results, they also produce larger embeddings, requiring more storage and computational resources.
Given that model performance can vary significantly based on the specific task and dataset, users are encouraged to explore the leaderboard thoroughly before making a selection.
Benchmarking Your Model
The MTEB library provides an accessible way for users to benchmark any embedding model and contribute its results to the public leaderboard. Here’s a brief guide on how to get started:
Installation
Begin by installing the MTEB library using the following command:
pip install mteb
Running a Benchmark
You can easily benchmark a model against a specific dataset. For example, you might evaluate average_word_embeddings_komninos on the Banking77 dataset with the following Python code:
from mteb import MTEB
from sentence_transformers import SentenceTransformer
model_name = "average_word_embeddings_komninos"
model = SentenceTransformer(model_name)
evaluation = MTEB(tasks=["Banking77Classification"])
results = evaluation.run(model, output_folder=f"results/{model_name}")
This will generate a results file in the specified directory.
Submitting Results
To submit your results to the leaderboard, update the README.md metadata of the model on the Hub. You can automate this process with a script that generates the necessary metadata file:
python mteb_meta.py results/average_word_embeddings_komninos
The script produces a mteb_metadata.md file containing the model’s performance metrics, which can be added to the model’s README on the Hub.
Next Steps
With MTEB, the path to benchmarking your models is clear and straightforward. Dive into the benchmark, experiment with various models, and share your findings. If you have questions or feedback, connect with the community through the GitHub repository or the leaderboard’s discussion forum.
Happy embedding!
Credits
A special thanks to the contributors who made this article and the MTEB codebase possible: Steven Liu, Loïc Magne, Nils Reimers, and Nouamane Tazi.
Inspired by: Source


