Matryoshka embeddings
Matryoshka embeddings are trained so that the first part of the vector still works on its own, which lets you cut the vector shorter to save storage and search time.
A normal embedding vector has a fixed length, for example 1,024 numbers, and every number is needed. A model trained with Matryoshka representation learning packs the most useful information into the first numbers, like nesting dolls. You can keep only the first 256 or 128 numbers, lose a little accuracy and make the vector index several times smaller.
The model cards of EmbeddingGemma 2, Granite Embedding R2 and Jina Embeddings v5 describe Matryoshka training or dimension reduction, and Qwen3-Embedding lets you choose the vector length. Use only the lengths the model was trained for, and re-test retrieval quality after truncating, because the loss depends on your data.
Related terms
- Embedding model An embedding model turns text, images or other data into a list of numbers that captures its meaning, so that similar items end up close together.
- Retrieval-augmented generation (RAG) Retrieval-augmented generation lets a model answer from your own documents by retrieving the relevant passages and adding them to the prompt.
- Reranker A reranker re-scores a short list of search results by reading the question and each result together, which is slower but more accurate than embeddings alone.