Matryoshka Embedding Dimensions: Cost vs Quality
Matryoshka representation learning lets you shorten an embedding vector to save storage with only a small quality loss. The trick most cost guides miss: truncation cuts your vector-database bill, not your API bill.
Matryoshka representation learning (MRL) packs the most important signal into the first dimensions of an embedding, so you can keep the leading 256 or 512 numbers of a 3072-dimension vector and still retrieve accurately. OpenAI reported that text-embedding-3-large truncated to 256 dimensions still beats the older ada-002 at its full 1536 dimensions on MTEB. Crucially, the API token price is unchanged by truncation - you pay per input token regardless of output width - so every dollar you save lands in vector storage, RAM, and search latency, not the embedding call.
Dimension Cost Optimizer
See how truncating a Matryoshka embedding cuts storage cost while leaving the API token bill unchanged.
| Dimensions | Storage | Storage/mo | Total/mo | Storage saved |
|---|---|---|---|---|
| 256 | 4.8 GB | $1.57 | $66.57 | $17.31 (-92%) |
| 512 | 9.5 GB | $3.15 | $68.15 | $15.74 (-83%) |
| 1,024 | 19.1 GB | $6.29 | $71.29 | $12.59 (-67%) |
| 1,536(half - sweet spot) | 28.6 GB | $9.44 | $74.44 | $9.44 (-50%) |
| 3,072(full) | 57.2 GB | $18.88 | $83.88 | baseline |
Storage uses float32 (4 bytes per dimension) at Pinecone Serverless list rate. Read/write units for serverless databases are extra. Quality retention under truncation is model-specific - see the guidance below before picking a dimension. The token price ($0.13/M) does not change with output dimensions.
Why truncation saves storage but not API cost
Every major embedding API meters on input tokens. Whether you ask text-embedding-3-large for 3072 dimensions or 256, you send the same text and pay the same per-token rate. What changes is the width of the vector you store. A 3072-dimension float32 vector is 12,288 bytes; a 256-dimension one is 1,024 bytes - a 12x reduction in storage, RAM footprint, and the data scanned per similarity query.
At small scale this is rounding error. At tens of millions of vectors on a managed vector database charging per GB-month, it is the difference between a small monthly line and a large one. The optimizer above shows the exact crossover for your volume and chosen database.
Which models support it, and how far you can truncate
| Model | Full dims | MRL floor | Supported levels |
|---|---|---|---|
| text-embedding-3-large | 3,072 | 256 | 256 / 512 / 1024 / 1536 / 3072 |
| text-embedding-3-small | 1,536 | 512 | 512 / 768 / 1024 / 1536 |
| gemini-embedding-001 | 3,072 | 768 | 768 / 1536 / 3072 |
| embed-v4 (Cohere) | 1,536 | 256 | 256 / 512 / 1024 / 1536 |
Supported dimensions from each provider's documentation. You can usually request intermediate values, but the trained checkpoints above give the cleanest quality-per-dimension trade-off.