MongoDBAnnouncement
LEAF: Distillation of State‑of‑the‑Art Text Embedding Models
Summary
MongoDB Research introduced LEAF, a knowledge distillation framework that trains compact text embedding models to approximate a larger teacher’s embedding space. Unlike earlier methods that align attention matrices or hidden states across layers, LEAF aligns only the teacher and student output embeddings using an L2 loss. The resulting students are interoperable with their teachers, enabling asymmetric retrieval where documents use a larger model and queries use a fast local model. Two 23M-parameter Apache 2.0 models were released: mdbr-leaf-ir for retrieval and RAG, and mdbr-leaf-mt for classification, clustering, sentence similarity, and summarization. LEAF retains up to 97% of teacher performance while being 5×–15× smaller and 7×–24× faster; mdbr-leaf-ir ranks first on BEIR and RTEB for models up to 100M parameters, and mdbr-leaf-mt ranks first on MTEB v2 English for models up to 30M.
Context
State-of-the-art embedding models range from hundreds of millions to billions of parameters and often require GPU servers. In retrieval systems, the same large model typically handles both infrequent document indexing and latency-sensitive query encoding, and embeddings from different models are incompatible, so swapping requires recomputing all document embeddings. LEAF targets these constraints by producing smaller students compatible with their teachers.
Approach / What changed
LEAF distills a teacher into a student by aligning only their output embeddings with an L2 loss, rather than aligning attention matrices or hidden states across layers. The student approximates the teacher’s embedding space, so embeddings are interoperable. Training needs no labeled data or hard negatives, favors small batches, and was run on a single A100. Students inherit MRL and output-quantization robustness from the teacher.
Takeaways
LEAF needs no labeled judgments or hard negatives, favors small batches, and was trained on a single A100 GPU, lowering data and infrastructure requirements compared with contrastive training.
mdbr-leaf-ir, distilled from snowflake-arctic-embed-m-v1.5, scores 53.55 BEIR average nDCG@10 at 23M parameters and 54.03 in asymmetric mode; it ranks first on BEIR and RTEB for models up to 100M parameters.
On a 2vCPU instance the models reach 120 queries/sec and 20 docs/sec; full-precision versions use 87MB, and quantizations are available to increase throughput and reduce memory.
FAQ
How does LEAF differ from earlier distillation methods that align internal layers?
LEAF aligns only the teacher and student output embeddings with an L2 loss. Earlier approaches aligned attention matrices and hidden states across layers, or focused on the last Transformer layer; LEAF's sole objective is approximating the teacher's embedding space.
What can asymmetric retrieval do with teacher-compatible students?
Because student and teacher embeddings are interoperable, documents can be embedded with a larger, more expensive model while queries are encoded by a local, fast LEAF model. This separates the high-latency indexing step from strict query-time latency targets.
Do the released models require a GPU or internet connection?
No. The 23M-parameter models are suitable for CPU-only deployments, IoT, and mobile devices, and since they run on local hardware they do not require an internet connection. Full-precision versions have an 87MB memory footprint, and quantizations are available.
Source and freshness
- Source
- mongodb.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.