CROCODIL: Cross-Model Code Editing with LLMs

Linghan Zhong, Aditya Thimmaiah, Jayanth Srinivasa, Milos Gligoric, Junyi Jessy Li


Abstract
Large language models (LLMs) have become ubiquitous tools for code generation and editing. However, development teams often use multiple LLM assistants. Different developers may prefer different models, and individual developers may switch between models across different coding sessions. Because of this, the edits any one model makes are frequently applied to foreign code originally generated by another model. These LLMs are often trained on different datasets, and as a result have different stylistic preferences. Do LLMs behave differently when they edit foreign code originally written by a different LLM with a different coding style? We find that models tend to make more, and often excessive, edits on foreign code. We introduce CROCODIL (Cross-model Code Editing with LLMs), a post-training framework for reducing excessive edits while preserving functional correctness. CROCODIL’s similarity reward penalizes large changes, while its execution reward scores build and test success. We use the product of these two rewards to encourage the policy to decrease the edit size without decreasing the edit task success rate. CROCODIL is available at https://github.com/EngineeringSoftware/Crocodil.
Anthology ID:
2026.findings-emnlp.1362
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2026
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
Findings
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
28915–28933
Language:
URL:
https://aclanthology.org/2026.findings-emnlp.1362/
DOI:
Bibkey:
Cite (ACL):
Linghan Zhong, Aditya Thimmaiah, Jayanth Srinivasa, Milos Gligoric, and Junyi Jessy Li. 2026. CROCODIL: Cross-Model Code Editing with LLMs. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 28915–28933, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
CROCODIL: Cross-Model Code Editing with LLMs (Zhong et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-emnlp.1362.pdf