Predict the storage savings from truncating a 3072-dim model to 768
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
You have 10M documents embedded as 3072-dim float32 vectors. You truncate to 768 dimensions using Matryoshka. Compute the savings in storage (express as a ratio: original storage / truncated storage).
Storage is linear in dimension, so 3072 → 768 gives 3072/768 = 4x savings. The recall cost for a well-trained Matryoshka model is typically under 5 recall@10 points.
Picture a row of identical lockers, each holding one filled-out form. If you shrink each locker to one quarter its old size, you fit four times as many lockers in the same room. That is the whole calculation. The arithmetic is just three thousand seventy two divided by seven hundred sixty eight, which equals four, because shelf space is a straight count of numbers written on each form. You cut the count of numbers per form by four. No hidden factors, no extra overhead. The interesting question is what you lose by shrinking the locker. For a form designed to be safely chopped short, the answer is surprisingly little, usually a small dip in search quality, not a collapse.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Compute the 4x ratio explicitly, decompose total storage into raw plus index overhead, note the sub-linear HNSW latency story, and close on the typical quality cost.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Forgetting that storage savings are exact, not approximate, when both the float dtype and the vector count stay the same. The only variable is dimension.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.