Dense Passage Retrieval (DPR) is a retrieval architecture employing a dual-encoder framework where separate BERT-based encoders independently map questions and text passages into a shared, low-dimensional dense vector space. Relevance is computed via maximum inner product search (MIPS) between the resulting embeddings, enabling efficient semantic matching beyond lexical keyword overlap.
Glossary
Dense Passage Retrieval (DPR)

What is Dense Passage Retrieval (DPR)?
Dense Passage Retrieval (DPR) is a bi-encoder neural architecture that uses dense vector representations to retrieve relevant knowledge base passages for candidate generation in open-domain entity linking and question answering.
The model is trained using a contrastive loss with in-batch negatives, where the correct passage forms a positive pair and all other passages in the batch serve as negatives. This training regime teaches the encoder to distinguish relevant from irrelevant passages, making DPR a foundational component for retrieval-augmented generation (RAG) and open-domain entity linking pipelines.
Key Features of DPR
Dense Passage Retrieval (DPR) is a bi-encoder neural architecture that uses dense vector representations to retrieve relevant knowledge base passages or entity descriptions for candidate generation in open-domain entity linking. Its core innovation is the independent encoding of questions and passages into a shared dense space where relevance is computed via dot product similarity.
Dual-BERT Bi-Encoder Architecture
DPR employs two independent BERT-based encoders—one for questions and one for passages—that map text into dense, fixed-size vectors. Unlike cross-encoders that process question-passage pairs jointly, bi-encoders allow offline pre-computation of all passage embeddings, enabling sub-linear retrieval via approximate nearest neighbor search. The question encoder and passage encoder are trained simultaneously using a contrastive loss that maximizes the similarity between relevant pairs while minimizing it for in-batch negatives.
Contrastive In-Batch Negative Training
DPR is trained using a contrastive learning objective with in-batch negatives. For each relevant question-passage pair in a training batch, all other passages in the same batch serve as negative examples. This approach is computationally efficient because it reuses passage embeddings already computed for the batch. The loss function is a negative log-likelihood over the softmax of similarity scores, forcing the model to distinguish the true passage from a large pool of distractors without requiring explicit hard-negative mining.
Dense vs. Sparse Retrieval Paradigm
DPR represents a fundamental shift from traditional sparse retrieval methods like BM25 and TF-IDF. Where sparse methods rely on exact lexical overlap and bag-of-words representations, DPR captures semantic similarity in a learned continuous space. Key advantages include:
- Synonym handling: 'automobile' and 'car' map to similar vectors
- Cross-lingual potential: multilingual encoders can align semantically equivalent passages across languages
- Paraphrase robustness: reworded queries retrieve the same relevant passages This semantic capability is critical for entity linking where surface forms vary widely.
Candidate Generation for Entity Linking
In entity linking pipelines, DPR serves as the candidate generation module that retrieves a shortlist of potential knowledge base entries for a given entity mention. The mention and its surrounding context are encoded as the query, while entity descriptions from Wikidata or a proprietary knowledge base form the passage index. DPR typically achieves recall@100 > 90% on standard benchmarks, dramatically reducing the search space for downstream disambiguation models while maintaining high coverage of the correct entity.
Index Refresh and Incremental Updates
Production DPR deployments require strategies for maintaining index freshness as knowledge bases evolve. Common approaches include:
- Full re-indexing: periodic batch recomputation of all passage embeddings when the underlying BERT model is fine-tuned
- Incremental indexing: computing embeddings only for newly added or modified passages and inserting them into the FAISS index
- Versioned indices: maintaining multiple index snapshots to support A/B testing of different encoder checkpoints Efficient index management is essential for entity linking systems that must reflect real-time knowledge base updates.
Frequently Asked Questions
Clear, technically precise answers to the most common questions about Dense Passage Retrieval (DPR), the bi-encoder architecture that revolutionized open-domain question answering and entity linking candidate generation.
Dense Passage Retrieval (DPR) is a bi-encoder neural architecture that uses dense vector representations to retrieve relevant passages from a large corpus for open-domain question answering and entity linking. It works by independently encoding both the query and each candidate passage into fixed-size dense vectors using two separate BERT-based encoders, then computing relevance via maximum inner product search (MIPS) between the query vector and all passage vectors. Unlike sparse retrieval methods like BM25 that rely on exact term matching, DPR captures semantic similarity in a continuous latent space, allowing it to retrieve passages that answer a question even when they share no overlapping keywords. The system is trained using a contrastive loss function with in-batch negatives, where positive pairs (question, relevant passage) are pulled together in the embedding space while negative pairs are pushed apart. At inference time, passage embeddings are pre-computed and indexed using FAISS for efficient approximate nearest neighbor search, enabling sub-second retrieval across millions of documents.
DPR vs. Sparse Retrieval Methods
A technical comparison of dense vector retrieval against traditional sparse lexical methods for candidate generation in entity linking and open-domain QA.
| Feature | Dense Passage Retrieval (DPR) | BM25 (Sparse Lexical) | TF-IDF (Sparse Lexical) |
|---|---|---|---|
Representation Basis | Dense vectors in latent semantic space (768-dim BERT embeddings) | Sparse bag-of-words vectors with term saturation curves | Sparse bag-of-words vectors with inverse document frequency weighting |
Vocabulary Mismatch Handling | |||
Exact Term Matching | |||
Training Data Required | Large-scale question-passage pairs for fine-tuning | ||
Top-20 Retrieval Accuracy (Natural Questions) | 78.4% | 59.1% | 52.3% |
Indexing Speed | Slower (GPU-accelerated encoding required) | Fast (inverted index construction) | Fast (inverted index construction) |
Query Latency (per query) | < 50 ms (with FAISS approximate nearest neighbor) | < 10 ms | < 10 ms |
Semantic Synonym Awareness |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core architectural components and downstream tasks that interact with Dense Passage Retrieval in entity linking pipelines.
Bi-Encoder Architecture
The dual-tower neural design at the heart of DPR. One encoder ingests the query or entity mention, the other encodes candidate passages independently.
- Enables offline pre-computation of passage embeddings
- Uses dot product or cosine similarity for fast scoring
- Contrast with cross-encoders, which process query-passage pairs jointly
This separation is what makes DPR scalable to millions of documents.
Candidate Generation
The initial retrieval phase in entity linking that produces a shortlist of possible knowledge base entries. DPR serves as a high-recall candidate generator by retrieving top-k passages via approximate nearest neighbor (ANN) search.
- Replaces sparse methods like TF-IDF or BM25
- Typically retrieves 20–100 candidates for downstream reranking
- Uses FAISS or ScaNN for efficient vector indexing
In-Batch Negatives
A training efficiency technique where positive passages for other queries in the same mini-batch are reused as negative examples. This avoids the cost of explicit hard negative mining.
- Dramatically increases the number of negatives per batch
- Works because random passages are likely irrelevant
- Standard practice in original DPR paper from Facebook AI
Enables effective training without a separate negative sampling pipeline.
Hard Negative Mining
The process of intentionally selecting negative passages that are superficially similar to the query but factually incorrect. Critical for training robust DPR models.
- Top BM25 results that don't contain the answer
- Passages with high lexical overlap but wrong entities
- Improves the model's ability to distinguish subtle differences
Without hard negatives, the retriever learns only coarse distinctions.
Neural Entity Linking
End-to-end deep learning approach where DPR often serves as the retrieval backbone. The full pipeline:
- DPR retrieves candidate entity descriptions
- A cross-encoder reranks candidates with fine-grained attention
- A nil prediction head decides if the entity is out-of-knowledge-base
This architecture replaced traditional feature-engineering pipelines with learned dense representations.
FAISS Integration
Facebook AI Similarity Search is the predominant vector index used with DPR for production deployment. Key capabilities:
- IVF (Inverted File) indexes for approximate search
- PQ (Product Quantization) for memory-efficient storage
- GPU-accelerated brute-force search for exact results
A typical setup indexes millions of passage embeddings and retrieves top-k in < 50ms.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us