noun · AI concept
Embedding
also called vector
A map location for meaning. Ideas that mean similar things end up close together, so a computer can tell what is related.
A numeric vector that represents the meaning of text, where closer vectors mean more similar content.
A learned list of numbers that represents a token, sentence or document. Training places items with similar meaning near each other, so distance between lists can stand in for similarity of meaning.
Real-life example
You search your notes for "cancel my subscription" and get a note titled "how to stop my plan". There is no shared keyword. Both were turned into embeddings, and the two lists of numbers sit close together because the meanings are close.
Playground
Drag your question around a map of meaning and see which items it lands nearest to.
A map of meaning
Drag your question around the map, or focus it and use the arrow keys.
Closest items
- 1beachdistance 22.5
- 2sushidistance 23.3
- 3train ticketdistance 28.2
Closer on the map means more similar in meaning. That is how a search finds a note about “stopping a plan” when you typed “cancel my subscription”.
In a real system the “distance” is usually cosine similarity between two long lists of numbers. The nearest item is the most similar, not necessarily the correct one.
Illustrative: a hand-drawn 2D map. Real embeddings have hundreds of dimensions, and different embedding models make different maps.
Where the analogy breaks
-
An embedding is not the text itself. It is a summary of meaning, so you cannot get the exact words back from it.
-
Embeddings from different models cannot be compared. Each model builds its own map, so mixing them gives nonsense.
-
Close does not mean correct. A close match is only similar, and the best answer can still be missed or an unrelated one returned.