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

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Bae, Jaesung, Churchwell, Cameron, Hermon, Mitchell, Hsieh, Tsun-An, Xu, Jocelyn, Yegorova, Yekaterina, Hasegawa-Johnson, Mark, Ji, Heng
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866911226075807744
author Bae, Jaesung
Churchwell, Cameron
Hermon, Mitchell
Hsieh, Tsun-An
Xu, Jocelyn
Yegorova, Yekaterina
Hasegawa-Johnson, Mark
Ji, Heng
author_facet Bae, Jaesung
Churchwell, Cameron
Hermon, Mitchell
Hsieh, Tsun-An
Xu, Jocelyn
Yegorova, Yekaterina
Hasegawa-Johnson, Mark
Ji, Heng
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2510_19116
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle That's Deprecated! Understanding, Detecting, and Steering Knowledge Conflicts in Language Models for Code Generation
Bae, Jaesung
Churchwell, Cameron
Hermon, Mitchell
Hsieh, Tsun-An
Xu, Jocelyn
Yegorova, Yekaterina
Hasegawa-Johnson, Mark
Ji, Heng
Computation and Language
Artificial Intelligence
Machine Learning
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.
title That's Deprecated! Understanding, Detecting, and Steering Knowledge Conflicts in Language Models for Code Generation
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2510.19116