Chapter 11: Question Answering & Information Retrieval
Build complete question answering systems from extractive span selection to retrieval-augmented generation. Master passage retrieval with BM25 and dense encoders, reading comprehension with multi-hop reasoning, and open-domain QA with retriever-reader pipelines.
Chapter Overview
Question answering (QA) is the task of automatically producing a correct answer to a natural language question, given some knowledge source. It sits at the intersection of natural language understanding, information retrieval, and reasoning, and it has driven many of the most impactful advances in modern NLP --- from early information retrieval systems in the 1960s to today's retrieval-augmented generation pipelines.
QA systems are broadly categorized by how they produce answers. Extractive QA selects a contiguous span from a given passage. Generative QA synthesizes an answer in free-form text using a seq2seq model. Both approaches depend on finding the right evidence, which is where information retrieval enters: passage retrieval identifies candidate documents from a large corpus, using either sparse methods (BM25, TF-IDF) or dense methods (bi-encoders, DPR).
The modern open-domain QA pipeline combines retrieval with reading: a retriever finds relevant passages from millions of documents, and a reader extracts or generates the answer from those passages. Retrieval-Augmented Generation (RAG) extends this by feeding retrieved evidence directly into a large language model, grounding its output in factual sources. This chapter covers each component in depth --- extractive and generative QA, sparse and dense retrieval, reading comprehension, and the full open-domain pipeline --- giving you the knowledge to build production QA systems.
Chapter Roadmap
Click any topic to jump in
Extractive QA
Select answer spans from passages using start/end logits with BERT-based models.
Generative QA
Generate free-form answers token by token using seq2seq models like T5 and BART.
Sparse and dense approaches to passage retrieval
Passage Retrieval
Find relevant documents with TF-IDF, BM25, and inverted indexes for sparse retrieval.
Dense Retrieval
Bi-encoder neural retrieval with contrastive training and approximate nearest neighbors.
Reading comprehension meets retrieval in open-domain systems
Reading Comprehension
Multi-hop reasoning and answer verification across multiple passages.
Open-Domain QA
Retriever-reader pipelines and RAG — combining retrieval with generation at scale.
Sign up to unlock this chapter
This chapter is part of PixelBank Premium. Create a free account, then upgrade to read the full lesson — concepts, walkthroughs, and exercises.