Skip to content
atlas

Embedding

Also known as: vector embedding

A list of numbers that stands for the meaning of a piece of text, so that texts with similar meaning end up with similar numbers.

Draft - this entry has not been reviewed yet.

Formal

A fixed-length vector produced by a neural network to represent a token, sentence or document, placed so that items close in meaning lie close together and can be compared by distance.

In plain English

Like giving every text coordinates on a map of meaning - "car" and "vehicle" land near each other, "car" and "banana" far apart.

In practice

A municipality stores embeddings of all its internal policies, so that a staff member's search for “working from home” also finds the policy titled “remote work”.

Why it matters

Embeddings look like meaningless numbers, but much of the original text can be rebuilt from them, so they need the same protection as the source data.

Technical deep dive

Two different things share the name. Inside every language model there is a token-embedding table, a learned matrix of shape vocabulary size by model dimension, from which each input token ID selects one row; these vectors are only the starting point and are transformed layer by layer into contextual representations. Separately, embedding models (text encoders) map a whole passage to one fixed-length vector, typically a few hundred to a few thousand dimensions, by pooling the final hidden states (mean pooling or a dedicated CLS or end-of-sequence token). Retrieval, clustering, deduplication and classification use the second kind.

The lineage runs from word2vec (Mikolov et al., 2013), whose skip-gram and CBOW objectives produced static word vectors with the famous linear analogies, through contextual encoders such as BERT (2018), to sentence encoders trained contrastively: pairs of related texts (question and answer, title and body, paraphrases) are pulled together and in-batch negatives pushed apart with an InfoNCE-style loss. Sentence-BERT (2019) made this bi-encoder setup practical; benchmarks such as MTEB compare models across retrieval, clustering and similarity tasks. Some newer models are trained so that a prefix of the vector (for example the first 256 of 1,024 dimensions) remains usable, which lets operators trade accuracy for storage.

Similarity is usually measured by cosine similarity or, for L2-normalised vectors, the equivalent dot product. Scores are only comparable within one model: vectors from different models, or different versions of the same model, live in unrelated spaces, so changing the embedding model means re-embedding the whole corpus. At scale, exact search is replaced by approximate nearest-neighbour indexes such as HNSW or IVF with product quantisation, which trade a little recall for large speed gains. A bi-encoder compresses a passage before seeing the query, so it misses fine distinctions such as negation or exact identifiers; that is why pipelines add keyword search (hybrid search) and a cross-encoder reranker that reads query and passage together.

Embeddings are not anonymisation. Morris et al. (2023) showed that an iterative inversion method (vec2text) recovered 92% of 32-token inputs exactly from their embeddings, and personal names could be recovered from embeddings of clinical notes. Under GDPR an embedding of personal data therefore remains personal data, a vector store needs the same access control, retention and deletion as the source documents, and a leaked index should be treated like a leak of the text. OWASP's 2025 LLM Top 10 covers related risks as LLM08 Vector and Embedding Weaknesses.

What to learn first

Everything this builds on, foundations first.

  1. Neural network
  2. →Token
  3. →Embedding

Relationships

Sources & further reading

Reference works

  • Mikolov et al. (2013), Efficient Estimation of Word Representations in Vector Space
  • Morris et al. (2023), Text Embeddings Reveal (Almost) As Much As Text

Textbooks

  • Goodfellow, Bengio & Courville, Deep Learning · MIT Press

Where this data comes from

This entry was drafted by an AI from the sources above and has not yet been checked by a person. Treat it as a starting point, and check anything important against the sources.

See the review queueSuggest a correction on GitHubThis term as JSON

Mentioned in

Check yourself

Loading…

Atlas is in beta.