Decoding by Contrasting Knowledge: Enhancing Large Language Model Confidence on Edited Facts
Baolong Bi, Shenghua Liu, Lingrui Mei, Yiwei Wang, Junfeng Fang, Pengliang Ji, Xueqi Cheng
Abstract
The knowledge within large language models (LLMs) may become outdated quickly. While in-context editing (ICE) is currently the most effective method for knowledge editing (KE), it is constrained by the black-box modeling of LLMs and thus lacks interpretability. Our work aims to elucidate the superior performance of ICE in KE by analyzing the impacts of in-context new knowledge on token-wise distributions. We observe that despite a significant boost in logits of the new knowledge, the performance of ICE is still hindered by stubborn knowledge. Stubborn knowledge refers to facts that have gained excessive confidence during pretraining, making them hard to edit effectively. To address this issue and further enhance the performance of ICE, we propose a novel approach termed Decoding by Contrasting Knowledge (DeCK). DeCK derives the distribution of the next token by contrasting the logits obtained from the newly edited knowledge guided by ICE with those from the unedited parametric knowledge. Our experiments consistently demonstrate that DeCK enhances the confidence of LLMs in edited facts. For instance, it improves the performance of LLAMA3-8B-INSTRUCT on MQUAKE by up to 219%, demonstrating its capability to strengthen ICE in the editing of stubborn knowledge. DeCK can be easily integrated into any ICE method as a decoding component to enhance editing capabilities. Our work paves the way to develop both effective and accountable KE methods for LLMs. 1
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
- Memory-Based Model Editing at Scale cites Editable Neural Networks
- DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language Models cites Locating and Editing Factual Associations in GPT
- DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language Models cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Builds on13
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
- Memory-Based Model Editing at ScaleEric Mitchell, Charles Lin, Antoine Bosselut, Christopher D. Manning et al.ICML 2022 · 520 citations
- DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language ModelsYung-Sung Chuang, Yujia Xie, Hongyin Luo, Yoon Kim et al.ICLR 2024 · 354 citations
- Editable Neural NetworksAnton Sinitsin, Vsevolod Plokhotnyuk, Dmitry V. Pyrkin, Sergei Popov et al.ICLR 2020 · 210 citations
Related papers
- Decoupling Reasoning and Knowledge Injection for In-Context Knowledge EditingChangyue Wang, Weihang Su, Qingyao Ai, Yujia Zhou et al.ACL Findings 2025 · 2 citations
- Adaptive Token Biaser: Knowledge Editing via Biasing Key EntitiesBaolong Bi, Shenghua Liu, Yiwei Wang, Lingrui Mei et al.EMNLP Findings 2024
- Avoiding Knowledge Edit Skipping in Multi-hop Question Answering with Guided DecompositionYi Liu, Xiangrong Zhu, Xiangyu Liu, Wei Wei et al.EMNLP Findings 2025
- Robust Knowledge Editing via Explicit Reasoning Chains for Distractor-Resilient Multi-Hop QAYuchen Wu, Liang Ding, Li Shen, Dacheng TaoEMNLP Findings 2025 · 1 citation
- CaKE: Circuit-aware Editing Enables Generalizable Knowledge LearnersYunzhi Yao, Jizhan Fang, Jia-Chen Gu, Ningyu Zhang et al.EMNLP 2025 · 1 citation
