Skip to content
AI-Arena

Embeddings Explained

· AI-Arena Editorial

An embedding turns text into a list of numbers — a vector — where texts with similar meaning land near each other. That one trick powers semantic search, dedup, clustering, and the “R” in RAG.

The One-Paragraph Version

A model reads your text and outputs, say, 1,024 numbers. Encode “How do I reset my password?” and “I can’t log in” and the vectors end up close together even though the words share nothing. Search becomes geometry: to find documents about a query, encode the query and measure distances.

Where You Meet Embeddings

  • Semantic search: the nearest-vectors lookup behind “did you mean” and knowledge-base search.
  • RAG: retrieve the top-k chunks relevant to a question, then let a generation model answer from them.
  • Clustering & dedup: group support tickets, near-duplicate docs, feedback themes.
  • Classification-lite: nearest labeled examples decide the category — no training run needed.

The Specs That Matter

SpecWhy it matters
DimensionsVector width; bigger isn’t better, it’s bigger storage and slower scans
Context windowChunks must fit; a 512-token ceiling fragments long documents
MTEB-style eval scoresRetrieval quality benchmarks — read them with a harness mindset
Price per 1M tokensEncoding a whole corpus costs; re-encoding on every model switch costs more

The Switching Cost Nobody Budgets

Embeddings from different models are not comparable — different models produce different coordinate systems. Switch your embedding model and every stored vector is stale: you re-encode the entire corpus and re-run any hybrid search tuning. That’s why the embedding choice is stickier than the generation choice, and why “free trial credits” on a new embedding API hide a migration bill.

Picking One, Practically

  1. Start with a well-documented general retrieval model — measured on public retrieval evals, from a provider with a spec sheet you can verify.
  2. Chunk to fit its context window with overlap; bad chunking beats good models.
  3. Evaluate on your queries: take 50 real questions, check whether the right document lands in the top 5. That beats any public benchmark for your use case.
  4. Only then look at price — retrieval quality failures cost more than tokens ever will.