14 Question answering with a fine-tuned large language model
This chapter covers
- Building a question-answering application using an LLM
- Curating a question-answering dataset for training
- Fine-tuning a Transformer-based LLM
- Integrating a deep-learning-based NLP pipeline to extract and rank answers from search results
We covered the basics of semantic search using Transformers in chapter 13, so we’re now ready to attempt one of the hardest problems in search: question answering.
Question answering is the process of returning an answer for a searcher’s query, rather than just a list of search results. There are two types of question-answering approaches: extractive and abstractive. Extractive question answering is the process of finding exact answers to questions from your documents. It returns snippets of your documents containing the likely answer to the user’s question so they don’t need to sift through search results. In contrast, abstractive question answering is the process of generating responses to a user’s question either as a summary of multiple documents or directly from an LLM with no source documents. In this chapter, we’ll focus primarily on extractive question answering, saving abstractive question answering for chapter 15.
By solving the question-answering problem, you will accomplish three things: