Source-linked AI summary

Enhancing Noise Robustness of Retrieval-Augmented Language Models with Adaptive Adversarial Training

Feiteng Fang, Yuelin Bai, Shiwen Ni, Min Yang, Xiaojun Chen, Ruifeng Xu

arXiv:2405.20978v1cs.AI

TL;DR

Prior retrieval-augmented language-model studies often cover only a limited range of retrieval noises, despite diverse real-world noise conditions. The paper categorizes three noise types and proposes RAAT, which combines adaptive adversarial training with multi-task learning. Experiments report improved F1 and EM for LLaMA2 7B across diverse noise conditions.

  • Problem

    Prior work on retrieval-noise robustness often considers a limited set of noise types, despite the diversity of noises in real retrieval environments.

    Source: §1 · p. 2
  • Method

    RAAT adapts adversarial training to retrieved noise and uses multi-task learning to encourage models to recognize noisy contexts.

    Source: §1 · p. 2
  • Results

    Across diverse noise conditions, RAAT improves F1 and EM for LLaMA2 7B; versus RALMmultiple in all four environments, average gains are 2.08% F1 and 2.5% EM.

    Source: §6 · p. 8, §5.1 · p. 8
  • Takeaways & Limitations

    RAG-Bench provides an evaluation benchmark for retrieval-noise robustness based on three open-domain question-answering datasets.

    Source: §1 · p. 2

    The benchmark uses only datasets from three open-domain question-answering repositories.

    Source: §7 · p. 9

Abstract

from arXiv · show

Large Language Models (LLMs) exhibit substantial capabilities yet encounter challenges, including hallucination, outdated knowledge, and untraceable reasoning processes. Retrieval-augmented generation (RAG) has emerged as a promising solution, integrating knowledge from external databases to mitigate these challenges. However, inappropriate retrieved passages can potentially hinder the LLMs' capacity to generate comprehensive and high-quality responses. Prior RAG studies on the robustness of retrieval noises often confine themselves to a limited set of noise types, deviating from real-world retrieval environments and limiting practical applicability. In this study, we initially investigate retrieval noises and categorize them into three distinct types, reflecting real-world environments. We analyze the impact of these various retrieval noises on the robustness of LLMs. Subsequently, we propose a novel RAG approach known as Retrieval-augmented Adaptive Adversarial Training (RAAT). RAAT leverages adaptive adversarial training to dynamically adjust the model's training process in response to retrieval noises. Concurrently, it employs multi-task learning to ensure the model's capacity to internally recognize noisy contexts. Extensive experiments demonstrate that the LLaMA-2 7B model trained using RAAT exhibits significant improvements in F1 and EM scores under diverse noise conditions. For reproducibility, we release our code and data at: https://github.com/calubkk/RAAT.

1 Introduction

Retrieved passages can mislead retrieval-augmented language models, while prior noisy-training work leaves retrieval-noise categories and training composition insufficiently addressed. The paper examines three noise types and proposes RAAT, combining adaptive adversarial training with multi-task learning.

1 Introduction

  • Noisy or inaccurate retrieved contexts can lead RALMs to answer incorrectly, and retrieval noise is inevitable because retrievers cannot be completely accurate.Earlier noisy-training approaches also depend heavily on training-data composition; introducing noise incorrectly can cause overfitting and harm generalization.Source: §1 · pp. 1–2
  • Relevant, irrelevant, and counterfactual retrieval noise affect LLM robustness differently; superficially related or counterfactual texts often produce more misinformation than irrelevant texts.Relevant noise lacks the correct answer, irrelevant noise is unrelated to the query, and counterfactual noise is topically related but contains incorrect information.Source: §1 · p. 2
  • The paper systematically investigates three retrieval-noise types, addressing the contrast between real-world noise diversity and the lack of clear classifications in prior studies.The authors also note that noisy training requires substantial experimentation and tuning of noise type and intensity.Source: §1 · p. 2
  • RAAT adapts training to different retrieved-noise environments and uses multi-task learning to encourage internal recognition of noisy contexts.It generates adversarial samples in response to model sensitivity to different noise types.Source: §1 · p. 2
  • RAG-Bench assesses retrieval-noise robustness using three open-domain question-answering datasets, and the reported experiments show RAAT improves robustness across diverse retrieval-noise environments.The paper presents the benchmark and experiments as contributions alongside its noise analysis and training method.Source: §1 · p. 2

2 Related Work

Related work examines noisy retrieval in RALMs and adversarial training across NLP and LLM settings. This paper applies adversarial training to retrieval noise, constructing examples by sampling or paraphrasing original data.

Retrieval-Augmented Generation with Noisy Context

  • Studies of retrieval noise report that irrelevant or partially relevant context can harm performance, and performance can decline as noise in the context increases.Prior work also reported detrimental effects from adding irrelevant information to arithmetic reasoning contexts.Source: §2 · p. 2

Adversarial Training

  • Adversarial training research spans computer vision and NLP, including perturbations to word embeddings and other granularities of NLP tasks.The cited NLP approaches use perturbations to reduce overfitting or study perturbations across task-specific granularities.Source: §2 · pp. 2–3
  • Recent LLM adversarial-example work targets harmful or non-factual outputs; this study instead investigates adversarial training for retrieval noise and constructs examples by sampling or paraphrasing original data.Prior examples include sentence- and character-level attacks, irrelevant arithmetic context, and transferable adversarial suffixes.Source: §2 · p. 3

3 Methodology

The methodology formulates robust RALM training around answering with golden context even when retrieval noise is added. It distinguishes three noise types and combines adaptive adversarial training with an auxiliary noise-classification task.

