Matryoshka representation learning arxiv 2205 13147v4

From feiyang-k/curation-bench · View interactive version

Matryoshka representation learning arxiv 2205 13147v4 is an AI agent skill from the GitHub repository feiyang-k/curation-bench. Use this skill when you want to train embeddings that work at multiple dimensionalities, enabling flexible compute-quality tradeoffs at retrieval time. Avoid it when you only need fixed-dimension embe

How to use this skill

Skill file

Matryoshka Representation Learning

One-line decision

Use this skill when you want to train embeddings that work at multiple dimensionalities, enabling flexible compute-quality tradeoffs at retrieval time. Avoid it when you only need fixed-dimension embeddings.

Skill metadata

Goal

Train embeddings that are effective at multiple dimensionalities simultaneously, enabling flexible compute-quality tradeoffs at deployment without retraining.

Problem signature

Use when

Do not use when

Required inputs

Optional inputs

Outputs

Assumptions and prerequisites

Procedure

  1. Design multi-resolution loss

Action: Compute loss at multiple embedding dimension truncations.

Why: Multi-resolution training develops nested representations.

Note: See paper for details.

  1. Train with Matryoshka loss

Action: Train the model with losses at d=8, 16, 32, ..., full.

Why: Develops effective embeddings at all truncation levels.

Note: See paper for details.

  1. Deploy at optimal dimension

Action: Choose embedding dimension based on compute budget at deployment.

Why: Flexible dimensionality optimizes compute-quality tradeoff.

Note: See paper for details.

Parameters to set

Validation checks

Failure modes

Adaptation notes for VLM training

Implementation notes

Evidence from the paper

Source paper

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.