What are embeddings in AI?

In brief

An embedding is a list of numbers, typically a few hundred to a few thousand, that represents the meaning of a piece of text or an image. Texts with similar meaning get lists that sit close together, so a computer can find related content by measuring distance. Embeddings power semantic search, recommendations and the retrieval step behind chat-with-your-documents.

An embedding is a location, and meaning is distance

Give an embedding model the sentence "how do I get my money back" and it returns a list of numbers. Give it "refund policy" and it returns another list. The two lists are close together. Give it "the refund of electrons in the cathode" and the list lands far away, even though it shares the word.

That's the entire trick. The model has learned to place text in a space with hundreds or thousands of dimensions such that meaning, not vocabulary, decides where things land. Once text is a location, questions about meaning become questions about distance, and distance is something a computer can calculate for a million items in milliseconds.

The famous early demonstration, from the word2vec work in 2013, was arithmetic on word locations: take the vector for "king", subtract "man", add "woman", and the nearest word to the result is "queen". Modern embedding models do the same for whole sentences and documents, and the vectors are longer.

How big an embedding is, on the models people actually use

The length of the list is called its dimension count. It has grown with the models.

word2vec in 2013 used 300 dimensions and BERT base 768 in 2018; Voyage 3 returns 1,024, OpenAI's text-embedding-3-small returns 1,536 numbers per input and text-embedding-3-large returns 3,072; Google's Gemini Embedding also defaults to 3,072. More dimensions can hold finer distinctions, at the cost of storage and comparison time, which is why the newer models also let you truncate the list to a smaller size when speed matters more than nuance.

Each of those numbers is meaningless on its own. Dimension 412 isn't "formality" or "topic". The meaning is only in where the whole list lands relative to other lists. That's why an embedding is useless without a collection to compare it against.

Embedding models find; language models write

People conflate the two because both are "AI on text". They are different models doing opposite jobs.

Embedding modelLanguage model (LLM)
InputText (or an image)Text (or an image)
OutputA fixed list of numbersNew text, one token at a time
JobPlace the input so similar things are nearContinue the input plausibly
Used forSearch, matching, clustering, retrievalAnswering, writing, summarising
Cost per million tokens$0.02 on text-embedding-3-small$0.20 on the cheapest GPT row, $2 to $10 on frontier ones
Can it be wrong?It can rank a poor match firstIt can invent an answer

The cost row is the one to notice. Embedding a million tokens with OpenAI's small model costs $0.02. GPT-5.6 Luna charges $0.20 per million input tokens, tied for the cheapest GPT row with Luna Pro and GPT-5.4 Nano, per the AI model cost index at OpenRouter prices fetched on 2026-08-20. Finding is ten times cheaper than the cheapest GPT writing and at least a hundred times cheaper than frontier writing. That gap is why every serious system finds first and writes second. What is an LLM covers the writing side.

Where embeddings run without you seeing them

Chat with your documents. When you upload a long PDF and ask a question, the file is split into passages. Each passage is embedded and stored in a vector database, then your question is embedded too, and the passages whose vectors sit nearest are handed to the language model as context. The model answers from those passages. This is retrieval-augmented generation, and what is RAG walks through the pipeline; embeddings are its search step. The chat with PDF guide covers how to question an uploaded file in Whizi.

Whether a document is searched or simply read whole comes down to the window. The context window of each model, in pages, is below; anything that fits can go in as a whole, and retrieval exists for the collections that don't.

A 200K window holds a novel. A 1M window holds the shelf
Claude Haiku 4.5200K tokens375 pagesKimi K2 Thinking262K tokens492 pagesGrok 4.6500K tokens938 pagesClaude Sonnet 51M tokens1,875 pagesGPT-5.6 Terra1.05M tokens1,969 pagesDeepSeek V4 Flash1.31M tokens2,458 pagesone square is 100 pages, at 400 words apage and three quarters of a word per token

Search that understands synonyms. A support site that returns the cancellation article for "stop paying" is comparing embeddings, not matching words.

Recommendations and clustering. Items with nearby vectors are similar items: related products, duplicate tickets, articles on the same topic.

Memory features in chat apps. When an assistant "remembers" a fact from an old conversation, one common implementation embeds past notes and retrieves the nearest ones into the prompt.

In each case the embedding does the finding and something else does the deciding or the writing. The failure mode is the same everywhere too. If the nearest vector is the wrong passage, everything downstream is confidently answering the wrong question. That's a retrieval miss, and what is an AI hallucination lists it as a separate failure from invention.

What you can do with the idea, without writing code

You'll rarely handle an embedding directly, but knowing the mechanism changes how you use the tools built on it.

  1. Ask in the language of the answer. Retrieval matches your question to passages by meaning. A question phrased the way the document phrases things lands closer than one phrased the way you would say it out loud.
  2. Split big uploads by topic. A 400-page file with three unrelated subjects embeds into a crowded space; three files retrieve cleanly.
  3. Read the cited passage. If a chat-with-file answer cites a passage, open it. A retrieval miss looks like a confident answer to a slightly different question.
  4. Expect it to fail on exact strings. Embeddings are about meaning; an invoice number or a part code is better found by plain text search, and good tools combine the two.

When the job is to find the right piece among many, you want an embedding model, and it should be cheap. When the job is to produce a piece, you want a language model, and it should be good. Products that get this split right are the ones whose file chat actually works.

Workflow checklist
  • Remember the split: embeddings find, language models write
  • Phrase questions to an uploaded document in the document's own terms
  • Split large uploads by topic so retrieval has a cleaner space to search
  • Open the cited passage on any chat-with-file answer before trusting it
  • Use plain text search for exact strings such as IDs and codes; embeddings match meaning, not characters
Common questions

Frequently asked questions

What is an embedding in simple terms?

A list of numbers that stands in for the meaning of a piece of text, placed so that similar meanings get similar lists. "Refund policy" and "how do I get my money back" land close together; a chemistry sentence with the word refund lands far away. Distance between lists is how a computer measures relatedness.

What is the difference between an embedding model and an LLM?

An embedding model outputs a fixed list of numbers representing meaning; a language model outputs new text one token at a time. The first finds and matches, the second writes and answers. Chat-with-your-documents uses both: embeddings to fetch the relevant passages, the LLM to write the answer from them.

How many dimensions does an embedding have?

It depends on the model. word2vec in 2013 used 300, BERT base 768, and current models run from 1,024 to 3,072: OpenAI's text-embedding-3-small returns 1,536 and text-embedding-3-large returns 3,072, the same as Google's Gemini Embedding default. Newer models let you truncate to fewer dimensions when speed matters more than nuance.

Are embeddings expensive?

No, and that's the point. OpenAI lists text-embedding-3-small at $0.02 per million tokens, against $0.20 per million input tokens for GPT-5.6 Luna and $2 to $5 for frontier chat models at OpenRouter list prices fetched 2026-08-20. Finding is ten to a hundred times cheaper than writing, which is why retrieval systems embed everything and generate only the answer.

Where are embeddings used in ChatGPT, Claude or Gemini?

In the features that find things: file upload and chat-with-documents, search over your past conversations, and memory that recalls facts from earlier chats. In each, the usual design is to embed the text, retrieve the nearest matches, and have the language model write from them. The embedding is invisible to you; the retrieval miss, when it happens, is not.