Search

Search articles

Dense Passage Retrieval and Retrieval-Augmented Generation: Integrating Knowledge with Language Models

Michael BrenndoerferJuly 21, 202519 min read

A comprehensive guide covering Dense Passage Retrieval (DPR) and Retrieval-Augmented Generation (RAG), the 2020 innovations that enabled language models to access external knowledge sources. Learn how dense vector retrieval transformed semantic search, how RAG integrated retrieval with generation, and their lasting impact on knowledge-aware AI systems.

Track your reading progress

Sign in to mark chapters as read and track your learning journey

Sign in →
Reading Level

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

2020: Dense Passage Retrieval and Retrieval-Augmented Generation

In 2020, researchers at Facebook AI Research (now Meta AI) introduced two closely related innovations that would fundamentally change how language models interact with knowledge: Dense Passage Retrieval (DPR) and Retrieval-Augmented Generation (RAG). These developments addressed a critical limitation of pre-trained language models: their inability to access and incorporate external knowledge beyond what was encoded in their parameters during training. While models like BERT and GPT had achieved remarkable performance on language understanding and generation tasks, they were constrained by their static knowledge base, unable to access up-to-date information, domain-specific knowledge, or factual details not present in their training data. DPR and RAG showed that combining dense vector retrieval with neural language models could create systems capable of answering questions using external knowledge sources, generating more accurate and factual text, and adapting to new information without retraining.

By 2020, the field had seen substantial progress in both information retrieval and language modeling, but these areas had developed largely independently. Information retrieval systems used sparse keyword-based methods like BM25 or neural approaches with learned query-document representations to find relevant documents from large collections. Language models like BERT and GPT had become powerful tools for understanding and generating text, but they operated as closed systems with knowledge frozen at training time. The question of how to combine these capabilities had been explored in limited ways: some systems used retrieval as a preprocessing step to find relevant context before generation, while others fine-tuned models on retrieval-augmented training data. However, no approach had successfully integrated dense semantic retrieval with neural language generation in an end-to-end trainable framework that could learn to retrieve relevant information and use it effectively for generation tasks.

The significance of DPR and RAG extends far beyond their immediate applications to question answering. These developments established retrieval-augmented generation as a fundamental paradigm for building knowledge-aware language systems. They showed that dense vector search could be seamlessly integrated with neural language models, opening possibilities for systems that combine the scalability of retrieval with the sophistication of neural generation. The techniques introduced in these papers would influence the development of modern retrieval-augmented systems, including later innovations like retrieval-augmented chatbots, systems that combine multiple knowledge sources, and approaches that dynamically retrieve information during conversation. DPR and RAG demonstrated that the future of knowledge-intensive language AI would not lie in training ever-larger models to memorize more facts, but in creating architectures that could effectively retrieve and reason over external knowledge sources.

The Problem: Static Knowledge and Information Retrieval Limitations

Pre-trained language models of the late 2010s faced a fundamental constraint: their knowledge was frozen at training time. Models like BERT and GPT had been trained on large text corpora, encoding statistical patterns and factual knowledge into their millions or billions of parameters. This knowledge base, while vast, was static. Once training completed, these models could not access new information, incorporate domain-specific knowledge not present in their training data, or answer questions about events that occurred after their training cutoff date. A model trained in 2019 could not know about events in 2020, regardless of how important those events might be.

This static knowledge limitation became particularly problematic for knowledge-intensive tasks like open-domain question answering, where systems needed to answer factual questions by drawing on external knowledge sources. Researchers attempted to address this by training ever-larger models on ever-larger datasets, hoping to encode more facts into model parameters. However, this approach had fundamental limits. There were always facts not present in training data, domain-specific knowledge requiring specialized expertise, and information that changed over time. Training massive models to memorize facts was also computationally expensive and environmentally costly, raising questions about the sustainability of scaling models purely through parameter increases.

Traditional information retrieval methods, while capable of accessing external knowledge sources, faced complementary challenges when used with neural language models. Methods like BM25 relied on exact keyword matching, struggling with semantic variations, paraphrasing, and vocabulary mismatches between queries and documents. A user might ask "What causes global warming?" but relevant documents might use terms like "climate change," "greenhouse gases," or "carbon emissions" without containing the exact phrase "global warming." Sparse retrieval methods based on term frequency and document frequency could not bridge these semantic gaps effectively.

