AI SeedbankHelp preserve open and free AI for humanity's future

← All models

MongoDB_mdbr-leaf-ir

MongoDB · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: 2 · Leechers: 0

Observed 2026-09-05T20:48:33Z across trackers.

Model card

The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.


license: apache-2.0
base_model: microsoft/MiniLM-L6-v2
tags:

  • transformers
  • sentence-transformers
  • sentence-similarity
  • text-embeddings-inference
  • information-retrieval
  • knowledge-distillation
  • transformers.js language:
  • en

MongoDB/mdbr-leaf-ir

Content

  1. Introduction
  2. Technical Report
  3. Highlights
  4. Benchmarks
  5. Quickstart
  6. Citation

Introduction

mdbr-leaf-ir is a compact high-performance text embedding model specifically designed for information retrieval (IR) tasks, e.g., the retrieval stage of Retrieval-Augmented Generation (RAG) pipelines.

To enable even greater efficiency, mdbr-leaf-ir supports flexible asymmetric architectures and is robust to vector quantization and MRL truncation.

If you are looking to perform other tasks such as classification, clustering, semantic sentence similarity, summarization, please check out our mdbr-leaf-mt model.

[!Note]
Note: this model has been developed by the ML team of MongoDB Research. At the time of writing it is not used in any of MongoDB's commercial product or service offerings.

Technical Report

A technical report detailing our proposed LEAF training procedure is available here.

Highlights

  • State-of-the-Art Performance: mdbr-leaf-ir achieves state-of-the-art results for compact embedding models, ranking #1 on the public BEIR benchmark leaderboard for models with ≤100M parameters.
  • Flexible Architecture Support: mdbr-leaf-ir supports asymmetric retrieval architectures enabling even greater retrieval results. See below for more information.
  • MRL and Quantization Support: embedding vectors generated by mdbr-leaf-ir compress well when truncated (MRL) and can be stored using more efficient types like int8 and binary. See below for more information.

Benchmark Comparison

The table below shows the average BEIR benchmark scores (nDCG@10) for mdbr-leaf-ir compared to other retrieval models.

mdbr-leaf-ir ranks #1 on the BEIR public leaderboard, and when run in asymmetric "(asym.)" mode as described here, the results improve even further.

Model Size BEIR Avg. (nDCG@10)
OpenAI text-embedding-3-large Unknown 55.43
mdbr-leaf-ir (asym.) 23M 54.03
mdbr-leaf-ir 23M 53.55
snowflake-arctic-embed-s 32M 51.98
bge-small-en-v1.5 33M 51.65
OpenAI text-embedding-3-small Unknown 51.08
granite-embedding-small-english-r2 47M 50.87
snowflake-arctic-embed-xs 23M 50.15
e5-small-v2 33M 49.04
SPLADE++ 110M 48.88
MiniLM-L6-v2 23M 41.95
BM25 – 41.14

Quickstart

Sentence Transformers

from sentence_transformers import SentenceTransformer  
  
# Load the model  
model = SentenceTransformer("MongoDB/mdbr-leaf-ir")  
  
# Example queries and documents  
queries = [
    "What is machine learning?",  
    "How does neural network training work?"  
]  
  
documents = [  
    "Machine learning is a subset of artificial intelligence that focuses on algorithms that can learn from data.",  
    "Neural networks are trained through backpropagation, adjusting weights to minimize prediction errors."  
]  
  
# Encode queries and documents  
query_embeddings = model.encode(queries, prompt_name="query")  
document_embeddings = model.encode(documents)  
  
# Compute similarity scores  
scores = model.similarity(query_embeddings, document_embeddings)  

# Print results
for i, query in enumerate(queries):
    print(f"Query: {query}")
    for j, doc in enumerate(documents):
        print(f" Similarity: {scores[i, j]:.4f} | Document {j}: {doc[:80]}...")

See example output

Query: What is machine learning?
 Similarity: 0.6857 | Document 0: Machine learning is a subset of ...
 Similarity: 0.4598 | Document 1: Neural networks are trained ...

Query: How does neural network training work?
 Similarity: 0.4238 | Document 0: Machine learning is a subset of ...
 Similarity: 0.5723 | Document 1: Neural networks are trained ...

Transformers.js

If you haven't already, you can install the Transformers.js JavaScript library from NPM using:

npm i @huggingface/transformers

You can then use the model to compute embeddings like this:

import { AutoModel, AutoTokenizer, matmul } from "@huggingface/transformers";

