Information Retrieval and Retrieval-Augmented Generation

Jurafsky & Martin, Speech and Language Processing, 3rd ed. draft, ch. 11

6 cards in “11.4 Retrieval-augmented generation” · whole deck

11.4 Retrieval-augmented generation

  1. What are the two components of a RAG system?
    The retriever, which finds relevant passages in a document collection, and the generator (historically the “reader”), an LLM that answers conditioned on the retrieved passages and the user prompt.
  2. Give the basic RAG algorithm.
    (1) Retrieve the top-k passages \(R(q) = d_1 \ldots d_k\) for query \(q\); (2) build a prompt with the passages and the question (“Based on these texts, answer this question: …”); (3) call the LLM, which generates \(p(x_i \mid R(q); \text{instruction}; q; x_{<i})\).
    questionretrieverpromptLLMquestion goes into the prompt toodocuments
    Retrieve, then generate an answer grounded in the passages.
  3. What is agent-based RAG?
    The system decides when to call retrieval and from which collection (web, private data…), instead of always retrieving for every turn.
  4. How can RAG deal with noisy or insufficient retrieved passages?
    Add a reranker to reorder passages after retrieval, or use multi-hop retrieval: append the first-stage documents to the query and retrieve again.
  5. How can the LLM or the retriever be trained for RAG?
    Instruction-tune the LLM on questions annotated with retrieved passages and correct answers; or use test-time compute to have it reflect on which passages were useful; or train the retriever and LLM end-to-end on question–answer data, since the IR engine wasn’t optimized for feeding an LLM.
  6. What are knowledge citations, and how are they most simply generated?
    Evidence for factual statements, like numbered references to URLs or literature. Simplest: instruct the model in the prompt to answer only from the provided search results and cite them for every factual claim.

Source