Key takeaways

  • An embedding is a list of numbers, often 1,024 to 3,072 of them, positioned so that inputs with similar meaning sit close together.
  • Embeddings are compared with cosine similarity, and they are what semantic search, RAG, clustering and recommendations run on.
  • As of November 29, 2026, hosted embedding models cost $0.02 to $0.20 per million text tokens, and vectors from different models cannot be mixed.

An embedding is a list of numbers that stands for a piece of text, an image or a clip of audio, arranged so that things with similar meaning get similar numbers. OpenAI's embeddings guide answers "what is an embedding" in one line: "An embedding is a vector (list) of floating point numbers." The distance between two of those lists says how related the two things are.

Computers can't compare meanings, but they compare numbers very fast. That is why embeddings sit under semantic search, retrieval-augmented generation (RAG), recommendations and clustering.

What an embedding looks like

Picture a map where every sentence has coordinates. "How do I reset my password" and "I forgot my login" land close together, though they share almost no words. "Best pizza in Naples" lands far away.

A real embedding has far more than two coordinates. OpenAI's text-embedding-3-small returns 1,536 numbers per input. Its text-embedding-3-large and Google's gemini-embedding-2 return 3,072 by default. That count is the embedding's dimensions. No single number means anything you could name; the position as a whole carries the meaning.

The idea got famous through a 2013 Google paper, Efficient Estimation of Word Representations in Vector Space, better known as word2vec. Tomas Mikolov and his co-authors trained word vectors on a Google News corpus of about 6 billion tokens and showed that directions in the space carried meaning. Take the vector for "King", subtract "Man", add "Woman", and the closest vector is "Queen". Paris minus France plus Italy comes out at Rome. The authors didn't oversell it: accuracy was "quite good", with "a lot of room for further improvements".

How an embedding is made

A neural network learns the numbers from a lot of text.

Word2vec used two simple training tasks. One, CBOW, predicts a word from the words around it. The other, Skip-gram, predicts the surrounding words from the word in the middle. The vectors are a side effect.

Word vectors have an obvious limit: one vector per word, whatever the sentence. Modern embedding models take a whole sentence or document and return one vector for it. The paper that made this practical was Sentence-BERT in 2019. Nils Reimers and Iryna Gurevych took BERT, a language model that produces one vector per token, averaged those vectors into one, and fine-tuned the network on 570,000 sentence pairs from the SNLI dataset and 430,000 from MultiNLI so that sentences with the same meaning ended up close.

With plain BERT, finding the most similar pair among 10,000 sentences meant running every pair through the network, about 50 million computations and roughly 65 hours. With one embedding per sentence, the paper puts it at about 5 seconds.

Today's hosted models work the same way, and some go past text. Google says gemini-embedding-2 places text, images, video, audio and PDFs in one shared space.

Cosine similarity: how two embeddings are compared

Cosine similarity measures the angle between two vectors. It is 1 when they point the same way, 0 when they are at right angles, and -1 when they point in opposite directions.

The word2vec and Sentence-BERT papers both use it. OpenAI recommends it too, but adds that "the choice of distance function typically doesn't matter much". Its embeddings are normalized to length 1, so a plain dot product gives the same result faster, and Euclidean distance ranks results in the same order.

What embeddings are used for

Search is the main use. You embed every document once and store the vectors. Then you embed each query and return the documents whose vectors are nearest. That finds matches by meaning, where keyword search finds matches by shared words.

RAG is that same search with a language model on the end: the retrieved passages go into the model's prompt so it can answer from your documents. Our explainers on agentic RAG and context engineering cover what happens after retrieval.

OpenAI's guide also lists clustering (grouping similar texts), recommendations, anomaly detection and classification.

On November 24, Google put managed ingestion into public preview in Agent Retrieval on Vertex AI. It parses files from Cloud Storage, splits them into chunks of 100 to 500 tokens by default, and embeds them with Gemini Embedding 2.

Dimensions and what embeddings cost

Embedding models are priced per million input tokens. These numbers are from each company's docs and pricing page as of November 29, 2026.

