Embeddings

Embeddings are dense numerical vectors that encode the meaning of text — how semantic search, Google's ranking, and RAG match content by meaning instead of keywords.

First published: Jun 24, 2026 · Last updated: Jul 15, 2026 · Advanced
demand #8 in How Search Works#13 in AI Search#108 on the site

An embedding is a list of numbers — a dense vector — that encodes the meaning of a word, sentence, or document in a high-dimensional space, so semantically similar text lands close together. Encoder models, not generative LLMs, produce them; similarity is measured with cosine similarity. Embeddings power semantic search, clustering, and the retrieval layer in RAG, and Google uses embedding-based retrieval (Neural Matching / RankEmbed, RankEmbedBERT) alongside its keyword index. The SEO upshot is not a knob to turn — Danny Sullivan said of BERT 'there's nothing to optimize for' — but topically coherent content clusters cleanly near the queries it should answer.

TL;DR — An embedding is a dense vector of floating-point numbers (typically hundreds to a few thousand dimensions) that encodes meaning, produced by an encoder model — not a generative LLMA large language model (LLM) is a deep-learning model trained on massive text corpora to predict the next token and generate human-like text. LLMs use the transformer architecture and power AI search features like Google's AI Overviews (Gemini) and Bing Copilot (GPT-4).. Similar meaning → nearby vectors, measured with cosine similarity. The field moved from static word embeddingsEmbeddings are dense numerical vectors — lists of floating-point numbers — that represent the meaning of text in a high-dimensional space. Semantically similar content lands close together, so search and AI systems can match by meaning, not just keywords. (word2vec, GloVe) to contextual ones (BERTSemantic search is meaning-based retrieval — matching what a user means, not just the words they typed. Search engines detect entities, expand synonyms, infer intent, and rank by conceptual relevance, which is why keyword stuffing lost its power and topical depth gained it.) to sentence-level and modern API embeddings. Google uses embedding-based retrieval (Neural Matching / RankEmbed, RankEmbedBERT) alongside its keyword indexStoring a crawled page in the search index so it can appear in results. Crawled is not the same as indexed — Google selects what to keep, and indexing isn't guaranteed. — hybrid, not a replacement. Embeddings are also the retrieval backbone of RAGRAG is the retrieve-then-generate pattern behind AI search: the system retrieves relevant passages from an external index at query time, injects them into the model's context, and generates an answer grounded in those sources — without changing the model's weights.. There’s no embedding knob to turn; topical coherence is what makes content cluster near the right queries.

What an embedding actually is

Embeddings support similarity and retrieval, but they are not a direct measure of truth, quality, or ranking value. Evidence for this claim Embeddings represent inputs as numerical vectors that can be compared for relatedness and used for search, clustering, and classification. Scope: OpenAI embedding models and documented uses; vector dimensions and behavior vary by model. Confidence: high · Verified: OpenAI: Embeddings guide Research results depend on the trained model and evaluation setting. Evidence for this claim Learned vector representations can encode useful distributional relationships between words. Scope: Word2vec-era language representations; observed vector relationships are model- and training-data-specific, not ground truth. Confidence: high · Verified: Mikolov et al.: Efficient Estimation of Word Representations

An embedding is a dense numerical vector — a list of floating-point numbers — that represents text (or images, audio, video) as a point in a high-dimensional space. OpenAI’s documentation states it plainly: “An embedding is a vector (list) of floating point numbers.”

The defining property is geometric: semantically similar content has similar vectors. Text that means roughly the same thing points in roughly the same direction; unrelated text points elsewhere. That’s not a happy accident — the model is trained so that words and phrases used in similar contexts end up with similar vectors. Meaning becomes position.

Embeddings turn semantic similarity into distance: related meanings land nearby even when the exact wording differs. Source: /ai-search/how-search-works/embeddings/

A conceptual semantic space places the query reset my password near documents titled Forgot-password guide, Account recovery steps, and Cannot log in. The unrelated document Enterprise pricing sits farther away. Near means more semantically similar; far means less similar. Actual embedding spaces have many more dimensions and model-specific geometry.

© Patrick Stox LLC · CC BY 4.0 ·