// Download from the 🤗 Hub
const model_id = "MongoDB/mdbr-leaf-ir";
const tokenizer = await AutoTokenizer.from_pretrained(model_id);
const model = await AutoModel.from_pretrained(model_id, {
    dtype: "fp32", // Options: "fp32" | "fp16" | "q8" | "q4" | "q4f16"
});

// Prepare queries and documents
const queries = [
    "What is machine learning?",
    "How does neural network training work?",
];
const documents = [  
    "Machine learning is a subset of artificial intelligence that focuses on algorithms that can learn from data.",
    "Neural networks are trained through backpropagation, adjusting weights to minimize prediction errors.",
];
const inputs = await tokenizer([
    ...queries.map((x) => "Represent this sentence for searching relevant passages: " + x),
    ...documents,
], { padding: true });

// Generate embeddings
const { sentence_embedding } = await model(inputs);

// Compute similarities
const scores = await matmul(
    sentence_embedding.slice([0, queries.length]),
    sentence_embedding.slice([queries.length, null]).transpose(1, 0),
);
const scores_list = scores.tolist();

for (let i = 0; i < queries.length; ++i) {
    console.log(`Query: ${queries[i]}`);
    for (let j = 0; j < documents.length; ++j) {
        console.log(` Similarity: ${scores_list[i][j].toFixed(4)} | Document ${j}: ${documents[j]}`);
    }
    console.log();
}

See example output

Query: What is machine learning?
 Similarity: 0.6857 | Document 0: Machine learning is a subset of artificial intelligence that focuses on algorithms that can learn from data.
 Similarity: 0.4598 | Document 1: Neural networks are trained through backpropagation, adjusting weights to minimize prediction errors.

Query: How does neural network training work?
 Similarity: 0.4238 | Document 0: Machine learning is a subset of artificial intelligence that focuses on algorithms that can learn from data.
 Similarity: 0.5723 | Document 1: Neural networks are trained through backpropagation, adjusting weights to minimize prediction errors.

Transformers Usage

See full example notebook here.

Asymmetric Retrieval Setup

[!Note]
Note: a version of this asymmetric setup, conveniently packaged into a single model, is available here.

mdbr-leaf-ir is aligned to snowflake-arctic-embed-m-v1.5, the model it has been distilled from. This enables flexible architectures in which, for example, documents are encoded using the larger model, while queries can be encoded faster and more efficiently with the compact leaf model:

# Use mdbr-leaf-ir for query encoding (real-time, low latency)  
query_model = SentenceTransformer("MongoDB/mdbr-leaf-ir")  
query_embeddings = query_model.encode(queries, prompt_name="query")  

# Use a larger model for document encoding (one-time, at index time)  
doc_model = SentenceTransformer("Snowflake/snowflake-arctic-embed-m-v1.5")  
document_embeddings = doc_model.encode(documents)  

# Compute similarities  
scores = query_model.similarity(query_embeddings, document_embeddings)  

Retrieval results in asymmetric mode are often superior to the standard mode above.

MRL Truncation

Embeddings have been trained via MRL and can be truncated for more efficient storage:

query_embeds = model.encode(queries, prompt_name="query", truncate_dim=256)
doc_embeds = model.encode(documents, truncate_dim=256)

similarities = model.similarity(query_embeds, doc_embeds)

print('After MRL:')
print(f"* Embeddings dimension: {query_embeds.shape[1]}")
print(f"* Similarities: \n\t{similarities}")

See example output

After MRL:
* Embeddings dimension: 256
* Similarities:
  tensor([[0.7136, 0.4989],
          [0.4567, 0.6022]])

Vector Quantization

Vector quantization, for example to int8 or binary, can be performed as follows:

Note: For vector quantization to types other than binary, we suggest performing a calibration to determine the optimal ranges, see here. Good initial values, according to the teacher model's documentation, are:

  • int8: -0.3 and +0.3
  • int4: -0.18 and +0.18
from sentence_transformers.quantization import quantize_embeddings
import torch

query_embeds = model.encode(queries, prompt_name="query")
doc_embeds = model.encode(documents)

# Quantize embeddings to int8 using -0.3 and +0.3 as calibration ranges
ranges = torch.tensor([[-0.3], [+0.3]]).expand(2, query_embeds.shape[1]).cpu().numpy()
query_embeds = quantize_embeddings(query_embeds, "int8", ranges=ranges)
doc_embeds = quantize_embeddings(doc_embeds, "int8", ranges=ranges)