Earlier attempts to combine retrieval with neural language models had encountered significant obstacles. Some systems used retrieval as a preprocessing step, finding relevant documents and then passing them to a language model for processing. However, this two-stage approach meant that the retrieval system and language model were trained separately, with no mechanism for the language model to learn how to make use of retrieved information effectively. The retrieval system might find relevant passages, but the language model might not know how to integrate them appropriately into its generation process.

Other approaches tried fine-tuning language models on retrieval-augmented training data, but these methods required large amounts of labeled training data showing which documents were relevant for which queries. Creating these training datasets was labor-intensive and expensive, limiting the scalability of such approaches. Additionally, these systems often struggled with the precise matching needed for question answering tasks, where retrieving the exact passage containing the answer was critical for performance.

The core challenge was creating an end-to-end trainable system that could learn to retrieve relevant information and use it effectively for generation tasks. Such a system would need dense semantic representations that could capture meaning beyond exact word matches, enabling retrieval based on semantic similarity. It would need to integrate retrieval and generation seamlessly, allowing the language model to condition its outputs on retrieved context. Most importantly, it would need to learn this behavior from limited training data, demonstrating that dense representations from pre-trained models could be adapted for retrieval with minimal fine-tuning.

The Solution: Dense Passage Retrieval and Retrieval-Augmented Generation

DPR and RAG provided complementary solutions to the knowledge access problem. DPR addressed the retrieval challenge, demonstrating that dense vector representations from pre-trained language models could be used effectively for semantic passage retrieval. RAG built on DPR's retrieval capabilities to create a unified system that integrated retrieval and generation in an end-to-end trainable framework.

Dense Passage Retrieval: Semantic Search with Minimal Training

DPR introduced a novel approach to passage retrieval that overcame limitations of both traditional sparse retrieval methods and earlier neural retrieval approaches. The key innovation was using dense vector representations from pre-trained language models like BERT to encode both queries and passages into a shared embedding space. Rather than matching queries and documents based on exact keyword overlap, DPR learned to map semantically similar questions and passages close together in this dense vector space.

From Keywords to Semantics

DPR's fundamental insight was treating retrieval as a semantic similarity problem rather than a keyword matching problem. Instead of asking "Do the query and document share words?", DPR asked "Are the query and document semantically similar?" By using dense representations from pre-trained models, DPR could discover that a question about "global warming" was semantically similar to a passage discussing "climate change caused by greenhouse gas emissions," even if they shared no exact words.

The DPR architecture used a dual-encoder approach with separate encoders for queries and passages. Both encoders were initialized with pre-trained BERT models, leveraging the semantic understanding already learned during pre-training. The query encoder processed questions into dense vectors, while the passage encoder processed text passages into dense vectors of the same dimensionality. During training, the system learned to map questions and their relevant answer passages close together in this embedding space, while pushing irrelevant passages farther away.

The training process used a contrastive learning objective. Given a question, the system would retrieve multiple passages from a knowledge base, including the passage containing the answer (positive example) and other passages that did not contain the answer (negative examples). The learning objective encouraged the query and the relevant passage to have high similarity scores (measured as dot product between their embeddings), while ensuring that the query had low similarity with irrelevant passages. This contrastive approach required minimal labeled training data compared to previous neural retrieval methods, as it could leverage the semantic knowledge already encoded in pre-trained models.

The retrieval process was straightforward: given a query, encode it into a dense vector using the query encoder, then find the passages whose embeddings had the highest dot product similarity with the query vector. This could be done efficiently using approximate nearest neighbor search techniques like FAISS, enabling retrieval from millions or billions of passages in milliseconds. DPR demonstrated that this dense retrieval approach could achieve state-of-the-art results on question answering benchmarks while requiring far less training data than previous neural retrieval methods.

Retrieval-Augmented Generation: Integrating Retrieval with Language Models

RAG built on DPR's retrieval capabilities to create a unified system for knowledge-intensive generation tasks. The key innovation was treating retrieval as an integral part of the generation process, not just a preprocessing step. Rather than training a language model to memorize facts in its parameters, RAG trained it to condition generation on retrieved documents, enabling the model to access information far beyond its training data.

The RAG architecture consisted of two main components: a retriever and a generator. The retriever used DPR to find relevant passages from a knowledge base given an input query or prompt. The generator was a pre-trained language model (typically GPT-2 or similar) that received both the original input and the retrieved passages as context for generation. During training, both components were fine-tuned together, allowing the generator to learn how to effectively use retrieved information.

Conditional Generation on Retrieved Context

