Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection

Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024))

Subscriber deck — free during early access

14 cards

1 Introduction

  1. What problems of standard retrieval-augmented generation does Self-RAG address?
    Standard RAG retrieves a fixed number of passages for every input, whether or not retrieval helps or the passages are relevant, which can hurt versatility and quality; and the output isn’t guaranteed to agree with the retrieved passages, since models aren’t trained to follow them.
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §1
  2. What is Self-RAG in one sentence?
    A single language model trained to decide when to retrieve, to generate from retrieved passages, and to critique the passages and its own output by emitting special reflection tokens, which also make its behaviour controllable at inference time.
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §1

3 Self-RAG: Learning to Retrieve, Generate and Critique

  1. What four kinds of reflection tokens does Self-RAG use?
    Retrieve (should I retrieve now: yes / no / continue); IsRel (is this passage relevant to the input); IsSup (is the output segment fully, partially or not supported by the passage); IsUse (overall usefulness of the response, rated 1–5). The last three are critique tokens.
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §3

3.1 Problem Formalization and Overview

  1. How does Self-RAG generate a response at inference time?
    Segment by segment (a sentence in the experiments): it first predicts Retrieve; if no, it continues like an ordinary LM. If yes, it retrieves several passages, processes each in parallel (predicting IsRel, a candidate segment and IsSup), then ranks the candidates by their critique tokens and finally predicts IsUse.
    [Retrieve]?noyesnextsegmentd₁RelSup ✓d₂Irrel.–d₃RelSup ½keep d₁’s segmentcritique tokens rank the candidates
    One Self-RAG step: retrieve on demand, generate per passage, critique, choose (invented example)
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §3.1

3.2.1 Training the Critic Model

  1. How is the critic model trained?
    GPT-4 was prompted with type-specific instructions and few-shot examples to label sampled input–output pairs with reflection tokens (4K–20K examples per type, agreeing well with humans); a Llama 2-7B critic was then trained on these labels and agreed with GPT-4 over 90% of the time on most token types.
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §3.2.1

3.2.2 Training the Generator Model

  1. How is the generator taught to produce reflection tokens itself?
    The critic and a retriever annotate training outputs offline: retrieval tokens, retrieved passages and critique tokens are inserted where they apply. The generator is trained with ordinary next-token prediction on this augmented corpus (retrieved text masked from the loss, vocabulary extended with reflection tokens), so no critic is needed at inference.
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §3.2.2
  2. Why is Self-RAG’s training cheaper than RLHF?
    Critique is computed once, offline, and inserted into the training text; the generator then learns with a standard language-modelling objective instead of PPO, which needs separate reward models during training.
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §3.2.2

3.3 Self-RAG Inference

  1. How can retrieval frequency be adjusted at inference?
    With a threshold: retrieval is triggered when the probability of Retrieve = yes exceeds it. Factual tasks can use a low threshold (retrieve often); open-ended tasks like personal essays can retrieve rarely.
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §3.3
  2. How does Self-RAG choose between candidate segments generated from different passages?
    Segment-level beam search scoring each candidate by its generation probability plus a weighted sum of the normalized probabilities of the desirable critique tokens (e.g. IsRel = relevant, IsSup = fully supported); the weights can be changed at test time, or undesirable critiques used as hard filters.
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §3.3

4.3 Experimental Settings

  1. On what data and models was Self-RAG trained?
    150K instruction–output pairs (from Open-Instruct and knowledge-intensive datasets), with Llama 2 7B and 13B as generators, Llama 2 7B as critic, and Contriever-MS MARCO retrieving up to ten documents.
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §4.3

5.1 Main Results

  1. How did Self-RAG compare with other models?
    Across six tasks (fact verification, multiple-choice reasoning, open-domain QA, biographies, long-form QA with citations) it beat other open models with and without retrieval, and outperformed ChatGPT on several (e.g. PubHealth, PopQA, biographies), even surpassing it in citation precision on ASQA.
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §5.1
  2. Why did standard retrieval-augmented baselines help little on some tasks?
    On tasks where the answer can’t simply be copied from a passage, such as PubHealth fact checking and ARC-Challenge reasoning, adding retrieved documents barely improved them, and most such baselines also struggled to cite accurately.
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §5.1

5.2 Analysis

  1. What did Self-RAG’s ablations show?
    Training without retrieved passages or without the critic’s reflection tokens lost much performance; always using the top retrieved passage regardless of relevance (as in standard RAG) hurt PopQA and ASQA; dropping the IsSup score from beam search hurt ASQA.
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §5.2
  2. What trade-off does weighting the IsSup score expose?
    Raising its weight increased citation precision (claims backed by evidence) but lowered fluency (MAUVE), since longer, more fluent answers contain more unsupported claims; Self-RAG lets users pick the balance without retraining.
    • Asai et al., 2024, Self-RAG (The Twelfth International Conference on Learning Representations (ICLR 2024)), §5.2

Source

  • Akari Asai, Zeqiu Wu, Yizhong Wang, Avirup Sil and Hannaneh Hajishirzi. 2024. Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection. In The Twelfth International Conference on Learning Representations (ICLR 2024). https://arxiv.org/abs/2310.11511