NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

When Code Changes, Answers Don't: Breaking Semantic Inertia in Code Models

Fei Liu, Hao Li, Yuxin Xiao, Yawen Zeng, Jin Xu, Dongliang LiaoOpenReview 2027 · Submission to ICLR 2027 · Withdrawn

Its authors withdrew this paper, so there is no full text to read or summarize.

Abstract

Code models increasingly reason about edited programs, yet they often return the original program's now-obsolete output for an independently queried edited program. We call this behavioral failure semantic inertia. A small edit may change the output for one input while preserving it for another, so reliable reasoning requires a selective update rather than a blanket reaction to modified code. Across three execution-tuned Qwen3 models, 93% of edited-program errors following a correct original prediction repeat the original output. On a separate frozen panel of 15 models and checkpoints, semantic inertia spans model families and remains measurable even in the strongest hosted models. We introduce the Semantic Inertia Benchmark to measure this capability directly. Each group pairs an original and edited program with a Changed input that requires Revision and an Unchanged input that requires Preservation; Joint accuracy requires all four program–input predictions to be correct. We then propose Counterfactual Regrounding, which trains on these execution contrasts, emphasizes edited-program answers, and retains correct original-program judgments. Inference remains a single forward pass on one program and input. On 1,000 APPS-derived groups held out from adaptation, Counterfactual Regrounding raises Qwen3-4B's Joint accuracy from 9.5% to 16.0%, lowers inertia from 75.4% to 63.5%, and improves Preservation. Its gains grow with Qwen3 model size, transfer to OpenCoder-1.5B, extend to unseen edit families and open-ended generation, and persist on the separate 2,323-group panel. These results establish selective semantic updating as a distinct capability—and execution contrasts as an effective way to train it.
BibTeX
@misc{liu2027when,
  author = {Fei Liu and Hao Li and Yuxin Xiao and Yawen Zeng and Jin Xu and Dongliang Liao},
  title = {{When Code Changes, Answers Don't: Breaking Semantic Inertia in Code Models}},
  year = {2027},
  url = {https://openreview.net/forum?id=obWLZw9hw5},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2027},
}

Loading related content...

Figure