IT lexicon AI & ML Matryoshka embedding

Matryoshka embedding

AI & ML På svenska → Updated: 2026-05-29

Embeddings trained (Matryoshka Representation Learning) so the most important information is concentrated in the first dimensions — which lets you truncate the vector (e.g. keep 256 of 1536 dimensions) and still retain most of the quality. Like a Russian doll: each prefix is a complete, smaller embedding.

Problem: larger embeddings (more dimensions) give better quality but cost more storage, memory, and search time. Usually you have to pick the size in advance. Matryoshka training packs the information hierarchically so the first N numbers in the vector are already a useful embedding on their own → you can truncate to any length at use time, without recomputing. Win: a single model gives a flexible quality-vs-cost trade-off; you can do a fast coarse search with short vectors and then re-rank with full ones. Used by OpenAI's text-embedding-3 (the dimensions parameter) and several open source models (2024+). It partly mitigates the embedding-drift pain (same model, adjustable size). Related to embedding model and embedding drift.

← Back to the lexicon