What is embedding dimension?
Embedding dimension is the number of values in the vector an embedding model produces for each text, image or item, typically hundreds to a few thousand, set by the model's architecture.
An embedding is the numerical representation of text; its dimension is how many numbers it contains. Higher dimension alone does not mean better quality; training sets quality, dimension mostly sets cost.
- Topic
- Embeddings, document processing and RAG
- Also known as
- Vector dimension, embedding size
How embedding dimension works
- The embedding model produces a fixed-length vector for each input; that length is its embedding dimension.
- Similarity is meaningful only between vectors from the same model and of the same size; if the model changes, the collection is re-embedded.
- Models trained with Matryoshka representation learning allow using just the first part of the vector.
- Example calculation: 1,000,000 chunks at 1,024 dimensions and 4 bytes per value take 1,000,000 × 1,024 × 4 ≈ 4.1 GB; at 512 dimensions that halves.
In more detail
Re-normalising after Matryoshka truncation
Truncating a unit-norm Matryoshka vector leaves a sub-vector whose L2 norm is below 1. Always re-normalise the truncated slice to unit length before storing it in a dot-product or L2-distance index so similarity scores remain calibrated across documents.
Commonly confused terms
| Term | How it differs |
|---|---|
| Context window | Embedding dimension is the number of coordinates per vector (e.g., 1024), whereas context window (max sequence length) is the maximum number of input tokens the embedding model can read at once before truncating (e.g., 512 or 8192 tokens). |
| Dimension reduction versus vector quantisation | Reducing embedding dimension (e.g., via Matryoshka truncation from 1024 to 256) drops trailing vector coordinates; vector quantisation (FP16, INT8, binary) keeps the dimension count fixed while reducing the bit-width per coordinate. |
Why embedding dimension matters for on-premises AI
In in-house RAG, embedding dimension directly affects the vector index's memory and disk needs, search speed and hardware cost, markedly so for millions of chunks. The right choice comes from measuring quality at several dimensions on the organisation's own data. Truncatable vectors and quantisation cut cost for a small quality loss. In air-gapped settings with limited hardware it is part of capacity planning.
Before indexing tens of millions of support records, a telecom operator tests one model at full and half dimension on its own questions; finding the gap small, it picks half, halving index memory.
Common questions
Does a higher embedding dimension give better results?
Not always. Training sets quality. Higher dimensions raise storage and search cost, so measuring with your own data is needed.
Can vectors of different dimensions share one index?
No. Similarity is meaningful only between same-size vectors from the same model. If the model changes, the collection is re-embedded.
Related terms
Sources
- Kusupati et al., Matryoshka Representation Learning, 2022
- Muennighoff et al., MTEB: Massive Text Embedding Benchmark, 2022
In the glossary: Glossary, E to L