Source-linked AI summary

Making Retrieval-Augmented Language Models Robust to Irrelevant Context

Ori Yoran, Tomer Wolfson, Ori Ram, Jonathan Berant

arXiv:2310.01558v2cs.CLcs.AI

TL;DR

RALMs should benefit from relevant retrieval without being harmed by irrelevant context, but retrieval can reduce accuracy, especially in multi-hop settings. The paper analyzes this problem across five ODQA benchmarks, compares NLI-based filtering with automatically generated robustness training, and finds that finetuning on mixed-quality contexts improves accuracy and robustness. The study also reports that as few as 1,000 examples can suffice, while its evidence focuses on in-domain settings and does not guarantee gold answers appear in retrieved contexts or model parameters.

  • Problem

    RALMs can be harmed by irrelevant retrieved contexts, making robustness important for factual question answering and multi-hop reasoning.

  • Method

    The paper uses NLI filtering as a training-free back-off and automatically generates relevant- and irrelevant-context examples to finetune retrieval-augmented language models.

  • Results

    Across five ODQA benchmarks, robustness finetuning lets models ignore irrelevant context while improving overall accuracy; training on as few as 1,000 varied examples suffices.

  • Takeaways & Limitations

    Training models on mixtures of relevant and irrelevant contexts provides a more effective robustness solution than NLI filtering alone, which can discard relevant passages.

  • Takeaways & Limitations

    The study focuses on in-domain settings and does not fully guarantee that gold answers appear in retrieved contexts or the trained model's parameters.

Abstract

from arXiv · show

Retrieval-augmented language models (RALMs) hold promise to produce language understanding systems that are are factual, efficient, and up-to-date. An important desideratum of RALMs, is that retrieved information helps model performance when it is relevant, and does not harm performance when it is not. This is particularly important in multi-hop reasoning scenarios, where misuse of irrelevant evidence can lead to cascading errors. However, recent work has shown that retrieval augmentation can sometimes have a negative effect on performance. In this work, we present a thorough analysis on five open-domain question answering benchmarks, characterizing cases when retrieval reduces accuracy. We then propose two methods to mitigate this issue. First, a simple baseline that filters out retrieved passages that do not entail question-answer pairs according to a natural language inference (NLI) model. This is effective in preventing performance reduction, but at a cost of also discarding relevant passages. Thus, we propose a method for automatically generating data to fine-tune the language model to properly leverage retrieved passages, using a mix of relevant and irrelevant contexts at training time. We empirically show that even 1,000 examples suffice to train the model to be robust to irrelevant contexts while maintaining high performance on examples with relevant ones.

1 INTRODUCTION

The paper analyzes when retrieval helps or harms retrieval-augmented language models and proposes NLI filtering and robustness training to reduce errors from irrelevant contexts.

  • RALM robustness requires relevant retrieved context to improve performance while irrelevant context does not hurt it.The paper studies this criterion across five open-domain question-answering benchmarks.
  • An NLI-based back-off identifies contexts that do not entail the question-answer pair and answers without retrieval when they are irrelevant.This approach improves robustness but is too strict and can discard relevant passages.
  • Irrelevant retrieval can cause models to answer incorrectly even when they can answer without retrieval.The paper illustrates this failure mode with Llama-2-13B on NQ.
  • The paper automatically generates training data with relevant and irrelevant retrieved contexts so language models learn when to use retrieval.The procedure covers both single-hop and multi-hop questions.
  • Strong retrieval hurts performance on StrategyQA and Fermi, while randomly retrieved contexts reduce performance across all five datasets.
  • Finetuning on noisy retrieval enables models to ignore irrelevant context while improving overall accuracy, including on challenging multi-hop tasks.

2 MAKING RALMS ROBUST TO IRRELEVANT CONTEXTS

This section formalizes retrieval-augmented language models and presents NLI filtering and automatically generated fine-tuning data as approaches to robustness against irrelevant contexts.

  • In-context RALMs: RALMs condition language-model generation on retrieved evidence concatenated with the generated sequence.The retrieval operation can be called repeatedly as generation proceeds.
  • In-context RALMs: In multi-hop ODQA, retrieval is interleaved with decomposition: the model generates intermediate questions and answers, while contexts are prepended at each step.The retriever is called for the original question and after each intermediate question.
  • Identifying irrelevant contexts with NLI models: NLI filtering uses retrieved context as a premise and question-answer pairs as hypotheses, retaining retrieval only when the hypotheses are entailed.For contradicting or neutral hypotheses, generation backs off to the standard language model without retrieval.
  • Identifying irrelevant contexts with NLI models: The NLI baseline identifies irrelevant contexts effectively but is too strict because it also discards relevant ones.This motivates training RALMs to ignore irrelevant contexts rather than relying only on posthoc filtering.
  • Automatically generating training data: Automatically generated training data combines relevant and irrelevant retrieved contexts for single-hop and multi-hop question-answering steps.For single-hop data, relevant examples use top-1 retrieval, while irrelevant examples use low-ranked or random contexts; multi-hop examples represent sequential generated steps.
  • Training: Fine-tuning uses standard maximum likelihood on automatically generated data, with datasets limited to 1,000 single-hop and 500 multi-hop questions.Multi-hop questions are split into multiple examples corresponding to individual generation steps.

