通过水印启发的解码策略,提升大模型生成内容与输入上下文的一致性。
Context-Fidelity Boosting: Enhancing Faithful Generation through Watermark-Inspired Decoding

- 基于上下文支持度动态调整词元逻辑值,增强相关词汇生成概率。
- 在多个开源大模型上,忠实度指标显著提升,生成开销极小。
- 无需微调或修改结构,适用于各类主流大模型,适合注重生成准确性的场景。
大型语言模型常产生与输入上下文矛盾或忽略其中信息的内容,这种现象称为忠实度幻觉。本文提出一种轻量级、通用的解码阶段框架——上下文忠实度增强(CFB),通过提高源信息支持词元的生成概率来减少此类幻觉。受水印技术中逻辑值塑造原理启发,CFB根据词元在输入上下文中的支持程度,施加增量式的词元级别逻辑值调整。具体设计三种增强策略:静态增强(对源支持词元施加固定偏置)、上下文感知增强(根据有无上下文时下一词元分布的差异缩放偏置)、词元感知增强(基于源位置注意力和源域语义相似性估计局部相关性,重新分配自适应偏置)。CFB无需重训练或架构改动,兼容多种大模型。在多个开源大模型上的摘要与问答任务实验表明,CFB能持续提升忠实度指标,且生成开销极低。代码已完全开源。
原文摘要 · Abstract (English)
Large language models (LLMs) often produce content that contradicts or overlooks information provided in the input context, a phenomenon known as faithfulness hallucination. In this paper, we propose Context-Fidelity Boosting (CFB), a lightweight and general decoding-time framework that reduces such hallucinations by increasing the generation probability of source-supported tokens. Motivated by logit-shaping principles from watermarking techniques, CFB applies additive token-level logit adjustments based on a token's degree of support from the input context. Specifically, we develop three boosting strategies: static boosting, which applies a fixed bias to source-supported tokens; context-aware boosting, which scales this bias using the divergence between next-token distributions with and without context; and token-aware boosting, which further redistributes the adaptive bias according to local relevance estimated from source-position attention and source-scoped semantic similarity. CFB requires no retraining or architectural changes, making it compatible with a wide range of LLMs. Experiments on summarization and question answering tasks across multiple open-source LLMs show that CFB consistently improves faithfulness metrics with minimal generation overhead. Our implementation is fully open-sourced.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。