Hongmo Tao

Author directory

2026

Real code-editing requests typically mix the target program with other related materials, such as test results or documentation. However, models often make mistakes by incorrectly changing these supporting materials or missing the actual code that needs correction. To investigate this issue, we created multiple task scenarios where the code needing changes and the intended behavior remained constant, while only the surrounding supporting texts varied. This approach allowed us to test if supporting texts that resemble code can confuse the model, making it difficult to identify the correct code to modify. To address this, we developed a simple yet effective training method by showing the model examples of correct and incorrect edits. Specifically, Correct examples only modify the intended code, whereas incorrect examples mistakenly alter or duplicate supporting texts. Our results suggest that reliable code editing depends on the model’s early ability to distinguish between guidance materials and the actual code requiring changes.