3 EXPERIMENTAL SETTING

The experiments evaluate retrieval robustness across diverse ODQA benchmarks using Google Search and COLBERTV2, prompted baselines, NLI variants, and fine-tuned models.

  • Datasets and evaluation: The evaluation covers single-hop, explicit multi-hop, and implicit multi-hop reasoning across five ODQA benchmarks.The datasets include Natural Questions, 2WIKIMQA, BAMBOOGLE, STRATEGYQA, and FERMI.
  • Datasets and evaluation: Evaluation uses EM for NQ and STRATEGYQA, F1 for 2WIKIMQA and BAMBOOGLE, and official order-of-magnitude evaluation for FERMI.Each dataset is evaluated on 500 random development-set examples.
  • Retrievers: The retrievers are GOOGLE SEARCH and COLBERTV2, with top-1, low-ranked relevant, or random passages used to simulate retrieval noise.Random passages are top-1 results for different questions or intermediate questions from the same dataset.
  • Few-shot prompted baselines: Prompted baselines use Llama-2-13B in the Self-Ask format with 4–6 exemplars, alongside Llama-2-70B evaluation on NQ.Baseline prompts vary in whether exemplars contain no retrieval, top-ranked retrieval, low-ranked retrieval, or mixed retrieval.
  • NLI-based models: NLI variants use a 407-million-parameter BART-Large model trained on MNLI, treating entailment probabilities of at least 0.5 as sufficient.When entailment is absent, the SA-NR generation serves as the parametric-memory back-off.
  • Fine-tuned models: Fine-tuning experiments use Llama-2-13B on NQ, 2WIKIMQA, and STRATEGYQA, with automatically generated data exposing models to mixed retrieval quality.The SA-RetRobust model samples top-1, low-ranked, or random evidence with equal probability at each step; SA-NoRet and SA-Ret@1 provide ablations.

4 RESULTS

Across retrieval settings, in-context prompting can be harmed by irrelevant contexts, while NLI filtering prevents degradation but sacrifices helpful gains. Fine-tuning on mixed relevant and irrelevant contexts produces the strongest and most robust RALM results.

  • In-context retrieval helps NQ, 2WIKIMQA, and BAMBOOGLE but reduces performance on STRATEGYQA and FERMI.
  • NLI filtering prevents retrieval from hurting performance, but limits gains when retrieval is helpful.
  • Training with retrieval leads to gains across all evaluated datasets and retrievers.
  • More than 10 points of average performance are lost by the in-context model with random contexts, while NLI maintains performance.
  • SA-RetRobust outperforms SA-NoRet by 2.7, 2.4, and 2.4 points on average with top-1, low-ranked, and random Google contexts, respectively.
  • With top-1 Google results on NQ, SA-RetRobust outperforms prompted Llama-2-70B variants by at least 3.3 points.

5 ANALYSIS

The analysis finds that irrelevant context causes errors through both answer copying and failures in multi-hop reasoning. NLI filtering can also reject useful evidence when entailment is not directly expressed.

  • In low-ranked NQ contexts, the wrong answer entity appears in retrieved passages in 77% of errors, compared with 37% for random contexts.
  • For low-ranked retrieval, 68% of explicit 2WIKIMQA errors occur in intermediate answers, whereas 77% of implicit STRATEGYQA errors occur in intermediate questions.
  • Random retrieval produces 60% of 2WIKIMQA errors in intermediate questions, indicating task- and context-dependent failure locations.
  • Many examples with low NLI entailment probabilities still benefit from retrieval on NQ and 2WIKIMQA.
  • In about half of manually analyzed low-entailment cases, the NLI model errs even though the generated text is entailed by retrieved contexts.

6 RELATED WORK

Prior work documents performance degradation from irrelevant context across question answering, factual reasoning, entity-focused generation, and code generation. Related research also studies how models should combine parametric and retrieved knowledge.

  • Earlier studies show that adding random or irrelevant context can decrease question-answering performance.
  • This degradation has been reported in factual reasoning, generation about new entities, and code generation.
  • Related work examines when models should use parametric or retrieved knowledge, especially when the two sources conflict.
  • Other approaches train models to generate from both knowledge sources or improve their use of in-context exemplars.