A few things worth getting precise:

  • Encoder, not generator. Embeddings come from encoder models whose job is to compress meaning into a fixed-size vector. That’s a different architecture and purpose from a generative LLM, which predicts the next tokenA token is the smallest unit of text (or image/audio/video) an LLM processes — roughly 4 characters, or about ¾ of an English word. A context window is the maximum number of tokens (input plus output) a model can hold at once, like its short-term memory.. (More on the internal-vs-API distinction below.)
  • Dense, not sparse. Unlike one-hot or bag-of-words representations (mostly zeros, one slot per vocabulary word), embeddings pack meaning into every dimension. Google’s ML glossary frames embeddings as lower-dimensional, dense representations that fix what one-hot encoding can’t express — they let a model recognize that “hot dogs and shawarmas are more related than hot dogs and salads.”
  • Higher dimensions ≠ always better. More dimensions can capture more nuance, but they cost more to store and compute, and the gain is task-dependent. It’s a trade-off, not a “bigger is better” dial.

Measuring similarity: cosine similarity

To compare two embeddings you measure the distance — or really the angle — between them. The standard metric is cosine similarity: it measures the angle between two vectors regardless of their length, scoring from −1 (opposite) through 0 (unrelated/orthogonal) to 1 (identical direction). Smaller distance = more related.

Many embedding APIs normalize vectors to unit length, which makes cosine similarity and dot product produce the same ranking — OpenAI notes cosine is the conventional, slightly cheaper choice. Voyage AI (the embedding provider Anthropic recommends) puts the intuition cleanly: “the cosine similarity between two embeddings captures the semantic relatedness of the corresponding original passages.” Doing that nearest-neighbor comparison at scale is its own problem — that’s the job of vector searchVector search finds content by comparing the meaning of a query against stored content as numerical vectors, retrieving the closest ones in a high-dimensional embedding space. At scale it uses approximate nearest neighbor (ANN) algorithms — not exact comparison — to search billions of vectors in milliseconds..

How we got here: the evolution

The story runs from single words to whole passages, and from fixed meanings to context-aware ones.

  • word2vec (Google, 2013). Mikolov et al. introduced two architectures (CBOW and Skip-Gram) for learning dense word vectors from huge corpora. The famous result: the vector “King” − “Man” + “Woman” lands closest to “Queen” — evidence that vector arithmetic captures semantic relationships. (Caveat: that analogy is illustrative, not guaranteed every time; depending on the model it can land on “kings” or “monarch.”) These are static embeddings — one fixed vector per word, so “bank” gets the same vector in “river bank” and “bank account.”
  • GloVe (Stanford, 2014). A count-based alternative built on global co-occurrence statistics rather than a predictive network — different objective, similarly useful embeddings. Also static.
  • Universal Sentence Encoder (Google, 2018). Embeddings for whole sentences, not just words. The core idea: “Sentences are semantically similar if they have a similar distribution of responses” — “How old are you?” and “What is your age?” invite the same answers, so they embed close together.
  • BERT (Google, 2018; deployed in Search Oct 2019). The big shift: contextual embeddings. The same word gets a different vector depending on the surrounding sentence, because BERT is bidirectional — it reads the words before and after a token to fix its meaning. So “bank” in “river bank” and “bank account” finally get different vectors.
  • Sentence-BERT (2019). Solved BERT’s scaling problem for similarity search. Vanilla BERT needs both sentences fed in together, which is computationally brutal at scale; SBERT produces fixed-size sentence embeddings you can compare with cosine similarity, cutting the cost of finding the most similar pair in a large corpus from hours to seconds.
  • Modern embedding APIs (2024–present). OpenAI’s text-embedding-3 family, Google’s Gemini embeddings, Voyage, and Cohere’s embed-v4.0 — multilingual, increasingly multimodal (text, image, audio, video in one space), and resizable via Matryoshka Representation Learning (truncate the vector to fewer dimensions without retraining, trading a little accuracy for storage and speed).

Google’s ranking pipeline isn’t purely semantic or purely keyword — it’s hybrid, and the embedding pieces supplement the classic inverted index rather than replacing it. From Google’s own ranking-systems documentation and Pandu Nayak’s DOJ antitrust testimony, the named systems include:

  • BERT — Google’s words-in-context system. At launch it helped Search “better understand one in 10 searches in the U.S. in English,” especially longer conversational queries where prepositions like “for” and “to” change the meaning.
  • Neural Matching / RankEmbed — embedding-based retrieval that translates queries and documents into the same vector space to surface conceptually matching results even without shared keywords. Nayak described it as a supplement: “RankEmbed identifies a few more documents to add to those identified by the traditional retrieval.” Retrieval there is based on a dot product / distance measure in the embedding space.
  • RankEmbedBERT — a later evolution combining RankEmbed’s retrieval with BERT’s language understanding, trained on quality-rater scores and search logs, and notably better on complex, long-tail queries.

