ld.← ALL FIELD NOTESTHE RELATED CASE STUDY ↗
FIELD NOTES / 07EMBEDDINGS   ·   RETRIEVAL & RAG

What does an embedding dimension mean?

An embedding is a point in a learned space. Its dimensions are coordinates, not a neat checklist of human concepts.

From coordinates to embeddings

A point such as [5, 3] has two coordinates. Add another and you have a three-dimensional point. An embedding applies the same idea at a much larger scale: a 512-dimensional vector contains 512 values.

An embedding model transforms text into a learned representation. Similar ideas can end up near each other in that space, making measures such as cosine similarity useful for semantic search.

Meaning is distributed

It is tempting to imagine one coordinate for color and another for size. In practice, semantic information is generally distributed across the vector, and the coordinates work together as a representation.

More dimensions also mean more data. At FP32, 512, 1,024, and 1,536 dimensions use approximately 2, 4, and 6 KiB per vector respectively, before index and other overhead. A larger vector is not automatically a better retrieval system; evaluate the model and configuration on the task.

RAW FP32 STORAGE PER VECTOR
5122 KiB
1,0244 KiB
1,5366 KiB

Continue the conversation

Further reading

KEEP READING / 06The systems cost behind a RAG pipeline.

Another note from the notebook.