RAG's power came from conditioning generation on retrieved documents rather than relying solely on memorized knowledge. When generating an answer to "What causes earthquakes?", RAG would first retrieve relevant passages about tectonic plates and geological processes, then use those passages as context when generating the response. This enabled accurate, factual generation even about topics not extensively covered in the model's training data.

The training process involved creating a dataset of questions paired with their answers and the passages containing those answers. For each training example, RAG would retrieve candidate passages using the DPR retriever, then fine-tune the generator to produce the correct answer given both the question and the retrieved passages. This joint training allowed the system to learn which passages were most useful for which types of questions and how to integrate information from multiple retrieved passages into coherent generated text.

RAG supported two operational modes: RAG-Sequence and RAG-Token. In RAG-Sequence mode, a single retrieved passage was used to condition the entire generated sequence, appropriate when the answer could be found in a single passage. In RAG-Token mode, the system could use different retrieved passages for different tokens in the generated sequence, enabling more flexible integration of information from multiple sources. Both modes demonstrated significant improvements over baseline language models on knowledge-intensive tasks, with RAG-Token providing additional flexibility for complex questions requiring information from multiple documents.

The system's ability to cite sources represented another important advantage. Because generation was explicitly conditioned on retrieved passages, RAG could provide attribution for generated claims, showing which passages from the knowledge base informed the generated text. This capability addressed important concerns about transparency and verifiability in language model outputs, enabling users to verify claims by consulting the source passages.

Applications and Impact

DPR and RAG found immediate applications in question answering, knowledge-intensive generation, and systems requiring access to up-to-date or domain-specific information. The ability to combine retrieval with neural language models opened new possibilities for building knowledge-aware AI systems that could access information beyond what was encoded in model parameters.

Open-Domain Question Answering

The most direct application of DPR and RAG was open-domain question answering, where systems needed to answer factual questions by retrieving relevant information from large knowledge bases. RAG systems could answer questions about recent events, domain-specific knowledge, or facts not present in training data by retrieving relevant passages and generating answers conditioned on those passages. This capability made it possible to build question-answering systems that stayed current without requiring expensive model retraining whenever new information became available.

Research systems demonstrated that RAG could outperform standard language models on question answering benchmarks while producing more accurate and factual outputs. The ability to condition generation on retrieved evidence meant that RAG-generated answers were more likely to be factually correct and less likely to hallucinate information. This improvement in factual accuracy made RAG particularly valuable for applications requiring reliable information, such as educational systems, research assistants, and knowledge management tools.

Knowledge-Intensive Generation Tasks

Beyond question answering, RAG enabled knowledge-intensive generation tasks that required drawing on external information sources. The system could generate summaries of recent news articles by retrieving relevant context, create explanations of complex topics by retrieving educational materials, or produce content that required domain-specific knowledge not present in training data. This capability made RAG valuable for content generation applications where accuracy and factual grounding were important.

Document summarization represented another important application. RAG systems could generate summaries that incorporated information from multiple sources, creating more comprehensive summaries than single-document systems. By retrieving relevant passages about related topics, the system could provide context and background information that enhanced the summary's usefulness and accuracy.

Domain-Specific Applications

RAG's ability to access domain-specific knowledge sources made it valuable for specialized applications. In legal domains, RAG systems could retrieve relevant case law and legal precedents when generating legal analyses or answers to legal questions. In medical domains, systems could retrieve relevant research papers or clinical guidelines when providing medical information. In technical domains, systems could retrieve documentation, code examples, or technical specifications when answering technical questions.

This domain-specific capability was particularly important because training language models on specialized domain knowledge required expensive data collection and model training. RAG provided an alternative approach: maintain domain-specific knowledge bases and use retrieval to access this knowledge when needed. This modular approach allowed systems to be adapted to new domains more quickly and cost-effectively than training new models.

Real-Time Information Access

One of RAG's most significant advantages was its ability to access information that changed over time or became available after model training. Traditional language models had fixed knowledge cutoffs, unable to incorporate new information without retraining. RAG systems could update their knowledge bases with new documents, enabling them to answer questions about recent events, current research findings, or newly available information without requiring model retraining.

This capability proved valuable for applications like news summarization, where systems needed to stay current with rapidly evolving news stories. It also enabled systems to incorporate user-specific or organization-specific knowledge by maintaining specialized knowledge bases that could be updated as new information became available.

Limitations and Challenges

