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.
Create a lesson
Metadata
- Categories
- cs.CL, cs.SE
- Comments
- EMNLP 2026 Findings
Related papers
Residual Cross-Model Narrative Convergence under Shared Prompts: Auditing Prompt Controls and Narrative Measurement
Shared title terminologycs.CLMehdy Sedaghat Payam
The FlightFinder Occurrence Corpus: harmonising 128 aviation-safety source codes into one deduplicated cross-national accident dataset
Shared title terminologycs.CLDenys Kolomiiets
Scale-QLoRA: Code-Invariant Adapter Merging for Native 4-bit Microscaling LLMs
Shared title terminologycs.CLTung-Ling Li, Jiale Huang, Lee-Chi Wang et al.
Two-Stage Reinforcement Learning for Sound and Adversarial Test Generation in Code LLMs
Shared title terminologycs.CLJiacheng Xu, Wentao Zhang, Zhiyi Lyu et al.
IRTIQA: Evolving in English, Evaluated in Urdu -- Does Agent Self-Evolution Transfer from English to Urdu and Code-Switched Input?
Shared title terminologycs.CLAbdullah Hashmat, Danish Javed, Usman Naseem et al.
ChemDeduce: Benchmarking LLMs for Unknown Chemical Identification through Interactive Simulated Experiments
Shared title terminologycs.CLHengyi Cai, Yuqi Tang, Zichang Li et al.