Fixed-length vs. Variable-length embeddings
Fixed-length embeddings have the same number of dimensions for every item (e.g. 768 or 1536). Variable-length embeddings can have different dimensions per item (e.g. one vector per token or per phrase). Most vector databases and ANN indexes assume a single, fixed dimension per collection, so in practice you almost always work with fixed-length vectors. Understanding this constraint helps you design chunking, model choice, and multi-vector strategies.
Summary
- Fixed-length: same dimension for every point; required by standard VDB collections and ANN indexes.
- Variable-length: e.g. multiple vectors per document; use mean pooling to one vector, or multi-vector search, or separate structures.
- Dimension is set by your embedding model and affects memory and performance; all vectors in a collection must match.
- Truly variable dimension per point is not supported by typical VDB interfaces; use fixed-length per vector and aggregate or multi-vector when needed.
- When switching models or dimension, create a new collection and re-embed and re-index; see handling model version drift.
Why fixed length is the norm
Transformer-based text and image models output a fixed-size vector per input (sentence or image), so the resulting embeddings are naturally fixed-length. That fits VDBs: the index is built for one dimension, and every point has the same number of components. Distance and similarity are defined only between vectors of the same length, and ANN structures (e.g. HNSW, IVF) assume a fixed D. So a collection declares its dimension (e.g. 768), and all inserts and queries must use that dimension.
Pipeline impact: when you choose an embedding model, its output dimension is fixed (e.g. 384, 768, 1536). You create a collection with that dimension and all upserts and queries must supply vectors of that size. When to use which dimension: higher dimension often means more expressive embeddings but more memory and slower distance computation; see impact of embedding model dimensionality on VDB performance and choosing the right embedding model for trade-offs.
Variable-length and multi-vector options
Variable-length representations (e.g. multiple vectors per document, or token-level vectors) require either aggregating to one vector per document (e.g. mean pooling), storing multiple vectors per document and using multi-vector search, or maintaining separate structures—each with different trade-offs. Multi-vector search lets you store several vectors per item and query against all of them (e.g. max or aggregate score per document); the per-vector dimension is still fixed.
Truly variable dimension per point is not supported by typical VDB interfaces. Practical tip: for long documents, use chunking to get one fixed-length vector per chunk rather than trying to use variable-length vectors; for multiple aspects per item (e.g. title + body), either concatenate and project to one vector or use multi-vector search if your VDB supports it. Trade-off: mean pooling loses some nuance; multi-vector increases storage and query cost but can improve recall.
Dimension and performance
The dimension is determined by your embedding model and affects memory and performance. Once chosen, all vectors in that collection must match; mixing lengths in one index is not supported by standard VDB interfaces. When you switch embedding models, if the new model has a different dimension you must create a new collection and re-embed and re-index; you cannot mix dimensions in one index. See choosing the right embedding model for quality vs. dimension trade-offs and handling updates to the embedding model for version drift.
Frequently Asked Questions
Can I store 768-dim and 1536-dim vectors in the same collection?
No. A collection has one dimension. Use separate collections for different dimensions (e.g. different models).
What if my model outputs variable-length (e.g. one vector per token)?
Pool to one vector per document (e.g. mean over token vectors) to get fixed length, or use a multi-vector feature if your VDB supports it and store multiple fixed-length vectors per doc.
Does fixed length limit what I can represent?
Dimension caps expressiveness in principle, but in practice 384–1536 dimensions from modern models capture a lot. Very long documents are handled by chunking (one vector per chunk), not by variable-length vectors; see chunking strategy and vector quality.
Can I change dimension when I switch embedding models?
New dimension = new collection (or schema). You must re-embed and re-index; you can’t mix dimensions in one index. See handling updates to the embedding model.