What is an AI embedding?
An embedding is a fixed-length dense vector of numbers that represents the meaning of a piece of text or other data; inputs with similar meaning have vectors close together.
It differs from an embedding model as product from producer: the embedding model is the neural network that creates vectors, while the embedding is the vector it outputs. Word embeddings represent single words and sentence embeddings sentences or paragraphs; embedding is the general term covering both.
- Topic
- Embeddings, document processing and RAG
- Also known as
- Embedding vector, vector representation
How an AI embedding works
- The embedding model tokenises the input and passes it through a neural network; the output is a fixed-length vector of hundreds or thousands of numbers.
- In training the model learns to place similar inputs close together in vector space and different ones far apart.
- Closeness between two vectors is measured with cosine similarity or a dot product.
- In RAG, chunk embeddings are written to a vector database; the query is embedded too and the closest chunks are retrieved.
In more detail
Hybrid search: dense embeddings plus sparse representations
Dense embeddings excel at semantic paraphrasing but can miss exact product codes, legal article numbers or rare acronyms. Production enterprise RAG therefore pairs dense embeddings with sparse lexical retrieval (BM25 or learned sparse vectors such as SPLADE) via hybrid search and rank fusion (e.g., Reciprocal Rank Fusion).
Commonly confused terms
| Term | How it differs |
|---|---|
| Token and token ID | Tokenisation splits raw text into integer subword IDs purely as discrete symbols for model input, whereas an embedding maps text into a continuous geometric space where distance reflects semantic similarity. |
| Dense versus sparse embeddings | Dense embeddings encode meaning across all dimensions as compact floating-point vectors, whereas sparse embeddings (such as BM25 or SPLADE) represent inputs as high-dimensional vectors where most entries are zero, excelling at exact keyword and identifier matching. |
Why an AI embedding matters for on-premises AI
Search quality in in-house RAG depends heavily on the embedding model; performance on Turkish and domain terms is measured with the organisation's own questions and documents. Embedding dimension sets storage and search cost: 1 million chunks at 1024 dimensions with 4-byte numbers take about 4 GB of raw vectors (1,000,000 × 1024 × 4). Embeddings can reveal information about source text, so they stay inside. If the embedding model changes, the whole collection is re-embedded.
A telecoms company generates embeddings of customer complaint records in-house; similar complaints are grouped by vector closeness for root cause analysis.
Common questions
Can vectors from two different embedding models be compared?
No. Each model produces its own vector space; vectors from different models are not on the same scale. If the model changes, documents are re-embedded.
Why does embedding dimension matter?
Larger dimensions can give richer representations but raise memory, disk and search cost. The choice is made by measuring quality against cost.
Related terms
- Embedding model
- Embedding dimension
- Vector database
- Cosine similarity
- Semantic search
- Sentence embedding
- Vector search
- Word embedding
Sources
- Efficient Estimation of Word Representations in Vector Space, 2013
- Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks, EMNLP 2019
In the glossary: Glossary, E to L