gaash.ai

Vector Embedding (Embedding)

A vector embedding is a list of numbers a model produces to stand for a piece of text, arranged so that texts with similar meaning end up close together in that numeric space. Two sentences that say the same thing in different words get nearby vectors; the same word used in two senses does not.

Where the numbers come from

An embedding model is trained so that the distance between two outputs tracks how related their inputs are. Feed it a sentence, a paragraph or a whole page and it returns a fixed-length vector, often hundreds or a few thousand numbers long, whose individual entries mean nothing on their own. Closeness is measured by the angle between vectors or the distance between them. Anthropic’s embeddings documentation describes the use: represent text numerically so that search, clustering and classification can be done with arithmetic rather than with string matching.

How this changes what "matching" means

Keyword search asks whether the words in the query appear in the document. Embedding search asks whether the document is about the same thing as the query, so a page that answers "how much does a rewire cost" without ever using the word "rewire" can still be retrieved for it, and a page stuffed with the word but silent on the cost may not be. That is good news for plain writing and bad news for vagueness: a passage that says something specific lands near the specific questions it answers, while a passage of general praise lands near nothing in particular. Once retrieved, a chunk still has to be readable as an answer, which is the citability question.

A common question

Is an embedding the same as a keyword?

No. A keyword is a string that either occurs in a text or does not. An embedding is a position in a space of meanings, so two texts can match without sharing a word and can fail to match while sharing several. Search systems that use embeddings typically combine them with keyword matching, because exact names, part numbers and addresses are still best found by the string.

Related terms

Sources

Definition and use: Anthropic’s embeddings documentation. No figures on this page.