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

📅 2025-10-21
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This study investigates how large language models (LLMs) resolve implicit knowledge conflicts between parametric knowledge and prompt-specified information in code generation. To address this, we propose the first knowledge conflict modeling and resolution framework tailored to code generation: (1) a domain-agnostic conflict construction methodology; (2) a layer-wise activation-based steering intervention mechanism; and (3) the first dedicated code-specific conflict evaluation dataset and automated detection method. Experimental results demonstrate that LLMs possess implicit conflict recognition capability; targeted layer-wise steering significantly improves guided generation success—outperforming random baselines by 12.6%; and our conflict detector achieves up to 80.65% accuracy. This work pioneers the systematic analysis of knowledge conflicts in code generation, revealing fundamental trade-offs among model scale, task difficulty, and intervention directionality.

Technology Category

Application Category

📝 Abstract
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 extbf{80.65%} accuracy. Building on these insights, we show that activation-level steering can achieve up to a extbf{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.
Problem

Research questions and friction points this paper is trying to address.

Investigating LLM behavior with parametric knowledge versus prompt conflicts
Detecting knowledge conflicts in code generation with high accuracy
Improving conflict steering through activation-level model interventions
Innovation

Methods, ideas, or system contributions that make the work stand out.

Detecting knowledge conflicts in code generation models
Activation-level steering improves conflict resolution success
Domain-agnostic framework for constructing code conflicts
🔎 Similar Papers
No similar papers found.
J
Jaesung Bae
University of Illinois Urbana-Champaign
C
Cameron Churchwell
University of Illinois Urbana-Champaign
M
Mitchell Hermon
University of Illinois Urbana-Champaign
Tsun-An Hsieh
Tsun-An Hsieh
PhD Student at UIUC
Deep LearningSpeech Processing
J
Jocelyn Xu
University of Illinois Urbana-Champaign
Y
Yekaterina Yegorova
University of Illinois Urbana-Champaign
Mark Hasegawa-Johnson
Mark Hasegawa-Johnson
Professor of Electrical and Computer Engineering, University of Illinois
SpeechAudioNatural Language Processing
Heng Ji
Heng Ji
Professor of Computer Science, AICE Director, ASKS Director, UIUC, Amazon Scholar
Natural Language ProcessingLarge Language Models