arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

CROCODIL:基于大语言模型的跨模型代码编辑

CROCODIL: Cross-Model Code Editing with LLMs

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

arXiv 2609.03894首次发表:更新:

发表机构

The University of Texas at Austin; Cisco Research(德克萨斯大学奥斯汀分校; 思科研究院)

机构由 AI 辅助整理,请以论文原文为准。

AI 中文总结

本研究针对多LLM协作时的外来代码过度编辑问题,提出CROCODIL后训练框架,通过相似度奖励与执行奖励的乘积优化,在保证功能正确的同时减少了不必要的代码编辑。

AI 中文摘要

大语言模型(LLMs)已成为代码生成与编辑领域的通用工具,然而开发团队常使用多个LLM助手:不同开发者偏好不同模型,同一开发者也会在不同编码会话间切换模型,因此某一模型生成的代码编辑常被应用于其他模型生成的“外来代码”中。这些LLM在不同数据集上训练,存在不同风格偏好,本研究探究LLM编辑其他模型生成的不同风格代码时是否存在行为差异,发现模型对外来代码的编辑量更多且常过度编辑。本研究提出CROCODIL(Cross-model Code Editing with LLMs),一种用于减少过度编辑同时保持功能正确性的后训练框架:其相似度奖励惩罚大改动,执行奖励评估构建与测试的成功情况,通过两者乘积鼓励策略在不降低编辑任务成功率的前提下缩小编辑规模。CROCODIL的代码可在指定网址获取。

英文摘要

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.

CommentsEMNLP 2026 Findings

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