That's Deprecated! Understanding, Detecting, and Steering Knowledge Conflicts in Language Models for Code Generation
Not on the map. Why?
Abstract (arXiv)
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 80.65% accuracy. Building on these insights, we show that activation-level steering can achieve up to a 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.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 18 of its 27 references that are in the map. First posted on arXiv 21 Oct 2025.
Builds on
18 of 27 references.
References · 18
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2022Locating and Editing Factual Associations in GPTcited by 2,609
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 831
- 2020A Primer in BERTology: What we know about how BERT workscited by 807
- 2023The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasetscited by 673
- 2018What you can cram into a single vector: Probing sentence embeddings for linguistic propertiescited by 452
- 2021Entity-Based Knowledge Conflicts in Question Answeringcited by 349
- 2023Adaptive Chameleon or Stubborn Sloth: Revealing the Behavior of Large Language Models in Knowledge Conflictscited by 333
- 2019Revealing the Dark Secrets of BERTcited by 300
- 2024Knowledge Conflicts for LLMs: A Surveycited by 274
- 2022Rich Knowledge Sources Bring Complex Knowledge Conflicts: Recalibrating Models to Reflect Conflicting Evidencecited by 142
6 more
- 2024Tug-of-War Between Knowledge: Exploring and Resolving Knowledge Conflicts in Retrieval-Augmented Language Modelscited by 93
- 2024Cutting Off the Head Ends the Conflict: A Mechanism for Interpreting and Mitigating Knowledge Conflicts in Language Modelscited by 87
- 2022Controllable Text Generation via Probability Density Estimation in the Latent Spacecited by 27
- 2023Intuitive or Dependent? Investigating LLMs' Behavior Style to Conflicting Promptscited by 23
- 2022Prompt-Augmented Linear Probing: Scaling beyond the Limit of Few-shot In-Context Learnerscited by 18
- 2024Probing Language Models on Their Knowledge Sourcecited by 11
Built on by
Not cited yet.