Table of Contents
Fetching ...

Parameters vs. Context: Fine-Grained Control of Knowledge Reliance in Language Models

Baolong Bi, Shenghua Liu, Yiwei Wang, Yilong Xu, Junfeng Fang, Lingrui Mei, Xueqi Cheng

TL;DR

This work tackles the problem of unreliable outputs in retrieval-augmented generation caused by conflicts between a model's internal knowledge and retrieved context. It introduces CK-PLUG, a plug-in decoding-time mechanism that uses Confidence Gain to detect knowledge conflicts and a single tunable parameter $\alpha$ (with an optional adaptive mode) to blend parametric and contextual predictions at the token level. The authors demonstrate wide-range control of memory recall and improved generation reliability across multiple open-source LLMs and six RAG tasks, supported by ablation analyses and token-level insights. The approach offers interpretability and practicality, with open-source code to enable adoption in diverse RAG applications.

Abstract

Retrieval-Augmented Generation (RAG) mitigates hallucinations in Large Language Models (LLMs) by integrating external knowledge. However, conflicts between parametric knowledge and retrieved context pose challenges, particularly when retrieved information is unreliable or the model's internal knowledge is outdated. In such cases, LLMs struggle to determine whether to rely more on their own parameters or the conflicted context. To address this, we propose **CK-PLUG**, a plug-and-play method for controlling LLMs' reliance on parametric and contextual knowledge. We introduce a novel knowledge consistency metric, Confidence Gain, which detects knowledge conflicts by measuring entropy shifts in token probability distributions after context insertion. CK-PLUG then enables fine-grained control over knowledge preference by adjusting the probability distribution of tokens with negative confidence gain through a single tuning parameter. Experiments demonstrate CK-PLUG's ability to significantly regulate knowledge reliance in counterfactual RAG scenarios while maintaining generation fluency and knowledge accuracy. For instance, on Llama3-8B, memory recall (MR) of RAG response can be adjusted within a broad range (9.9%-71.9%), compared to the baseline of 42.1%. Moreover, CK-PLUG supports adaptive control based on the model's confidence in both internal and external knowledge, achieving consistent performance improvements across various general RAG tasks. Our code is available at: $\href{https://github.com/byronBBL/CK-PLUG}{\text{this https URL}}$.

Parameters vs. Context: Fine-Grained Control of Knowledge Reliance in Language Models

TL;DR

This work tackles the problem of unreliable outputs in retrieval-augmented generation caused by conflicts between a model's internal knowledge and retrieved context. It introduces CK-PLUG, a plug-in decoding-time mechanism that uses Confidence Gain to detect knowledge conflicts and a single tunable parameter (with an optional adaptive mode) to blend parametric and contextual predictions at the token level. The authors demonstrate wide-range control of memory recall and improved generation reliability across multiple open-source LLMs and six RAG tasks, supported by ablation analyses and token-level insights. The approach offers interpretability and practicality, with open-source code to enable adoption in diverse RAG applications.

Abstract

Retrieval-Augmented Generation (RAG) mitigates hallucinations in Large Language Models (LLMs) by integrating external knowledge. However, conflicts between parametric knowledge and retrieved context pose challenges, particularly when retrieved information is unreliable or the model's internal knowledge is outdated. In such cases, LLMs struggle to determine whether to rely more on their own parameters or the conflicted context. To address this, we propose **CK-PLUG**, a plug-and-play method for controlling LLMs' reliance on parametric and contextual knowledge. We introduce a novel knowledge consistency metric, Confidence Gain, which detects knowledge conflicts by measuring entropy shifts in token probability distributions after context insertion. CK-PLUG then enables fine-grained control over knowledge preference by adjusting the probability distribution of tokens with negative confidence gain through a single tuning parameter. Experiments demonstrate CK-PLUG's ability to significantly regulate knowledge reliance in counterfactual RAG scenarios while maintaining generation fluency and knowledge accuracy. For instance, on Llama3-8B, memory recall (MR) of RAG response can be adjusted within a broad range (9.9%-71.9%), compared to the baseline of 42.1%. Moreover, CK-PLUG supports adaptive control based on the model's confidence in both internal and external knowledge, achieving consistent performance improvements across various general RAG tasks. Our code is available at: .

Paper Structure

This paper contains 37 sections, 11 equations, 8 figures, 9 tables, 1 algorithm.

Figures (8)

  • Figure 1: LLMs struggle to prioritize between parametric and contextual knowledge, especially when facing outdated parameters or misleading context, reducing reliability in real-world scenarios.
  • Figure 2: Changes (%) in the entropy of probability distribution for knowledge-sensitive tokens after incorporating conflict or support contexts.
  • Figure 3: Illustration of the Confidence-Gain (CG) on LLaMA3-8B for generated tokens under two types of Conflict Context, demonstrating its effectiveness in detecting latent knowledge conflicts. For comparison, examples of Support Context are provided in the Appendix \ref{['sec:CG_details']}.
  • Figure 4: Illustration of CK-PLUG controlling the knowledge reliance in LLM outputs. During token generation, it detects potential conflicts and modulates the probability distribution of conflicted tokens. The modulation first computes a context-aware distribution, then integrates it with the parameter-aware distribution through a weighted sum based on the tuning parameter $\alpha$.
  • Figure 5: Variation in MR (%) across different language models as parameter $\alpha$ increases.
  • ...and 3 more figures