Vector embeddings

nounalso called embeddings or text embeddings

Definition

Vector embeddings are numerical representations of text — lists of hundreds or thousands of numbers — arranged so that passages with similar meaning sit close together, which lets search systems match a query to content by meaning rather than by shared keywords.

Updated 5 min read8 cited sources

On this page7 sections

Why it matters for founders and small teams

Embeddings are why an AI engine can match a buyer’s question to your page even when you never used their exact words, and why a page stuffed with keywords but vague on meaning loses to one that plainly answers the question. For a small team that’s good news: you don’t need an expensive keyword tool to compete, you need pages whose sections each mean one clear thing.

How do vector embeddings work?#

Vector embeddings work by running text through a model that outputs a fixed-length list of numbers, positioned so that texts with similar meaning land close together; a search system then compares the query’s vector with each passage’s vector and ranks the closest.

OpenAI’s documentation defines an embedding as a “vector (list) of floating point numbers” where “the distance between two vectors measures their relatedness” (OpenAI). Its current embedding models return 1,536 numbers (text-embedding-3-small) or 3,072 (text-embedding-3-large) for any input, from a single word to a long passage.

  • Each dimension is a learned feature, not a human-readable one. No single number means “pricing”; meaning is spread across all of them.
  • Closeness is usually measured with cosine similarity, where 1 means pointing the same way and 0 means unrelated. OpenAI recommends it, and because its embeddings are normalized to length 1, a simple dot product gives the same result.
  • The idea is old; the scale is new. Word-level embeddings went mainstream with Google’s word2vec in 2013 (Mikolov et al.), and sentence-level models such as Sentence-BERT made it practical to embed whole passages for search.

AI search engines use vector embeddings to retrieve candidate passages by meaning, usually alongside keyword matching: the query and each indexed passage are embedded, the nearest passages are pulled, and a reranker picks the few the answer will cite.

Perplexity documents this directly: lexical and embedding retrieval run in parallel and merge into one candidate set before cross-encoder rerankers make the final cut (Perplexity Research). Google has matched queries to pages by concept since neural matching arrived in Search in 2018, which it describes as understanding “how queries relate to pages” through “fuzzier representations of concepts” (Google).

0.602 vs 0.484

semantic similarity of ChatGPT prompts to the titles of pages it cited, versus pages it didn't

Ahrefs, Apr 2026

0.656

similarity of cited titles to their closest ChatGPT fan-out query — higher than to the prompt itself

Ahrefs, Apr 2026

9–19 pts

gain in top-20 passage retrieval accuracy for an embedding retriever over BM25 keyword search

Karpukhin et al., 2020

The Ahrefs figures are a correlation measured from outside, not a view inside ChatGPT, but they point the same way as the mechanism: pages whose titles mean what the engine’s sub-query means get cited more. See query fan-out for where those sub-queries come from.

Worked example

The Three-Number Similarity Walkthrough

Real embeddings have well over a thousand dimensions, but the math is the same with three. This toy example uses illustrative vectors, not output from a real model, to show why a focused section beats a catch-all one for the same question about a fictional tool called Plannora.

  1. 1

    The query vector

    “How much does Plannora cost?” Imagine three features — pricing, onboarding, security. The query is almost all pricing.

    Q = (0.9, 0.1, 0.1)

  2. 2

    A focused pricing section

    A section that states the price in its first sentence and stays on topic.

    A = (0.8, 0.2, 0.1)

  3. 3

    A catch-all overview section

    “Why teams choose Plannora” — pricing, onboarding and security in one passage.

    B = (0.5, 0.5, 0.5)

  4. 4

    Cosine similarity of Q and A

    Dot product 0.72 + 0.02 + 0.01 = 0.75. Lengths √0.83 ≈ 0.911 and √0.69 ≈ 0.831. Similarity = 0.75 ÷ (0.911 × 0.831).

    ≈ 0.99

  5. =

    Cosine similarity of Q and B

    Dot product 0.45 + 0.05 + 0.05 = 0.55. Lengths 0.911 and √0.75 ≈ 0.866. Similarity = 0.55 ÷ (0.911 × 0.866).

    ≈ 0.70

The result: Against the same question, the focused section scores 0.99 and the catch-all 0.70, even though both mention pricing. In a real engine, a gap like that decides which passage reaches the reranker’s short list. Split catch-all sections into one question each, and every one of them gets its own chance to be the closest match.

Free to use and adapt. If you cite it, link to rankbox.xyz/glossary/vector-embeddings.

Vector embeddings vs keywords: what's the difference?#

Keyword matching scores a page on the exact words it shares with the query, while vector embeddings score it on shared meaning — so embeddings can match “cheap tool to track sales leads” to a page about “affordable CRM for small teams” with no words in common.

Keyword matching (BM25)Vector embeddings
Matches onExact terms and how often they appearMeaning and intent
Synonyms and paraphrasesMissed unless the words overlapMatched — similar meanings land close together
Strong atNames, product codes, rare terms, numbersConversational questions, different wording
Weak atDifferent words for the same ideaExact identifiers the query depends on
Used in AI search?Yes — lexical retrievalYes — semantic retrieval

Engines use both because each covers the other’s blind spot. Anthropic’s contextual retrieval research notes that embedding models “can miss crucial exact matches” and pairs them with BM25, which is “particularly effective for queries that include unique identifiers or technical terms.” For your pages the lesson is to write for both: explain the idea naturally, and still use the exact names buyers type — product names, category terms, units. See semantic search.

How do you optimize content for vector embeddings?#

Optimize content for vector embeddings by making each section mean one thing: a heading phrased like the question, a first sentence that answers it, and a body that stays on topic — because an embedding blends everything in a passage into a single point.

  1. One question per section. A passage that covers pricing, onboarding and security embeds to a point between all three and matches none of them well.
  2. Phrase headings as buyers ask. “How much does Plannora cost for a team of five?” sits closer to that question than “Flexible plans for every stage.”
  3. Answer in the first sentence. It anchors the passage’s meaning and is the part most likely to be quoted. See answer-first content.
  4. Keep the subject explicit. Name the product instead of writing “it”, because the passage is embedded without the paragraph before it. See content chunking.
  5. Don’t chase synonyms. Google tells site owners that “AI systems can understand synonyms and general meanings,” so repeating variants adds noise, not coverage.

Sources

  1. 1.Vector embeddingsOpenAI API · developers.openai.com
  2. 2.Efficient Estimation of Word Representations in Vector SpaceMikolov et al., Google, 2013 · arxiv.org
  3. 3.Sentence-BERT: Sentence Embeddings using Siamese BERT-NetworksReimers & Gurevych, EMNLP 2019 · arxiv.org
  4. 4.Dense Passage Retrieval for Open-Domain Question AnsweringKarpukhin et al., EMNLP 2020 · arxiv.org
  5. 5.Architecting and evaluating an AI-first search APIPerplexity Research · research.perplexity.ai
  6. 6.Why ChatGPT cites the pages it doesAhrefs · ahrefs.com
  7. 7.Optimizing your website for generative AI featuresGoogle Search Central · developers.google.com
  8. 8.Introducing Contextual RetrievalAnthropic · anthropic.com

Know someone who’d find this useful? Send it their way.

Written by

Rankbox Team

The team behind Rankbox. We study how ChatGPT, Perplexity, Gemini, and Google AI Overviews choose their sources, and publish what we learn so you can put it to work.

See which AI answers cite you today

Enter your site to see how often ChatGPT, Perplexity, Gemini, and Google cite your brand, and exactly what to publish next.

No credit card required · Free 7-day trial