Token and embedding are concepts in the spotlight today, whether in the study and application of Artificial Intelligence (AI) and Large Language Models (LLMs), or in the development of agents, applications, tools, and businesses, but they have been present in SEO for a long time! You might tell me: but Alex, how so? I only started hearing about this after GPTs took over everything!
So stay with me, I will show you how this used to work, and how it works today in the search landscape. Let’s start from the beginning with tokens.

What are tokens?
A token is an individual unit of a text. Imagine a sentence that has been broken down into its smallest meaningful parts; those parts are the tokens. To illustrate, let’s take a simple sentence:
In the sentence: “Semantic search improves search quality.”
When we apply basic tokenization (separation by spaces and punctuation), the tokens would be:
[“Semantic”, “search”, “improves”, “search”, “quality”, “.”]
In this example, each word and the period are considered distinct tokens, considering that this system performs basic tokenization. More sophisticated systems could, for example, treat “Semantic search” as a single token if it were a named entity or a frequently searched concept, and even if it were present in the corpus of texts used for training.
In the past, in the context of traditional search, or search by search term (token-based search), the system worked by dividing the text into these tokens. They were then used to create a type of numeric representation called a sparse embedding. Think of this type of embedding as a long list that shows how many times each word or sub-word appears in a text.
The main characteristic here is that sparse embeddings do not consider the meaning of the words, only the frequency of their appearances. It is like a library index, where you search for exact search terms.
To illustrate again, let’s think we have a sentence like the one in the example above. Then it is “tokenized” (divided into tokens) so that the system can index it and compare it with the exact terms of your query. There are classic algorithms used to generate sparse embeddings, such as TF-IDF (Term Frequency-Inverse Document Frequency), BM25, or SPLADE.
TF-IDF, for example, gives more weight to terms that are frequent in a specific document but rare in the general corpus, highlighting their importance for that document. In general, however, all of them only consider term frequency.
Historically, search was more deterministic, meaning that content was indexed exactly as it came in, without much interpretation by algorithms. Documents were “decomposed” in what we call a “lexical” way, basically counting term distribution. This contrasts with current information retrieval models, which are semantic. And to reach semantics, another concept is essential: embeddings!
What are (dense) embeddings?
An embedding, on the other hand, is a numerical representation of terms or text, specifically as numerical vectors, that capture semantic relations and contextual information. Imagine each term or text as a point on a multidimensional “map”, where proximity between points indicates similarity of meaning. The distance and direction between these vectors encode the degree of semantic similarity among terms.

Why then do we need this, you might ask.
Because most machine learning algorithms cannot process raw text without treatment; they need to use numbers as input. This is where embeddings are used.
Thus, these embeddings are created by embedding models (which deserve an article of their own), which are trained by scanning vast volumes of text, such as all of Wikipedia, for example, which is where the term LLMs comes from: large language models. You use this absurd volume of text so that these models can learn the relations between terms and their contexts.
This process involves:
- Pre-processing: tokenization and removal of stop words (common terms like “the”, “and”) and punctuation.
- Sliding context window: identifies target terms and their contexts so the model can learn their relations.
- Training: the model is trained to predict terms based on their context, positioning semantically similar terms close to each other in vector space. Model parameters are adjusted to minimize prediction errors.

These embeddings are also known as dense embeddings, and they got this name because the matrices representing them contain mostly non-zero values, unlike sparse ones. It took me a long time to understand this concept, but cutting a long story short to my understanding, statistics are used to densify a large number of points in this graph, grouping them by similarity, which helps in several aspects, including system performance. From what I understood, I eliminate the 0s and look for meaningful values.
Correct me in the comments, please, if I said anything foolish here.
But what matters for our article is that they are extremely efficient for creating models that understand the meaning and context of terms.
For example, in a system using one of these models, a search for “movie” may also return relevant results with “cinema” or “feature film”, since the embedding model understands that these terms share similar meanings. This significantly improves search quality.
Embeddings in information retrieval: an old subject
Google has been incorporating this technology into its search for years!
RankBrain, launched back in 2015, was the first deep learning system deployed in search, which at that time already helped understand how terms relate to concepts.
In 2018, Neural Matching made it possible to understand how queries relate to pages by looking at the query or entire page as a whole, rather than just search terms.
BERT, in 2019, was a major breakthrough in natural language understanding, helping to grasp how combinations of terms express different meanings and intents.
And MUM, from 2021, was launched as an advancement for being a thousand times more powerful than BERT, capable of understanding and generating language, being multimodal (text, images, etc.) and trained in 75 languages. This ushered in multimodal search, meaning various types of content, not just text, were transformed into embeddings. Transformed, does that remind you of anything?
To optimize this process, documents are also decomposed at a vector embedding level for indexing. Shall we organize all of this into a table to understand it better? That’s what I did to understand it.
Fundamental differences between tokens and embeddings:
| Feature | Token | Embedding (Dense) |
|---|---|---|
| Representation | Raw text units (words, subwords) | Numeric vectors |
| Focus | Word frequency and text syntax | Semantic meaning and context |
| Similarity | Based on exact search terms and their distribution | Based on proximity of meaning in vector space |
| Primary Use | Traditional search by term (lexical search) | Semantic search and AI applications requiring comprehension of meaning |
| Dimensionality | Can have tens of thousands of dimensions, with many zeros (sparse) | Generally hundreds or thousands of dimensions, with predominantly non-zero values (dense) |
| Examples | TF-IDF, BM25, SPLADE | Models like Word2Vec, GloVe, and newer ones like BERT, MUM, Gemini |
Hybrid search, AI, tokens, and embeddings
The main takeaway from this shift is that for efficient search retrieval with Artificial Intelligence, you do not use just one or the other, but rather a strategic combination: Hybrid Search. For those wanting to know what this is, click the link I provided; it will take you to an article on LinkedIn originating from research I conducted on the subject.
In short, hybrid search combines semantic search with vector search to address a very specific need: finding similarities outside a domain of knowledge and enabling the system you created and trained to understand entities outside of it.
Why you need hybrid search
You will need it in very specific cases, such as when building an agent that interacts with clients who might ask questions outside the knowledge domain your model was trained on. Think about your business: does this possibility exist? If so, it is wise to stay informed about this search model.
Semantic search, despite being very effective, has a drawback: it may struggle with out-of-domain information, meaning data upon which the embedding model was not trained. Remember when Claude and ChatGPT prompts leaked and we saw they perform searches outside of training data? It is designed to cover this gap, while also including specific product numbers, new product names, or internal company codes, for example.
In such cases, semantic search “comes up empty” because it can only find what it already “knows.” If the user needs something outside the model’s knowledge, it resorts to token-based search to bridge this gap.
Hybrid search, by integrating semantic search (for subtler and more contextual queries) with traditional search by terms (for specific, out-of-domain terms), aims for the “best of both worlds,” ensuring a more comprehensive and precise search experience due to the specific needs of AI models, something that did not happen in Google before the
