Key takeaways
Type “how do I cancel my subscription” into a good help centre. It returns a page called “Closing your account”. The two share no important words, so keyword search would never connect them. An embedding does.
Embeddings sit quietly behind semantic search, RAG and most of what AI infrastructure does out of sight. This is the working version of the idea. It’s enough to read a system design and judge a vendor’s claims. It follows the same shape as my explainer on LLMs.
A list of numbers that holds meaning
An embedding is a list of numbers, usually 256 to 3,072 of them. Each is a decimal somewhere around -1 to 1. The embedding for “I love dogs” might start [0.0234, -0.1782, 0.9034, ...].
No single number means anything you could read. The meaning is spread across all of them.
The list is useful because of how the model was trained. It saw huge amounts of text, with one goal: put similar things close together. So “I love dogs” and “I adore puppies” land near each other, though they share one short word. “I love dogs” and “the stock market crashed” land far apart, though they share more.
That’s what people mean when they say embeddings capture meaning. The shape of the space follows the meaning of the text.
Meaning becomes geometry: things that mean similar things land in the same neighbourhood.
How do you compare two?
Systems almost always use cosine similarity. It’s the cosine of the angle between the two vectors. Same direction gives 1, a right angle gives 0, opposite gives -1.
Straight-line distance works too. But cosine ignores length, and for meaning only direction matters. A short sentence and a long, emphatic one saying the same thing point the same way.
import numpy as np
a = embed("I love dogs") # → 1,536-dim numpy array
b = embed("I adore puppies") # → 1,536-dim numpy array
similarity = np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))
# typically 0.85-0.95 for sentences this similar
Most models scale their vectors to a length of 1. Then the maths shrinks to a dot product, which is very fast.
Where do they come from?
Nobody writes embeddings by hand. A model learns to make them from pairs of texts that belong together. A question and its answer. Two paraphrases. A query and the document that answers it. It’s pushed to put those pairs close and unrelated ones apart. After hundreds of millions of examples, it can place any new text by its meaning.
Embedding models are much smaller and cheaper than chat models. Placing text is an easier job than writing it. They’re also deterministic: the same input gives the same vector every time. That makes them good building blocks.
How many numbers do you need?
The main dial is dimensionality. More numbers capture more nuance and cost more to store and search.
The gains drop off fast. Going from 256 to 1,536 gets you most of the quality you’ll ever see. Doubling to 3,072 might add 2-5% on retrieval benchmarks, for twice the storage. Often that’s not worth it.
Newer models support Matryoshka representations. These let you cut a long vector down to a short one and still use it. So you can keep 3,072 numbers for analysis and search on 768.
Why does RAG depend on them?
Embeddings matter because of retrieval-augmented generation (RAG) and its cousins. The pattern has three steps.
You split your documents into chunks. You embed each one and store it in a vector database like Pinecone, Weaviate or pgvector. When someone asks a question, you embed it and fetch the chunks closest to it. Then you give those chunks and the question to an LLM, which answers from them.
Every support bot, internal docs assistant and “chat with your PDF” tool of the past two years works this way. The same idea does other jobs too:
The LLM provides language. The embedding system provides relevance.
Which model in 2026?
Four models cover most needs as of mid-2026.
| Product | Dimensions | Price | Languages | Deployment |
|---|---|---|---|---|
| OpenAI text-embedding-4 | up to 3,072 | ~$0.10/M | English-strong | API |
| Voyage voyage-large-3 | 1,024 | ~$0.12/M | English (top MTEB) | API |
| Cohere Embed v4 | 1,024 | ~$0.10/M | 100+ languages | API |
| BGE-M3 (open) | multilingual | $0 self-host | multilingual | self-host |
- Dimensions
- up to 3,072
- Price
- ~$0.10/M
- Languages
- English-strong
- Deployment
- API
- Dimensions
- 1,024
- Price
- ~$0.12/M
- Languages
- English (top MTEB)
- Deployment
- API
- Dimensions
- 1,024
- Price
- ~$0.10/M
- Languages
- 100+ languages
- Deployment
- API
- Dimensions
- multilingual
- Price
- $0 self-host
- Languages
- multilingual
- Deployment
- self-host
Cite or embed this
For English and the best raw quality, take Voyage. Already on OpenAI? One fewer vendor is worth a lot. For many languages, take Cohere, or BGE-M3 if you host it yourself. For anything on-premises, BGE-M3 is the only real option.
Don’t agonise over it. On most production tasks, the gap between these models is smaller than the gap between good and bad chunking. Pick one that fits. Then spend your time testing retrieval on your own data.
What they can’t do
An embedding is an input to search. The vector database and its nearest-neighbour algorithm do the actual finding.
It doesn’t understand anything either. Two texts can sit close for shallow reasons, like a shared style or a passing shared topic.
It doesn’t replace an LLM. One finds, the other writes.
And no single model is best at everything. One trained on the web can be poor at medical, legal or code text. That’s why specialised models exist.
Picture every piece of text as a dot in a huge cloud, placed by what it means. An embedding model gives new text its coordinates. A vector database finds a point’s nearest neighbours. RAG asks an LLM to answer only from those neighbours. It’s a small idea, and most of modern AI infrastructure is built on it.
Frequently asked questions
What is an embedding in simple terms?
It's a list of numbers that stands for the meaning of a piece of text (or an image, or audio). Computers can do maths on it. Think of it as a point in a very high-dimensional space. Content with similar meanings ends up close together.
What's the difference between an embedding and a vector?
An embedding IS a vector. The word 'embedding' just means a vector made by a model trained to put similar inputs near each other. So all embeddings are vectors, but not all vectors are embeddings.
Why are embeddings used for search?
Keyword search only finds documents with the same words as your query. Embedding search (semantic search) compares the MEANING of your query with the meaning of each document. So it finds answers even when they share none of your words. That's how 'how do I cancel my subscription' can find a doc titled 'closing your account.'
How big are embeddings?
Modern models make vectors with 256 to 3,072 dimensions (numbers per vector). OpenAI's text-embedding-3-small uses 1,536. text-embedding-4 uses up to 3,072. Voyage's large model uses 1,024. The open-weights BGE-M3 uses 1,024. More dimensions capture more nuance but cost more to store and search.
Which embedding model should I use in 2026?
For most production work: OpenAI text-embedding-4 for the easiest fit with the OpenAI stack. Voyage voyage-large-3 for the best raw retrieval on the MTEB leaderboard. Cohere Embed v4 for strong multilingual coverage at a major-vendor price. BGE-M3 if you want open weights to self-host or run on-prem.
Do embeddings hallucinate?
Not the way LLMs do. An embedding model gives the same numbers for the same input every time. It doesn't write text, so there's nothing to invent. But embedding SEARCH can return odd results. If the model was trained on data unlike yours, it can put unrelated things close together. Test retrieval on your own data before you trust it.
Three-minute lesson on this When it makes things up Marketing course, basic. Free, no sign-up.