Despite their significant advantages, DPR and RAG faced several important limitations that would be addressed in subsequent research. Understanding these limitations helps explain both why these systems marked an important milestone and why research continued to evolve beyond these initial approaches.

Retrieval Quality and Coverage

DPR's effectiveness depended on the quality and coverage of the knowledge base from which it retrieved passages. If relevant information was not present in the knowledge base, or if the knowledge base had poor coverage of certain topics, the system could not generate accurate answers about those topics. This limitation meant that building comprehensive, high-quality knowledge bases remained an important requirement for effective RAG systems.

The retrieval process itself could fail in several ways. If the query encoder did not properly understand the question's intent, it might retrieve irrelevant passages. If the passage encoder did not capture the semantic content of passages accurately, semantically relevant passages might be missed. These retrieval failures would propagate to the generation stage, leading to incorrect or irrelevant generated text.

Computational Efficiency

While DPR enabled efficient retrieval from large knowledge bases using approximate nearest neighbor search, the overall RAG system remained computationally expensive. Retrieving passages required encoding the query, searching the knowledge base, and then encoding retrieved passages. Generating text required running the language model with extended context windows that included retrieved passages. For real-time applications with strict latency requirements, this computational overhead could be problematic.

The need to maintain and update knowledge bases also created ongoing computational and storage costs. Large knowledge bases required significant storage capacity, and updating them required re-indexing passages, which could be computationally expensive. These operational requirements limited RAG's applicability to resource-constrained environments.

Context Window Limitations

Language models had limited context windows, constraining the number of retrieved passages that could be included in the generation context. If a question required information from many different sources, or if the relevant information was spread across multiple long passages, the system might not be able to include all necessary context. This limitation could lead to incomplete or fragmented answers when questions required comprehensive information from multiple sources.

The sequential generation process in RAG-Token mode, where different passages could be used for different tokens, added computational complexity. Managing multiple retrieved passages and determining which to use for each generation step required additional processing, making this mode more expensive than RAG-Sequence while not always providing proportional benefits.

Training Data Requirements

While DPR required less training data than previous neural retrieval methods, it still needed question-answer pairs with corresponding passages for effective training. Creating these datasets remained labor-intensive, particularly for specialized domains or languages with limited resources. The quality of training data also significantly influenced system performance, requiring careful curation and annotation.

RAG's joint training of retriever and generator required datasets that showed which passages were relevant for which questions and what answers should be generated. Creating comprehensive training datasets for knowledge-intensive tasks across diverse domains remained challenging, limiting the system's applicability to domains with abundant training resources.

Hallucination and Factual Accuracy

While RAG reduced hallucination compared to standard language models by conditioning generation on retrieved evidence, the system could still produce incorrect information. The generator might misinterpret retrieved passages, combine information from multiple passages incorrectly, or generate text that went beyond what was supported by the retrieved evidence. This limitation highlighted the ongoing challenge of ensuring factual accuracy in generated text, even when systems had access to relevant source material.

The system's reliance on retrieved passages meant that biases or inaccuracies present in the knowledge base could propagate to generated outputs. If the knowledge base contained biased information, outdated facts, or incomplete coverage of certain topics, these issues would affect RAG's outputs. Ensuring knowledge base quality remained an important concern for deployment in production systems.

Legacy and Looking Forward

DPR and RAG established retrieval-augmented generation as a fundamental paradigm for building knowledge-aware language systems, influencing the development of modern AI systems that combine retrieval with neural language models. The techniques introduced in these papers would prove essential for the next generation of language AI systems that needed to access external knowledge sources, incorporate up-to-date information, and provide source attribution for generated claims.

The dense vector retrieval approach introduced by DPR became a standard technique for semantic search in neural language systems. Later systems would extend these ideas, developing more sophisticated retrieval methods, better training objectives, and improved architectures for combining retrieval with generation. The fundamental insight that dense representations from pre-trained models could be adapted for retrieval with minimal fine-tuning would influence retrieval-augmented systems across diverse applications.

From Research to Production

The transition from DPR and RAG research prototypes to production systems required addressing numerous engineering challenges, including scalable knowledge base management, efficient retrieval at scale, and integration with existing software infrastructure. These practical considerations would drive subsequent research on production-ready retrieval-augmented systems.

Modern retrieval-augmented chatbots and virtual assistants build directly on the foundations established by DPR and RAG. These systems combine dense retrieval with large language models to provide helpful, accurate responses that can access information beyond what was encoded during training. The ability to retrieve relevant information during conversation enables more informed, contextual responses and allows systems to stay current with new information without requiring model retraining.