The practical reading: keyword presence still matters because lexical retrieval (the inverted index, BM25-style) still does the first-pass narrowing. The embedding systems add conceptually-related candidates and re-rank. Both signals are in play — which is exactly why “BERT killed keywords” is wrong.

Embeddings in AI search (the RAG pipeline)

This is where embeddings touch AI OverviewsAI Overviews are the AI-generated summary box Google shows above or within its regular search results, written by Gemini models from pages retrieved out of Google's normal Search index. It's a Search feature, not a separate platform or index. and AI searchAI search uses large language models and retrieval-augmented generation (RAG) to synthesize an answer from multiple sources rather than returning a ranked list of links. Examples include Google AI Overviews, ChatGPT Search, and Perplexity. assistants most directly. Retrieval-Augmented Generation (RAG) uses embeddings as its retrieval layer:

  1. Index: content is chunked into passages, each passage is embedded, and the vectors go into a vector database.
  2. Retrieve: the user’s query is embedded, a nearest-neighbor search finds the closest chunks (via vector searchVector search finds content by comparing the meaning of a query against stored content as numerical vectors, retrieving the closest ones in a high-dimensional embedding space. At scale it uses approximate nearest neighbor (ANN) algorithms — not exact comparison — to search billions of vectors in milliseconds.), and the top-K chunks are handed to the LLM as context.
  3. Generate: the LLM writes an answer grounded in those retrieved chunks.

Structure matters here because each chunk is retrieved in isolation. Dan Petrovic’s research (cited in Ahrefs’ What We Actually Know About Optimizing for LLM Search) found Chrome processes only the first ~30 passages of a page for embeddings and chunks them in roughly 200-word passages with overlap to preserve cross-chunk context. If a section can’t stand on its own once it’s pulled out of the page, it represents your content poorly.

Token embeddings vs. text embedding APIs

A distinction that trips people up: the embeddings inside an LLM and the embeddings you get from an API are not the same thing.

  • Token embeddings are the model’s internal representations — each token gets a vector that’s transformed layer by layer during generation. They’re machinery for producing the next token.
  • Text embedding APIs (OpenAI, Google, Voyage, Cohere) produce a single fixed-size vector for an entire input string, purpose-built for retrieval and similarity. Often a separate model with a different training objective.

When SEOs talk about “embedding a page” or running cosine similarity for internal linking or keyword clustering, they mean the API kind.

What this means for SEO

  • Semantic coherence beats keyword density. Because models understand context, “laptop for gaming” and “high-performance laptop” already sit close. Stuffing doesn’t help — it produces topically scattered content with a muddier embedding.
  • Structure for chunked retrieval. Passages get embedded and retrieved on their own. Put important content early, keep sections self-contained, use clear semantic HTML.
  • Topical comprehensiveness. Content that genuinely covers a subject ends up near more of the related queries in vector space. That’s the mechanism behind “build topical authority.”
  • There’s no embedding knob. Danny Sullivan, on BERT: “There’s nothing to optimize for… The fundamentals of us seeking to reward great content remain unchanged.” The cosine-similarity scores you get from a tool are analysis aids, not inputs you submit to Google.

Embeddings are the connective tissue under most of this cluster: they’re what semantic searchSemantic search is meaning-based retrieval — matching what a user means, not just the words they typed. Search engines detect entities, expand synonyms, infer intent, and rank by conceptual relevance, which is why keyword stuffing lost its power and topical depth gained it. runs on, what vector search compares, what chunkingChunking is splitting a document into smaller passages so AI systems can embed, index, and retrieve the single most relevant piece — not the whole page — in response to a query. It's a foundational step in RAG pipelines and the conceptual cousin of Google's passage ranking. prepares text for, and the retrieval backbone of RAG. They’re also why crawlingCrawling is how search engines use automated bots (like Googlebot and Bingbot) to discover URLs and download pages. A page has to be crawlable to be indexed, but crawling on its own isn't a ranking factor. still matters first — content has to be fetched before any system can embed it.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.