Adaptive Contrastive Decoding in Retrieval-Augmented Generation for Handling Noisy Contexts (2024)

Abstract: When using large language models (LLMs) in knowledge-intensive tasks, such as open-domain question answering, external context can bridge the gap between external knowledge and the LLMs’ parametric knowledge.Recent research has been developed to amplify contextual knowledge over the parametric knowledge of LLMs with contrastive decoding approaches.While these approaches could yield truthful responses when relevant context is provided, they are prone to vulnerabilities when faced with noisy contexts.We extend the scope of previous studies to encompass noisy contexts and propose adaptive contrastive decoding (ACD) to leverage contextual influence effectively.ACD demonstrates improvements in open-domain question answering tasks compared to baselines, especially in robustness by remaining undistracted by noisy contexts in retrieval-augmented generation.

## introduction while large language models (llms) @xcite achieve remarkable performance levels across diverse benchmarks, they sometimes struggle to generalize to knowledge-intensive tasks, such as open-domain question-answering (qa; @xcite , and may also fail to capture long-tail knowledge, leading to unfaithful output generation @xcite . one common approach to address these limitations is fine-tuning the model, but this results in a quadratic rise in computational demands as the size of the llms increases exponentially @xcite . to overcome this, researchers have been investigating strategies to combine non-parametric knowledge with llms during response generation without explicit re-training @xcite . this approach leverages external information from knowledge bases and enhances the capability of the llms dynamically, ensuring that the information is both current and accurate. early studies in this field attempt to append query-relevant context to generate more accurate responses. especially, contrastive decoding @xcite @xcite yields significant enhancement in various tasks by amplifying the influence of the given context at decoding step @xcite . while such methods work well when context information is correct and faithful, in real-world scenarios, context information is not always correct and may contain some noisy and unfaithful information. for instance, if the retrieval system pulls in irrelevant or contradictory information, it could lead to incorrect responses @xcite @xcite . this highlights the necessity for a generation model that can gauge the appropriateness of the context by itself, being robust to noise and unfaithful data to ensure the output remains reliable @xcite . to assess whether the existing contrastive decoding approaches can be utilized in practice, we extend the setting to situations where the goldstandard context is not guaranteed, specifically in the retrieval-augmented generation (rag) framework @xcite @xcite . in this paper, we demonstrate that existing context-aware contrastive decoding approaches experience performance drops in opendomain question answering, especially when the retrieved context is noisy. to address this issue, we propose adaptive contrastive decoding (acd), adaptively weighting the contrastive contextual influence on the parametric knowledge, making it suitable for noisy context settings (figure 1 ). incorporating the distinction between contextual and parametric knowledge, our approach aims to mitigate the dominance of potentially noisy contextual information in model output. we control contrastive contextual influence based on context's contribution to the llm's uncertainty reduction, thereby minimizing its disruptive effect during decoding. through in-depth experiments with three open-domain qa datasets, we demonstrate the potential of the proposed approach with increased overall performance. moreover, acd enhances the performance significantly on the noisy context scenario while minimizing performance degradation on the gold context scenario compared to the baselines. robustness in rag frameworks while retrieval-augmented generation enables llms to become factual and reliable with the retrieved external knowledge, there are still concerns about incorrectly retrieved irrelevant contexts @xcite . to address hallucination errors posed by irrelevant contexts, some researchers take an approach to train llms that can adaptively retrieve relevant context @xcite . another approach aims to selectively use retrieved contexts after assessing their truthfulness or relevance through context verification with prompting strategies or training untruthful context detectors @xcite . these approaches highlight the ongoing efforts to advance the robustness and accuracy of llms in multiple directions to manage potentially misleading information. ## conclusion in this work, we mainly tackle handling noisy contexts in open-domain qa on the rag framework. our proposed method, acd, dynamically adjusts contextual influence during decoding by quantifying the model's uncertainty that is either reduced or increased by the retrieved context. our results show that acd improves performances across various dimensions by considering the llm's parametric knowledge and context noisiness. these findings highlight acd's potential to enhance the reliability of retrieval-augmented generation.