# What is dense retrieval?

> Dense retrieval finds passages by comparing embeddings of the query and each passage, so it can match text that uses other words for the same meaning.

Canonical: https://promptlyfound.com/glossary/dense-retrieval
Updated: 2026-12-01

## Short answer

Dense retrieval is **retrieval that compares embeddings of the query and of each passage, instead of matching their words**. A model turns each text into a dense vector of numbers, and the system returns the passages whose vectors are closest to the query vector. It can find a passage that shares no words with the query. Keyword methods such as BM25 are called sparse retrieval.

## Key findings

- A dense passage retriever that searched by embeddings alone outperformed a Lucene BM25 system by 9 to 19 percentage points in top-20 passage retrieval accuracy. [1]
- In the BEIR benchmark of 18 datasets, dense retrieval models were more efficient than reranking models but often performed worse on datasets they were not trained for. [2]
- In OpenAI's example, the passage 'The first lunar landing occurred in July of 1969.' scored 0% keyword similarity and 65% semantic similarity with the query 'When did we go to the moon?' [3]

Dense retrieval is the embedding side of AI retrieval. It lets a system find a passage for a question even when the passage uses different words.

## How does dense retrieval work?

Dense retrieval compares vectors instead of words. The [Dense Passage Retrieval paper](https://arxiv.org/abs/2004.04906) uses a dual-encoder framework. One encoder turns questions into embeddings, and another turns passages into embeddings. The authors trained the encoders on a small number of questions and passages.[1]

A system embeds every passage in advance and stores the vectors, often in a [vector database](https://promptlyfound.com/glossary/vector-database). At query time, it embeds the query and looks for the closest stored vectors. A similarity measure such as [cosine similarity](https://promptlyfound.com/glossary/cosine-similarity) scores how close each one is.

Microsoft's page on [relevance in Azure AI Search vector search](https://learn.microsoft.com/en-us/azure/search/vector-search-ranking) describes two ways to find the closest vectors. Exhaustive k-nearest neighbors (KNN) scans the whole vector space. Hierarchical Navigable Small World (HNSW) runs an approximate nearest neighbor search over a graph, which is faster. A query parameter, k, sets how many nearest neighbors to return.[4]

## What is the difference between dense and sparse retrieval?

Sparse retrieval matches the words in the query, and dense retrieval matches meaning. The DPR paper calls sparse vector models such as TF-IDF and BM25 the standard method for passage retrieval in open-domain question answering.[1]

[OpenAI's retrieval guide](https://developers.openai.com/api/docs/guides/retrieval) shows the difference with the query "When did we go to the moon?" The passage "The first lunar landing occurred in July of 1969." scored 0% keyword similarity and 65% semantic similarity. The passage "When I ate the moon cake, it was delicious." scored 40% keyword similarity and 28% semantic similarity. OpenAI computed semantic similarity as cosine similarity between text-embedding-3-small embeddings.[3]

Dense retrieval can miss exact matches. [Anthropic's post on Contextual Retrieval](https://www.anthropic.com/news/contextual-retrieval) gives the query "Error code TS-999" as an example. An embedding model might find content about error codes in general but miss the exact code, which BM25 finds.[5] For this reason, many systems run both in [hybrid search](https://promptlyfound.com/glossary/hybrid-search).

## How well does dense retrieval work?

Results depend on the data. The DPR paper reports that its dense retriever beat a strong Lucene BM25 system by 9 to 19 percentage points in top-20 passage retrieval accuracy, on a wide range of question answering datasets.[1]

The [BEIR benchmark](https://arxiv.org/abs/2104.08663) tested 10 retrieval systems on 18 public datasets that the models had not been trained on. BM25 was a strong baseline. Dense retrieval models were more efficient than reranking models but often performed worse than other approaches.[2]

## Why is dense retrieval used in AI search?

Dense retrieval decides which passages match a question by meaning. A page can be retrieved for a question whose exact words it does not contain, if its text answers the same need. OpenAI says semantic search can surface results that share few or no keywords with the query.[3]

[What are vector embeddings?](https://promptlyfound.com/llms/embeddings) explains how embeddings are made and compared. [What is semantic search?](https://promptlyfound.com/ai-search/semantic-search) compares search by meaning with keyword search.

## Sources

1. Dense Passage Retrieval for Open-Domain Question Answering. arXiv, 2020-04-10. https://arxiv.org/abs/2004.04906
2. BEIR: A Heterogenous Benchmark for Zero-shot Evaluation of Information Retrieval Models. arXiv, 2021-04-17. https://arxiv.org/abs/2104.08663
3. Retrieval. OpenAI API documentation. https://developers.openai.com/api/docs/guides/retrieval
4. Relevance in vector search. Microsoft Learn. https://learn.microsoft.com/en-us/azure/search/vector-search-ranking
5. Introducing Contextual Retrieval. Anthropic, 2024-09-19. https://www.anthropic.com/news/contextual-retrieval

---

This is a plain-text copy of https://promptlyfound.com/glossary/dense-retrieval from Promptly Found. The web page is the canonical version and includes the charts.
