arXiv:2510.19116cs.CLcs.AI2025-10

研究代码生成中模型知识冲突的检测与调控方法。

That's Deprecated! Understanding, Detecting, and Steering Knowledge Conflicts in Language Models for Code Generation

  • 提出通用框架构建代码生成中的知识冲突场景。
  • 可准确检测冲突,最高达80.65%准确率。
  • 激活层调控可提升12.6%成功率,适合大模型调优研究者。

本文研究大型语言模型(LLMs)在参数化知识与提示中矛盾信息并存时的行为表现。基于先前问答任务的研究,将知识冲突分析拓展至代码生成领域。提出一个不依赖特定领域的冲突构建与解释框架,以及专为代码冲突设计的新评估方法和数据集。实验表明,足够大的LLMs在其参数中编码了知识冲突的表征,使我们能够以高达80.65%的准确率检测冲突。在此基础上,激活层调控可使引导成功率相比随机基线提升最多12.6%。但效果高度依赖模型规模、任务领域与引导方向的平衡。实验代码与数据将在论文录用后公开。

原文摘要 · Abstract (English)

This paper investigates how large language models (LLMs) behave when faced with discrepancies between their parametric knowledge and conflicting information contained in a prompt. Building on prior question-answering (QA) research, we extend the investigation of knowledge conflicts to the realm of code generation. We propose a domain-agnostic framework for constructing and interpreting such conflicts, along with a novel evaluation method and dataset tailored to code conflict scenarios. Our experiments indicate that sufficiently large LLMs encode the notion of a knowledge conflict in their parameters, enabling us to detect knowledge conflicts with up to \textbf{80.65\%} accuracy. Building on these insights, we show that activation-level steering can achieve up to a \textbf{12.6\%} improvement in steering success over a random baseline. However, effectiveness depends critically on balancing model size, task domain, and steering direction. The experiment code and data will be made publicly available after acceptance.

代码生成知识冲突大模型调控

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。