7 CONCLUSION

The paper concludes that current RALMs are vulnerable to irrelevant retrieved context, while NLI filtering and mixed-context fine-tuning improve robustness under different training constraints. Its evaluation focuses on in-domain settings.

  • Current RALMs are not robust to irrelevant retrieved context and perform worse on certain tasks.
  • When training is unavailable, an NLI baseline increases robustness but discards relevant passages.
  • When training is possible, automatically generated mixed-context data makes models robust and improves overall performance.
  • Training on as few as 1,000 examples with intentionally varied quality suffices for the reported robustness improvements.
  • The work focuses on in-domain settings, leaving broader generalization as future research.

O. Khattab, Keshav Santhanam, Xiang Lisa Li, David Leo Wright Hall, Percy Liang, Christopher

This passage set lists prior work spanning passage search, language-model memory, knowledge conflicts, factual prediction, and question-answering benchmarks.

  • Other cited work studies unseen-entity knowledge, robust property knowledge, compositionality, self-retrieval, and controllable working memory in language models.
  • Prior work includes ColBERT, an efficient passage-search method using contextualized late interaction over BERT.
  • Related studies examine how language models handle contextual knowledge, parametric memory, irrelevant information, and entity-based knowledge conflicts.
  • The cited benchmarks and evaluation resources include Natural Questions and KILT for question answering and knowledge-intensive language tasks.
  • The references also include retrieval-augmented language modeling and generation methods for knowledge-intensive natural-language-processing tasks.

A.1 MODELS

The experiments use vanilla half-precision Llama-2 models, constrained multi-hop decomposition generation, and QLoRA-based fine-tuning.

  • Models: All experiments use vanilla Llama-2 models in half precision.
  • Decomposition Generation: Multi-hop questions require 2–4 decomposition steps, so generation is limited to 5 steps with greedy decoding.With top-1 GOOGLE SEARCH results, failures occur in 0.4% of 2WIKIMQA cases and 1.2% of STRATEGYQA cases; random contexts raise these rates to 37.0% and 34.4%.
  • Training: Models are fine-tuned with QLoRA for 5 epochs using a 2e-4 learning rate and linear scheduling on a single GPU.Each model trains for no longer than 3.5 hours.

A.2 EVALUATION

The evaluation assigns special scores to unanswered cases and uses task-specific additional input for FERMI.

  • Unanswered cases receive a score of 0.5 for STRATEGYQA and 0 for all other datasets.
  • FERMI evaluation uses all 286 “Real Fermi Problems.”
  • FERMI models receive gold answer measurement units as additional input.Examples include meters, cubes, and litres.

A.3 FULL RESULTS

The appendix reports full prompted and trained-model results and evaluates out-of-distribution generalization across datasets.

  • Full Results: Tables 2 and 3 report prompted-model results using GOOGLE SEARCH and COLBERTV2, respectively.
  • Full Results: Table 4 reports full results for all trained models averaged over three seeds, while Table 6 reports Llama-2-70B results on NQ with GOOGLE SEARCH.
  • Out of Distribution Generalization: For OOD evaluation, models trained on mixed STRATEGYQA and 2WIKIMQA data are evaluated on BAMBOOGLE and FERMI with one inference exemplar.The exemplar addresses differences such as FERMI requiring equation generation before the final answer.

A.4 ANALYSIS

The analysis examines how irrelevant retrieved contexts affect Llama-2-13B across question-answering settings and categorizes apparent errors. It also compares prompted and trained models under different retrievers and evaluation conditions.

  • Error analysis: The error analysis distinguishes Valid, Wrong, and Both Wrong cases by comparing predictions with and without retrieval.Both Wrong cases include errors from bad decomposition that can spuriously yield correct answers in binary or comparison questions.
  • Error analysis: A binomial test rejected the hypothesis that most metric decreases from irrelevant context were not actual errors, with p-value<0.01.The test was applied to cases where irrelevant context caused SA-RMix to err.
  • Error analysis: Irrelevant retrieval can cause Llama-2-13B to generate an entity absent from the retrieved context or a wrong strategy.These examples come from NQ and STRATEGYQA analyses.
  • Evaluation: The reported tables organize prompted results by GOOGLE SEARCH or COLBERTV2 retrieval and trained-model results across standard and out-of-distribution settings.The out-of-distribution setting trains on STRATEGYQA and 2WIKIMQA and evaluates on BAMBOOGLE and FERMI.
  • NLI analysis: For NQ and 2WIKIMQA, many helpful retrieval cases had low entailment probability, while STRATEGYQA benefited mainly in its few medium-entailment cases.The passage defines low entailment probability as < 1/3, medium as [1/3, 2/3], and high as > 2/3.
Loading 2310.01558v2…