# Calculate similarities; cast to int64 to avoid under/overflow
similarities = query_embeds.astype(int) @ doc_embeds.astype(int).T

print('After quantization:')
print(f"* Embeddings type: {query_embeds.dtype}")
print(f"* Similarities: \n{similarities}")

See example output

After quantization:
* Embeddings type: int8
* Similarities:
   [[118022  79111]
    [ 72961  98333]]

Evaluation

Please see here.

Citation

If you use this model in your work, please cite:

@inproceedings{vujanic-ruckstiess-2026-leaf,
    title = "{LEAF}: Knowledge Distillation of Text Embedding Models with Teacher-Aligned Representations",
    author = {Vujanic, Robin  and
      R{\"u}ckstie{\ss}, Thomas},
    editor = "Liakata, Maria  and
      Moreira, Viviane P.  and
      Zhang, Jiajun  and
      Jurgens, David",
    booktitle = "Proceedings of the 64th Annual Meeting of the {A}ssociation for {C}omputational {L}inguistics (Volume 1: Long Papers)",
    month = jul,
    year = "2026",
    address = "San Diego, California, United States",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2026.acl-long.2008/",
    doi = "10.18653/v1/2026.acl-long.2008",
    pages = "43362--43383",
    ISBN = "979-8-89176-390-6",
    abstract = "We present a knowledge distillation framework for text embedding models. A key distinguishing feature is that our distilled models are compatible with their teacher, enabling flexible asymmetric architectures where documents are encoded with the larger teacher model, while queries use smaller student models. We also show that our models automatically inherit MRL and robustness to output quantization whenever these properties are present in the teacher model, without explicitly training for them. To demonstrate the effectiveness of our framework we publish leaf-ir, a 23M parameters information retrieval oriented model that, besides being teacher-compatibile, sets a new state-of-the-art (SOTA) on BEIR, ranking no.1 on the public leaderboard for models of its size. Asymmetric mode further increases its retrieval performance. Our scheme is however not restricted to information retrieval. We demonstrate its wider applicability by synthesizing the multi-task leaf-mt model. This also sets a new SOTA, achieving no.1 on the public MTEB v2 (English) leaderboard for models of its size. Our technique is applicable to black-box models, requires no judgments nor hard negatives, and training can be conducted using small batch sizes. Thus, dataset and training infrastructure requirements for our framework are modest. We make our models publicly available under a permissive Apache 2.0 license."
}

License

This model is released under Apache 2.0 License.

Contact

For questions or issues, please open an issue or pull request. You can also contact the MongoDB ML research team at robin.vujanic@mongodb.com.

Magnet link

Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:

magnet:?xt=urn:btih:1aec435976e1d5ca56d3a3f900824f5b071bfbc2&dn=MongoDB_mdbr-leaf-ir

Open magnet in torrent client · infohash 1aec435976e1d5ca56d3a3f900824f5b071bfbc2

Files & hashes

PathSizesha1sha256
1_Pooling/config.json321 B (321 B)cca9464763ad6c4a9b6c9a5ea7d292efe136d8f5b4105bf48c5257a542a7e1968cef220b3ecd49ae24943143279650c4ac6e30a0
2_Dense/config.json137 B (137 B)3c97bbb2bd4353c0b93b48f9ca6332a799e4a9e595727b5a377737b5df1b579e28d716d1587201ce2130e41820fca7142feddde7
2_Dense/model.safetensors1.1 MB (1,182,880 B)2ee459dd0b5cf33154bb3986ad5bfb918c17b29db3e7c0e1ef65e39a5ef1ca3bc5e4aef5feafb6e204bd161503145ed062f12c69
README.md14.0 KB (14,292 B)ec153459f8eeb4496fbb1032ceaa8a5be1bcca06c96977f87a734d0d784c6959b56d297f62a8bfda9bc35d0ec086081ad990a6e8
config.json829 B (829 B)08afa2c540f4a754231326cfb298a9216ae4dfe1258407cfa27c7e1e502a9c312abebb4f5241bf226972ffc366287f370a3567f1
config_sentence_transformers.json353 B (353 B)b867a6e164512addc6670c7e7684085788d9b9694767e73872580e50fbcf120e6943c57a85a7813373850c9a0a5a290de4869601
evaluate_models.ipynb7.6 KB (7,755 B)e53a021de2f17362be6480743093c8348d16b515115b8bff079286a1eeb78f479b4f44faa36889173d274566cb2053638fdc5b71
logo.png9.7 KB (9,978 B)59deace0faee8a80678417f71310515722cc0de5e9a3d03b4277a6813156f674227e005775cff71c3d29ec829944f174d2cccc99
logo.webp1.8 KB (1,854 B)3693e8fc0edce8699b71d340fef530b6911b90cbd8ed16cf9e283bb01e175c9b29b478966826639326f4ddbad19eabcb6925551f
model.safetensors86.1 MB (90,272,656 B)d4dd839f369496d1c880c30a9c7ab442aa40c5c282691b5531ec8323546aa2246f8a5de073aff3bd0d7d98bec0619d2e51ee1297
modules.json486 B (486 B)a9df0f9bca2e72d534132861cdf172f3a9fa2028d4070d228122cd19504a2aa4313025c3834d842179be486d3176aaf57659c94a
onnx/model.onnx_data87.2 MB (91,444,224 B)049cce414c84b68aad8ef06ee6e55ec306c3e5b6c509bc3c7759c3d851cf610b02b47908e5456f334c19743fa74b1a4cee8fdc27
onnx/model_fp16.onnx_data43.6 MB (45,679,104 B)3c5f1e02dc7a0a767ec980378797a703fec0fc0ce90acb605423040c7cf94d085a6bd9747af654e44081979a33e9fd3e57e67a9d
onnx/model_q4.onnx_data52.1 MB (54,617,088 B)126dc7f391283913d955f81145dd01198a609930e241c4b4fb7c48098eba74f5d75677ad4277ea20609a10f7458438d24afc4411
onnx/model_q4f16.onnx_data28.6 MB (29,993,472 B)f346586d1ed4c28f9b3987d0a44868e7fa4ad2b19384675f2a40458a229027dba764dce46a6ceb90e31e0090da25be52cfc7d8c7
onnx/model_quantized.onnx_data21.9 MB (22,954,752 B)32ccd2f907b380cea15bfb2fb3c7f811c1ee914be77ea96a124230e23e5bac8e26c3ffe5410154973d8635673fa0220b06c13f8b
sentence_bert_config.json113 B (113 B)3f4fa21deb1f6418808c9d4ae034a6fc386b20a4e43e87f7bb01356c2f6d6c7ee7bfa43b384e99c57475a6c92faaf3f6977f38d2
special_tokens_map.json732 B (732 B)ba5e3e474dd99473e6fd1bec11f3c34d406c67605aa43c2f985a25296d5a5ce621c2f77376ca8091a47993c492fd5460b895b140
tokenizer.json695.0 KB (711,661 B)c17ed520ed8438736732a54957a69306b8822215da0e79933b9ed51798a3ae27893d3c5fa4a201126cef75586296df9b4d2c62a0
tokenizer_config.json1.5 KB (1,529 B)92eb83d68f9462fe824a6d02d7db1c7b9fb6a5f146ac231e9b955a8af80fc7f23a0ecc65b524f1df84a02c2c82cbca354fb207b4
transformers_example.ipynb4.3 KB (4,392 B)f205f5f276bd62dc816d6b906d76ab44f407c7df0255d68c0404d67c32bb550070f55b694dee885f190e4a1128ee6478fe19aeb7
vocab.txt226.1 KB (231,508 B)fb140275c155a9c7c5a3b3e0e77a9e839594a93807eced375cec144d27c900241f3e339478dec958f92fddbc551f295c992038a3

Cite this release

Canonical URL
https://aiseedbank.org/models/MongoDB_mdbr-leaf-ir/
Slug
MongoDB_mdbr-leaf-ir
Infohash
1aec435976e1d5ca56d3a3f900824f5b071bfbc2
License
apache-2.0
Signing key fingerprint
85a3b32c3712427b

Every file carries a locally computed sha256 — verify a download against the signed sums: MongoDB_mdbr-leaf-ir.SHA256SUMS (+ minisign signature).

Provenance

Upstream repositoryMongoDB/mdbr-leaf-ir
Revision (pinned)4262131b32c3182bd06e67e92ae69d7bd66e0c5c
Fetched at2026-08-24T09:37:27Z
License at fetchapache-2.0
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ verified · rehash-vs-hf-metadata at 2026-08-24T09:37:38Z

apache-2.0321.5 MB (337,130,116 bytes)sentence-transformersonnxsafetensorsbertfeature-extractiontransformerssentence-similaritytext-embeddings-inferenceinformation-retrievalknowledge-distillationtransformers.jsendpoints_compatible1 language (en)paper: 2509.12539paper: 2205.13147