Table of Contents
Fetching ...

AdaCAD: Adaptively Decoding to Balance Conflicts between Contextual and Parametric Knowledge

Han Wang, Archiki Prasad, Elias Stengel-Eskin, Mohit Bansal

TL;DR

AdaCAD tackles knowledge conflict in LLMs by dynamically balancing context and parametric knowledge at both token and instance levels via a conflict signal drawn from Jensen-Shannon divergence between context-informed and context-free distributions. Unlike fixed or binary conflict methods, AdaCAD adapts per example and per timestep, reducing over-correction in low-conflict cases while strengthening context influence in high-conflict cases. Across six QA and three summarization datasets and multiple models, it yields substantial gains in QA accuracy and summary factuality, while mitigating losses seen in static baselines on mixed-conflict data. This approach enhances robustness and practical applicability of context-aware decoding in real-world, diverse datasets where conflict levels vary widely.

Abstract

Knowledge conflict arises from discrepancies between information in the context of a large language model (LLM) and the knowledge stored in its parameters. This can hurt performance when using standard decoding techniques, which tend to ignore the context. Existing test-time contrastive methods seek to address this by comparing the LLM's output distribution with and without the context and adjust the model according to the contrast between them. However, we find that these methods frequently misjudge the degree of conflict and struggle to handle instances that vary in their amount of conflict, with static methods over-adjusting when conflict is absent. We propose a fine-grained, instance-level approach called AdaCAD, which dynamically infers the weight of adjustment based on the degree of conflict, as measured by the Jensen-Shannon divergence between distributions representing contextual and parametric knowledge. Across four LLMs, six question-answering (QA) and three summarization datasets, we demonstrate that ADACAD consistently outperforms other decoding baselines with average QA accuracy gains of 14.21% (absolute) over a static contrastive baseline, and improves the factuality of summaries by 6.19 (AlignScore). Lastly, we show that while contrastive baselines hurt performance when conflict is absent, ADACAD mitigates these losses, making it more applicable to real-world datasets in which some examples have conflict and others do not.

AdaCAD: Adaptively Decoding to Balance Conflicts between Contextual and Parametric Knowledge

TL;DR

AdaCAD tackles knowledge conflict in LLMs by dynamically balancing context and parametric knowledge at both token and instance levels via a conflict signal drawn from Jensen-Shannon divergence between context-informed and context-free distributions. Unlike fixed or binary conflict methods, AdaCAD adapts per example and per timestep, reducing over-correction in low-conflict cases while strengthening context influence in high-conflict cases. Across six QA and three summarization datasets and multiple models, it yields substantial gains in QA accuracy and summary factuality, while mitigating losses seen in static baselines on mixed-conflict data. This approach enhances robustness and practical applicability of context-aware decoding in real-world, diverse datasets where conflict levels vary widely.

Abstract

Knowledge conflict arises from discrepancies between information in the context of a large language model (LLM) and the knowledge stored in its parameters. This can hurt performance when using standard decoding techniques, which tend to ignore the context. Existing test-time contrastive methods seek to address this by comparing the LLM's output distribution with and without the context and adjust the model according to the contrast between them. However, we find that these methods frequently misjudge the degree of conflict and struggle to handle instances that vary in their amount of conflict, with static methods over-adjusting when conflict is absent. We propose a fine-grained, instance-level approach called AdaCAD, which dynamically infers the weight of adjustment based on the degree of conflict, as measured by the Jensen-Shannon divergence between distributions representing contextual and parametric knowledge. Across four LLMs, six question-answering (QA) and three summarization datasets, we demonstrate that ADACAD consistently outperforms other decoding baselines with average QA accuracy gains of 14.21% (absolute) over a static contrastive baseline, and improves the factuality of summaries by 6.19 (AlignScore). Lastly, we show that while contrastive baselines hurt performance when conflict is absent, ADACAD mitigates these losses, making it more applicable to real-world datasets in which some examples have conflict and others do not.
Paper Structure (40 sections, 5 equations, 5 figures, 10 tables)

This paper contains 40 sections, 5 equations, 5 figures, 10 tables.

Figures (5)

  • Figure 1: In cases of high knowledge conflict, greedy decoding fails to attend to the context, resulting in incorrect answers. Contrastive decoding allows the context to be incorporated, but must be done with care: in low-conflict cases, excessive contrast can over-correct (e.g., by CAD with $\alpha=1$), resulting in incorrect outputs. AdaCAD dynamically adjusts the degree of contrast, allowing it to handle both high and low-conflict cases.
  • Figure 2: Comparison of greedy decoding (Context+Question), CAD, and AdaCAD on high-conflict and low-conflict examples. Greedy decoding struggles to incorporate contextual knowledge in high-conflict examples. CAD tends to overemphasize irrelevant tokens in the vocabulary, leading to incorrect answers in low-conflict examples. AdaCAD uses dynamic adaptation to effectively balance between context and parametric knowledge.
  • Figure 3: Qualitative example from NQ. Informative text is highlighted in blue, while text about unrelated facts and wrong answers is highlighted in red. AdaCAD produces the correct answer, while CAD generates unrelated outputs and COIECD fails to detect the conflict and generates the same incorrect answer as greedy decoding.
  • Figure 4: TofuEval: Text unsupported by the transcripts is highlighted in red, while consistent and relevant text is highlighted in blue. AdaCAD generates a faithful summary whereas other methods tend to hallucinate details.
  • Figure 5: Plot of JSD values of the first 5 decoding steps using Llama3-70B on TofuEval. The JSD values tend to have lower values and variance at the start of decoding.