The integration of retrieval with language models would also influence the development of systems that combine multiple knowledge sources, retrieve information dynamically during multi-turn conversations, and provide source attribution for generated claims. These capabilities became increasingly important as language AI systems were deployed in applications requiring accuracy, transparency, and access to current information.

Research following DPR and RAG would explore numerous enhancements: better retrieval methods using learned sparse-dense hybrid representations, improved training objectives for retrieval and generation, architectures that better integrated multiple retrieved passages, and techniques for updating knowledge bases efficiently. The field would also investigate retrieval-augmented systems that could reason over retrieved information, combine evidence from multiple sources, and handle conflicting information appropriately.

DPR and RAG demonstrated that the future of knowledge-intensive language AI would not lie solely in training ever-larger models to memorize more facts, but in creating architectures that could effectively retrieve and reason over external knowledge sources. This insight would prove fundamental for the next generation of language AI systems that needed to combine the sophistication of neural language models with the scalability and updatability of retrieval systems. The paradigm shift toward retrieval-augmented generation represented a recognition that effective language AI systems would need to integrate multiple capabilities: the semantic understanding of neural models, the knowledge access of retrieval systems, and the reasoning capabilities that would emerge in subsequent research.

Quiz

Ready to test your understanding of Dense Passage Retrieval and Retrieval-Augmented Generation? Challenge yourself with these questions about how DPR and RAG transformed knowledge access in language AI, and see how well you've grasped the key concepts from this foundational 2020 development. Good luck!

Loading component...
Track your reading progress

Sign in to mark chapters as read and track your learning journey

Sign in →

Comments

Reference

BIBTEXAcademic
@misc{densepassageretrievalandretrievalaugmentedgenerationintegratingknowledgewithlanguagemodels, author = {Michael Brenndoerfer}, title = {Dense Passage Retrieval and Retrieval-Augmented Generation: Integrating Knowledge with Language Models}, year = {2025}, url = {https://mbrenndoerfer.com/writing/dense-passage-retrieval-retrieval-augmented-generation-rag}, organization = {mbrenndoerfer.com}, note = {Accessed: 2025-12-19} }
APAAcademic
Michael Brenndoerfer (2025). Dense Passage Retrieval and Retrieval-Augmented Generation: Integrating Knowledge with Language Models. Retrieved from https://mbrenndoerfer.com/writing/dense-passage-retrieval-retrieval-augmented-generation-rag
MLAAcademic
Michael Brenndoerfer. "Dense Passage Retrieval and Retrieval-Augmented Generation: Integrating Knowledge with Language Models." 2025. Web. 12/19/2025. <https://mbrenndoerfer.com/writing/dense-passage-retrieval-retrieval-augmented-generation-rag>.
CHICAGOAcademic
Michael Brenndoerfer. "Dense Passage Retrieval and Retrieval-Augmented Generation: Integrating Knowledge with Language Models." Accessed 12/19/2025. https://mbrenndoerfer.com/writing/dense-passage-retrieval-retrieval-augmented-generation-rag.
HARVARDAcademic
Michael Brenndoerfer (2025) 'Dense Passage Retrieval and Retrieval-Augmented Generation: Integrating Knowledge with Language Models'. Available at: https://mbrenndoerfer.com/writing/dense-passage-retrieval-retrieval-augmented-generation-rag (Accessed: 12/19/2025).
SimpleBasic
Michael Brenndoerfer (2025). Dense Passage Retrieval and Retrieval-Augmented Generation: Integrating Knowledge with Language Models. https://mbrenndoerfer.com/writing/dense-passage-retrieval-retrieval-augmented-generation-rag
Michael Brenndoerfer

About the author: Michael Brenndoerfer

All opinions expressed here are my own and do not reflect the views of my employer.

Michael currently works as an Associate Director of Data Science at EQT Partners in Singapore, leading AI and data initiatives across private capital investments.

With over a decade of experience spanning private equity, management consulting, and software engineering, he specializes in building and scaling analytics capabilities from the ground up. He has published research in leading AI conferences and holds expertise in machine learning, natural language processing, and value creation through data.

Stay updated

Get notified when I publish new articles on data and AI, private equity, technology, and more.

No spam, unsubscribe anytime.

or

Create a free account to unlock exclusive features, track your progress, and join the conversation.

No popupsUnobstructed readingCommenting100% Free