Cascaded Code Editing: Large-Small Model Collaboration for Effective and Efficient Code Editing
Chaozheng Wang, Zezhou Yang, Shuzheng Gao, Cuiyun Gao, Zongjie Li, Yichen Li, Ting Peng, Hailiang Huang, Yuetang Deng, Michael R. Lyu

TL;DR
This paper introduces a cascaded approach to code editing that combines large and small language models to improve efficiency and effectiveness in modifying code based on natural language requirements.
Contribution
It proposes a two-stage cascade framework that decomposes code editing into sketch generation by a large model and sketch application by a smaller model, enhancing efficiency.
Findings
Reduces token generation by using a large model only for sketch creation.
Improves code editing efficiency by delegating detailed editing to a smaller model.
Identifies limitations of small models in handling long-context and cross-file dependencies.
Abstract
Code editing constitutes a fundamental practice in software development, wherein developers modify existing codebases according to natural language requirements. Accurate code editing necessitates a comprehensive understanding of both the existing codebase and the modification requirements. Although large language models (LLMs) have demonstrated promising performance in code editing tasks, they suffer from substantial inefficiency by generating entire modified files that largely consist of unchanged code. While smaller models could potentially address this inefficiency, they typically lack the capacity to effectively comprehend long code contexts required for accurate editing. To ensure both effectiveness and efficiency, we propose to decompose code editing into a two-stage cascade: \textbf{edit sketch generation}, wherein a large model first produces concise sketches representing the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