Model Default dimensions Can be shortened to Max input Price per 1M tokens
OpenAI text-embedding-3-small 1,536 Fewer, via dimensions 8,192 tokens $0.02
OpenAI text-embedding-3-large 3,072 Fewer, for example 256 8,192 tokens $0.13
Google gemini-embedding-2 3,072 128 and up 8,192 tokens $0.20 text, $0.10 batch
Voyage voyage-4-large 1,024 256 or 512 32,000 tokens $0.12
Voyage voyage-4-lite 1,024 256 or 512 32,000 tokens $0.02

OpenAI works out its own example: at about 800 tokens a page, one dollar embeds 62,500 pages with text-embedding-3-small or 9,615 with text-embedding-3-large. The mid-size voyage-4 costs $0.06, and Voyage gives every account the first 200 million tokens free on its 4-series models. Google's older text-only gemini-embedding-001 costs $0.15 and stops at 2,048 tokens. Cohere's Embed 5 models default to 2,048 dimensions and take inputs up to 128k tokens.

At those prices the API bill is rarely the problem. Storage is. A 3,072-dimension vector stored as 32-bit floats takes about 12 KB, so a million of them need about 12 GB before any index. That is arithmetic, not a vendor figure.

Shortening works because of a 2022 technique called Matryoshka representation learning. The model is trained so the first numbers in the vector hold the most important information, and you can cut the end off and keep a usable embedding. The paper reported embeddings up to 14 times smaller at the same accuracy on ImageNet-1K classification. Google and Cohere say their current models are trained this way, and OpenAI cites the paper in a footnote to its text-embedding-3 announcement, which claims that text-embedding-3-large cut to 256 dimensions still beats the older ada-002 at 1,536 on the MTEB benchmark.

Limits of embeddings

Vectors from different models can't be mixed. Google's docs say gemini-embedding-001 and gemini-embedding-2 are incompatible, so upgrading means re-embedding everything. Voyage advertises an exception: embeddings from any of its 4-series models work with each other.

Inputs have a ceiling. Google's docs say text over the limit is silently truncated, so long documents have to be split into chunks first.

An embedding also compresses. A whole page becomes one point, and a single fact buried in it can get lost. Google's new SearchDocuments API runs semantic and full-text search together for documents, which is a fair hint that vectors alone aren't enough.

No model is best at everything. The MTEB benchmark paper tested 33 models on 58 datasets across 8 kinds of task and found that "no particular text embedding method dominates across all tasks". Treat the public MTEB leaderboard on Hugging Face as a shortlist.

Embedding models have a training cutoff too. OpenAI says its text-embedding-3 models lack knowledge of events after September 2021.

To choose one, embed a few hundred of your own documents with two candidates, run twenty real queries, and read the top five results for each.

Frequently asked questions

What is an embedding vector?

It is the same thing as an embedding: the list of numbers a model returns for an input. OpenAI's text-embedding-3-small returns 1,536 numbers, and text-embedding-3-large and Google's gemini-embedding-2 return 3,072 by default.

What is an embedding model?

An embedding model is a neural network that takes text, or in some cases images, audio and video, and returns a vector instead of words. Examples are OpenAI's text-embedding-3 models, Google's gemini-embedding-2, Voyage's voyage-4 series and Cohere's Embed models.

What is an embedding in RAG?

In retrieval-augmented generation, documents are split into chunks and each chunk is embedded and stored. The user's question is embedded the same way, the nearest chunks are retrieved, and they are added to the language model's prompt so it can answer from them.

What is an embedding space?

It is the set of all positions a model's vectors can take, like a map with thousands of axes. Each model has its own space, which is why Google's docs say moving from gemini-embedding-001 to gemini-embedding-2 requires embedding all existing data again.

Sources

  1. Efficient Estimation of Word Representations in Vector SpacearXiv
  2. Sentence-BERT: Sentence Embeddings using Siamese BERT-NetworksarXiv
  3. Matryoshka Representation LearningarXiv
  4. MTEB: Massive Text Embedding BenchmarkarXiv
  5. Vector embeddings guideOpenAI
  6. API pricingOpenAI
  7. New embedding models and API updatesOpenAI
  8. Embeddings, Gemini API docsGoogle
  9. Gemini API pricingGoogle
  10. From files to cited answers in one API call: managed ingestion and SearchDocuments in Agent RetrievalGoogle for Developers Blog
  11. Text embeddingsVoyage AI
  12. PricingVoyage AI
  13. Cohere's Embed modelsCohere
  14. MTEB leaderboardHugging Face

Add ClaudeGPT Si as a preferred source on Google