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

Baolong Bi, Shenghua Liu, Yiwei Wang, Yilong Xu, Junfeng Fang +2 more
3/20/2025
cs.CLcs.AI

Official code: byronBBL/CK-PLUG (25 stars, last commit 2025-05-27).

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}}$.

View on arXivView PDF

Code Implementations(1)

byronBBL/CK-PLUGOfficial100%

Official repository of paper "Parameters vs. Context: Fine-Grained Control of Knowledge Reliance in Language Models"

253C, C++Mar 20, 20251 years ago

Similar Papers

Cite this paper

@article{bi2025parameters,
  title  = {Parameters vs. Context: Fine-Grained Control of Knowledge Reliance in Language Models},
  author = {Baolong Bi and Shenghua Liu and Yiwei Wang and Yilong Xu and Junfeng Fang and Lingrui Mei and Xueqi Cheng},
  year   = {2025},
  eprint = {2503.15888},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2503.15888v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2503.15888.svg)](https://codeofpaper.com/paper/2503.15888)

Discussion