Model See, Model Do? Exposure-Aware Evaluation of Bug-vs-Fix Preference in Code LLMs

Conference Paper (2026)
Author(s)

Ali Al-Kaswan (TU Delft - Electrical Engineering, Mathematics and Computer Science)

Claudio Spiess (University of California)

Prem Devanbu (University of California)

Arie Van Deursen (TU Delft - Electrical Engineering, Mathematics and Computer Science)

Maliheh Izadi (TU Delft - Electrical Engineering, Mathematics and Computer Science)

Research Group
Software Engineering
DOI related publication
https://doi.org/10.1145/3793302.3793341 Final published version
More Info
expand_more
Publication Year
2026
Language
English
Research Group
Software Engineering
Pages (from-to)
86-97
Publisher
ACM
ISBN (electronic)
9798400724749
Event
23rd International Conference on Mining Software Repositories, MSR 2026 (2026-04-13 - 2026-04-14), Rio de Janeiro, Brazil
Page Views
32
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

Abstract

Large language models are increasingly used for code generation and debugging, but their outputs can still contain bugs that originate from training data. Distinguishing whether an LLM prefers correct code, or a familiar incorrect version might be influenced by what it's been exposed to during training. We introduce an exposure-aware evaluation framework that quantifies how prior exposure to buggy versus fixed code influences a model's preference. Using the ManySStuBs4J benchmark, we apply Data Portraits for membership testing on the Stack-V2 corpus to estimate whether each buggy and fixed variant was seen during training. We then stratify examples by exposure and compare model preference using code completion as well as multiple likelihood-based scoring metrics. We find that most examples (67%) have neither variant in the training data, and when only one is present, fixes are more frequently present than bugs. In model generations, models reproduce buggy lines far more often than fixes, with bug-exposed examples amplifying this tendency and fix-exposed examples showing only marginal improvement. In likelihood scoring, minimum and maximum token-probability metrics consistently prefer the fixed code across all conditions, indicating a stable bias toward correct fixes. In contrast, metrics like the Gini coefficient reverse preference when only the buggy variant was seen. Our results indicate that exposure can skew bug-fix evaluations and highlight the risk that LLMs may propagate memorised errors in practice.