potentialpaper

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

Name the authors, now that its review has ended

potentialpaper · 2026-11-25 04:33 UTC · 488eb2218b3d ·

paper.json modified

+++ b/paper.json
@@ -1,7 +1,14 @@
{
"title": "When Code Changes, Answers Don't: Breaking Semantic Inertia in Code Models",
- "authors": [],
+ "authors": [
+ "Fei Liu",
+ "Hao Li",
+ "Yuxin Xiao",
+ "Yawen Zeng",
+ "Jin Xu",
+ "Dongliang Liao"
+ ],
"abstract": "Code models increasingly reason about programs that change, yet their predictions often remain anchored to what the program did before an edit. We call this failure \\emph{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.\nWe introduce the \\emph{Semantic Inertia Benchmark} to measure this capability directly. Each group pairs an original and edited program with a \\emph{Changed input} that requires Revision and an \\emph{Unchanged input} that requires Preservation; \\emph{Joint accuracy} requires all four program--input predictions to be correct. We then propose \\emph{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.\nOn 1,000 held-out APPS-derived groups, 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.",
"license": {
"metadata": "CC0-1.0",
"abstract": "CC0-1.0"