3.1 Problem Setup

  • The target is a fine-tuned model that answers from golden context and remains accurate when noisy context is added.The setup casts open-domain QA as reading comprehension with golden context and query as input.Source: §3.1 · p. 3

3.2 Diverse Retrieval Noises

  • The taxonomy separates superficially relevant contexts lacking the answer, off-topic contexts, and topically related contexts containing incorrect information.These are termed relevant, irrelevant, and counterfactual retrieval noise, respectively.Source: §3.2 · p. 3
  • The three retrieval-noise types affect LLMs differently; performance declines by 0.2% to 13.43% across the reported noise conditions.Figure 2 compares EM scores for golden-context responses with conditions that add retrieval noise.Source: §3.2 · p. 4, Figure 2 · p. 4

3.3 Retrieval-augmented Adaptive Adversarial Training

  • RAAT evaluates four augmented inputs per query and updates parameters using the one with the highest generation loss.The inputs are golden context alone and contexts with relevant, irrelevant, or counterfactual noise; regularization is intended to reduce loss variation and overfitting to one noise type.Source: §3.3 · pp. 4–5

3.4 Incorporating Noise Awareness

  • RAAT adds an auxiliary task that classifies golden and noisy contexts, combining its classification loss with the adaptive adversarial training loss.The classifier uses a linear layer and cross-entropy loss.Source: §3.4 · p. 6

4 Experiments

The experiments introduce RAG-Bench, evaluate models with EM and F1, and compare RAAT with zero-shot and fine-tuning baselines. The setup uses LLaMA2-7B for RAAT.

4.1 Dataset Construction

  • RAG-Bench uses NQ, TriviaQA, and WebQ, DPR’s top ten Wikipedia passages, three retrieval-noise types, and 4,500/300/3,000 training/validation/test samples.Relevant noise uses a non-golden retrieved passage; irrelevant noise uses a passage from another query; counterfactual noise substitutes an incorrect answer entity.Source: §4.1 · p. 6

4.2 Evaluation Metrics

  • EM measures exact character-level answer matches, while F1 balances precision and recall.Source: §4.2 · p. 6

4.3 Baseline Methods

  • The zero-shot baselines include ChatGPT3.5, LLaMA27B/13B/70B, and Qwen7B/14B; fine-tuning comparisons include RALMgolden, RetRobust, RALMretrieved, and RALMmultiple.RALMretrieved uses the top two retrieved passages rather than manually designed noise; RALMgolden prepends golden retrieval text for LLaMA27B fine-tuning.Source: §4.3 · p. 7

4.4 Implementation Details

  • RAAT uses LLaMA2-7B with weights wreg=0.1, wraat=2, and wcls=1, sequence length 512, two epochs, and learning rate 5e-6.Experiments ran on four 80GB NVIDIA A100 GPUs.Source: §4.4 · p. 7

5 Experimental Results

RAAT improves over RALMmultiple across four retrieval-noise environments. The results also show that noise type and training components matter, while RAAT preferentially selects relevant and counterfactual adversarial examples.

5.1 Main Results

  • LLaMA27B loses 12.46% F1 under relevant noise, versus LLaMA213B’s 7% decrease; counterfactual noise has the greatest impact and irrelevant noise a marginal one.Source: §5.1 · p. 7
  • 2.08% average F1 and 2.5% average EM increases over RALMmultiple are reported for RAAT across all four environments.Source: §5.1 · p. 8

5.2 Ablation Study

  • 0.49% F1 and 0.52% EM average decreases follow removal of Lcls; removing Lreg significantly hurts handling irrelevant retrieval noise.Source: §5.2 · p. 8, Table 3 · p. 8

5.3 Further Discussion

  • RAAT tends to select relevant- and counterfactual-noise adversarial examples for training; Figure 4 summarizes noise choices across 4,500 queries and 9,000 updates.Source: §5.3 · p. 8, Figure 4 · p. 8

6 Conclusion

The paper categorizes retrieval noises and introduces RAAT, combining adaptive adversarial and multi-task learning. Experiments report improved F1 and EM for RAAT-fine-tuned LLaMA2 7B across diverse noise conditions.

  • RAAT-fine-tuned LLaMA2 7B substantially improves F1 and EM across diverse noise conditions.Source: §6 · p. 8
  • The authors establish a benchmark using three open-domain question-answering datasets to evaluate RAAT.Source: §6 · p. 8
  • RAAT combines adaptive adversarial learning with multi-task learning to enhance the model’s capabilities.Source: §6 · p. 8
  • The study categorizes retrieval noises into three types intended to reflect real-world environments.Source: §6 · p. 8

7 Limitations

The benchmark is limited to datasets from three open-domain question-answering repositories, and RAAT focuses on robustness at the LLM end rather than joint LLM–retriever training.

  • The benchmark relies exclusively on datasets from three open-domain question-answering repositories.The authors identify adding datasets from other NLP tasks and retrieving texts from more knowledge bases as future work.Source: §7 · p. 9
  • RAAT focuses on strengthening retrieval-noise robustness at the LLM end, not joint training of the LLM and retrieval model.Joint training is presented as a promising direction for future work.Source: §7 · p. 9
  • The authors identify broader datasets and knowledge bases as needed for a more diversified retrieval-noise robustness benchmark.Source: §7 · p. 9

A Has the Model Truly Attained Noise Awareness?

The preliminary clustering analysis finds noise representations in RALMgolden and RetRobust suboptimal, motivating RAAT’s classification loss. RAAT-tuned models show clearer clustering, particularly for counterfactual noise.

A Has the Model Truly Attained Noise Awareness?

Loading 2405.20978v1…