DVD : Dynamic Contrastive Decoding for Knowledge Amplification in Multi-Document Question Answering (2024)

Abstract: Large language models (LLMs) are widely used in question-answering (QA) systems but often generate information with hallucinations. Retrieval-augmented generation (RAG) offers a potential remedy, yet the uneven retrieval quality and irrelevant contents may distract LLMs.In this work, we address these issues at the generation phase by treating RAG as a multi-document QA task.We propose a novel decoding strategy, Dynamic Contrastive Decoding, which dynamically amplifies knowledge from selected documents during the generation phase. involves constructing inputs batchwise, designing new selection criteria to identify documents worth amplifying, and applying contrastive decoding with a specialized weight calculation to adjust the final logits used for sampling answer tokens. Zero-shot experimental results on ALCE-ASQA, NQ, TQA and PopQA benchmarks show that our method outperforms other decoding strategies. Additionally, we conduct experiments to validate the effectiveness of our selection criteria, weight calculation, and general multi-document scenarios. Our method requires no training and can be integrated with other methods to improve the RAG performance. Our codes will be publicly available at https://github.com/JulieJin-km/Dynamic_Contrastive_Decoding.

## introduction the emergence of large language models (llms) has significantly advanced various natural language processing tasks @xcite . however, despite their extensive knowledge base and linguistic capabilities, llms frequently struggle with handling new knowledge and are susceptible to producing outdated content and hallucinations @xcite . a straightforward resolution involves the continue updating of llm's knowledge via train-ing, but such a process typically demands substantial time and computational resources. retrieval-augmented generation (rag) offers an alternative solution and has drawn substantive effectiveness to mitigate hallucination by introducing external knowledge @xcite . after document retrieval, rag can be treated as a multi-document question answering (mdqa) task. recent studies @xcite indicate that the variability in document quality may cause distractions and impair the generation quality. besides, knowledge conflicts, such as discrepancies within retrieved documents and between parametric and external non-parametric knowledge, may hinder the performance of llms @xcite @xcite . thus, addressing the integration of diverse knowledge during generation remains a significant challenge for llms. the primary method for infusing new knowledge into llms involves supervised fine-tuning or continued training, which is resource-intensive. prior research in rag has introduced various improvements @xcite , such as improving retrieval quality @xcite , refining responses through multiple iterations @xcite , using optimized prompts @xcite , and developing new decoding strategies @xcite . however, these methods typically require retraining or multiple iterations. contrastive decoding @xcite offers a training-free solution for hallucination mitigation and inspires many subsequent works @xcite , but they often concentrate on single-document scenarios and the resolution of conflicts between internal and external knowledge, overlooking the challenge of integrating multiple documents. in this work, we propose a novel decoding strategy, termed dynamic contrastive decoding (dvd), to enhance the integration of various knowl- to evaluate the effectiveness of our proposed method, we conducted zero-shot experiments across diverse datasets, including the alce-asqa @xcite , natural questions @xcite , triviaqa @xcite and popqa @xcite . our experiments, utilizing the mistral @xcite , llama2 @xcite and vicuna @xcite models, demonstrate that our method consistently achieves superior response quality. this enhancement is attributed to our novel approach of dynamically amplifying knowledge from selected documents during the integration of different knowledge. a thorough analysis of our selection criteria, weight computation, and document count reveals consistent performance gains across all datasets. importantly, our method is entirely plug-and-play, requiring no additional training. furthermore, it seamlessly synergizes with other techniques, further augmenting the efficacy of the rag system. ## methodology we explain the details of our method in this section. we propose a new decoding strategy that can amplify knowledge from the selected documents during the generation phase to adjust the final logits used to sample answer tokens. ## analysis in this section, we conduct experiments from various perspectives to explore the factors that affect out method and demonstrate its efficiency. we mainly present the results of llama2-13b on the alce-asqa benchmark for better illustration. ## conclusion in this paper, we propose a decoding strategy that can amplify knowledge from the selected documents during the generation phase to adjust the final logits used to sample answer tokens. we construct the inputs batch-wise with different templates and instructions, and get corresponding logits from llm. we design a new selection criteria that computes the entropy of head tokens with high probability to assess the logits and choose the ones that worth amplifying. the contrastive decoding is used to adjust the logits, where the weights are calculated based on logits dynamically during the generation phase. we explore several selection criteria and calculation of weights to demonstrate the efficiency of our design. extensive experiments show that dvd makes consistent improvement on downstream performance and is superior to other decoding strategies, such as regular decoding and cad. dvd explores the usage of contrastive decoding under the setting of multi-documents, making the incorporation process of knowledge more diverse. in conclusion, our method propose a new decoding strategy to incorporate knowledge in a more discriminative way under the multi-document setting. our method is plug-and-play and doesn't require any training, and it can be combined with other orthogonal methods to improve the overall performance of the rag system.