← all concepts

Matryoshka Representation Learning

A training technique that nests coarse-to-fine information inside one embedding, so it can be truncated to fewer dimensions with little loss.

Matryoshka Representation Learning (MRL) is a training technique that packs coarse-to-fine information into a single embedding, front-loading the most important signal into the earliest dimensions. Like the nested Russian dolls it's named after, one big vector contains smaller usable vectors inside it.

The practical payoff is that you can truncate the vector on demand. EmbeddingGemma's 768-dimensional output can be cut to 512, 256 or 128 dimensions with only minor quality loss, trading accuracy for speed and storage as your workload needs.

We measured this directly: truncating a 1,024-dim model to 256 dims roughly halved processing time while holding top-1 accuracy at 99.5% — and on the hardest sentence pairs, the truncated version actually edged ahead. For anyone running vector search at scale, MRL is a rare "cheaper and barely worse" lever.

Related concepts

Method