From Keyword Matching to Meaning
How Embeddings Capture Meaning
3 min read
Every text becomes a point
An embedding model takes a piece of text and outputs a list of numbers — typically hundreds or thousands of them. Mathematically, that list of numbers is a point in a high-dimensional space. Texts with similar meaning are trained to land close to each other in that space; texts with unrelated meaning land far apart.
You can't easily draw a 768-dimensional space, but the intuition holds even in two dimensions:
Diagram — A Query Lands Near Its Closest Match in Vector Space
Dense retrieval is nearest-neighbor search
This is the entire trick behind dense retrieval: a search query gets embedded into the same vector space as the documents, using the same embedding model. Finding "the best matching document" becomes finding "the document vector nearest to the query vector" — a well-understood geometry problem, not a language problem.
Think of it like dropping a pin on a map app and asking "what's the nearest coffee shop?" Every coffee shop already has a fixed spot on the map; your pin gets a spot too, using the same coordinate system; and the app just measures which shop's dot is physically closest to your dot. Dense retrieval works the same way, except the "map" has hundreds of dimensions instead of two, and distance represents similarity in meaning instead of physical distance.
That's a meaningful shift. A keyword search engine has to reason about words and their variants. A dense retrieval system just has to measure distance between points — the hard part (understanding what the text means) already happened when the embedding model produced the vectors in the first place.
Why this beats keyword matching
Because embeddings capture meaning rather than exact wording, semantically related phrases land near each other even when they share no words at all. "How do I get my money back?" and "Refund Policy" can sit close together in vector space, even though "money" never appears in the policy document. A keyword index would never make that connection; a vector index does it by default.
Key takeaway
An embedding model turns text into a point in space. Similar meaning means nearby points. Search becomes "find the nearest point to my query" — geometry standing in for language understanding.
What's next?
Now that the core geometric idea is in place, it's time to see the full pipeline that puts it to work: retrieval-augmented generation, from raw documents to a generated, sourced answer.