From Keyword Matching to Meaning

Three Ways Language Models Power Search

3 min read

Three names, one underlying idea

Research on using language models for search tends to fall into three broad categories. They're often combined in the same system, but each answers a different question.

Diagram — Three Ways Language Models Power Search

1. Dense retrievalSearch queryDense retrievalText index (documents)Results1. Document #402. Document #682. RerankingQuery + small candidate setRerankerReordered results1. Doc #2 (was #3)2. Doc #40 (was #1)3. Retrieval-augmented generationQuestionRAGGenerated answer"...possible answer [1],with sources cited"

Dense retrieval

Dense retrieval reframes "search" as a nearest-neighbor problem: convert the query into a vector, convert every candidate document into a vector, and return whichever documents sit closest to the query in that vector space. It's called "dense" because every dimension of the vector typically holds a non-zero value — as opposed to older sparse, keyword-based representations where most values are zero.

This is the workhorse of semantic search. It's fast, it scales to millions of documents, and it's the foundation the rest of this course builds on.

Reranking

Dense retrieval is optimized for speed across a huge collection, which means it sometimes settles for "pretty close" instead of "best." Reranking adds a second, more careful pass: take the small set of candidates retrieval already found, and use a more expensive model to re-score and reorder just those few, so the truly best matches float to the top.

Think of it as a two-round hiring process — a fast first pass narrows thousands of applicants down to a shortlist, then a slower, more thorough review decides the final order.

Retrieval-augmented generation (RAG)

Dense retrieval and reranking both return a list of documents. RAG goes one step further: it feeds retrieved documents into a language model and asks it to generate an answer grounded in them, ideally with the sources cited. The growth of capable text-generation models is what made this possible — a search engine that used to hand you ten blue links can now hand you a written answer.

How they combine

These three aren't competitors — they're commonly stacked. A production system might use dense retrieval to pull back a few hundred candidates, a reranker to narrow those down to the handful that matter most, and RAG to turn that final handful into a single written, sourced answer. The rest of this course walks through how each stage of that stack actually works.

Key takeaway

Dense retrieval finds candidates by vector similarity, reranking re-scores a small candidate set more carefully, and RAG uses retrieved material to generate a grounded answer instead of just returning a list. They're layers of the same pipeline, not rival techniques.

What's next?

All three approaches depend on the same trick: representing meaning as points in space. Next, we'll build the intuition for what that space actually looks like.