Embedding
A way of representing words, sentences, or other data as lists of numbers so that AI models can understand relationships and similarities between them.
An embedding is a numerical representation of a piece of information -- most commonly a word, sentence, or document. Instead of treating text as raw characters, an AI model converts it into a list of numbers (called a vector) where the numbers encode meaning. The crucial property of a good embedding is that items with similar meanings end up with similar vectors, so the AI can do useful things like measure how closely related two pieces of text are.
Embeddings are one of the foundational ideas inside large language models and many other AI systems. They are what allow a model to know that "happy" and "joyful" are much closer in meaning than "happy" and "wrench", even though those words look completely different as characters. You can read more about the underlying mechanics in how LLMs work.
How it works#
When text is fed into an AI system, a neural network converts each token into a vector. These vectors are not hand-crafted by engineers; the model learns them during training by adjusting the numbers millions of times until similar words end up in similar positions in the mathematical space. Each number in the vector captures some aspect of meaning -- though individual numbers are not labelled and cannot be read directly by humans.
Once you have vectors for two pieces of text, you can measure the angle between them (a calculation called cosine similarity). A small angle means the texts are semantically close; a large angle means they are unrelated. This single calculation is what powers semantic search, clustering, and recommendation systems.
Examples#
Semantic search. A standard search engine looks for exact word matches. A semantic search tool built on embeddings finds results that match the meaning of your query. If you type "affordable places to eat in Leeds", it can surface results that say "cheap restaurants near Leeds city centre" because the embeddings for both phrases are close together in vector space. This is far more useful than keyword matching alone.
Spam and duplicate detection. Email providers use embeddings to spot messages that are semantically similar to known spam, even if the exact wording has been changed. Two emails saying "Congratulations, you have won a prize" and "You are our lucky winner today" will have similar embeddings, so both get flagged -- even though no keywords overlap perfectly.
Why it matters#
Embeddings are largely invisible to end users but they are working hard behind the scenes in almost every AI product you use. Search engines, music recommendations, content feeds, and translation tools all depend on the ability to compare meaning numerically.
For people building AI applications, understanding embeddings opens up a wide range of techniques. You can use them to build your own semantic search over a document library, group similar customer feedback automatically, or detect near-duplicate content. To get started with practical AI tools and concepts, explore the AI fundamentals path or browse the tutorials hub.
Embedding: frequently asked questions
- What is a vector in the context of AI embeddings?
- A vector is simply a list of numbers. In AI, each word or piece of text is converted into a vector -- for example, a list of 768 or 1,536 numbers. The position of that list in mathematical space reflects the meaning of the text, so words with similar meanings end up with similar vectors.
- What is the difference between an embedding and a token?
- A token is a chunk of text -- roughly a word or part of a word -- that the model processes as a unit. An embedding is the numerical representation of that token (or a longer piece of text) inside the model. Tokens are the input; embeddings are how the model makes sense of them internally.
- Where are embeddings used in everyday AI products?
- Embeddings power semantic search (finding results by meaning rather than exact words), recommendation engines (suggesting content similar to what you have already read or watched), and duplicate detection (spotting near-identical documents). Any AI system that needs to compare or group pieces of text is almost certainly using embeddings under the hood.
Go deeper with related tutorials
Useful? Now picture your whole team knowing it.
Everything here is free, and the first course is too: eight short online lessons your team can start this afternoon. When you want the skills to stick, we come to you for a day on-site, built around the work your people actually do.