Cascaded Code Editing: Large-Small Model Collaboration for Effective and Efficient Code Editing
- URL: http://arxiv.org/abs/2604.19201v1
- Date: Tue, 21 Apr 2026 08:08:30 GMT
- Title: Cascaded Code Editing: Large-Small Model Collaboration for Effective and Efficient Code Editing
- Abstract summary: We propose to decompose code editing into a two-stage cascade: textbfedit sketch generation, and textbfedit sketch application.<n>This cascaded design reduces the number of tokens generated by the large model, as the majority of the output is handled by the smaller, more efficient model.<n>The effectiveness of this approach is constrained by current small models' limited capabilities in handling long-context scenarios and cross-file dependencies.
- Score: 40.309873338087975
- License: http://creativecommons.org/licenses/by/4.0/
- 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 requisite modifications (the more challenging phase), and \textbf{edit sketch application}, wherein a smaller model integrates these sketches into the original code to produce the final output edited code (the simpler phase). This cascaded design reduces the number of tokens generated by the large model, as the majority of the output is handled by the smaller, more efficient model, thereby enhancing overall efficiency. However, the effectiveness of this approach is constrained by current small models' limited capabilities in handling long-context scenarios and cross-file dependencies, which are essential for accurate sketch application in real-world codebases. To address these limitations and enhance smaller models' sketch application capabilities, ...
Related papers
- To Diff or Not to Diff? Structure-Aware and Adaptive Output Formats for Efficient LLM-based Code Editing [54.399335188667045]
BlockDiff and FuncDiff are structure-aware diff formats that represent changes as block-level rewrites of syntactically coherent units.<n>AdaEdit is a general adaptive edit strategy that trains LLMs to dynamically choose the most token-efficient format between a given diff format and full code.
arXiv Detail & Related papers (2026-04-30T01:14:13Z) - Readability-Robust Code Summarization via Meta Curriculum Learning [53.44612630063336]
In the real world, code is often poorly structured or obfuscated, significantly degrading model performance.<n>We propose RoFTCodeSum, a novel fine-tuning method that enhances the robustness of code summarization against poorly readable code.
arXiv Detail & Related papers (2026-01-09T02:38:24Z) - EfficientEdit: Accelerating Code Editing via Edit-Oriented Speculative Decoding [12.558682788313371]
Large Language Models (LLMs) have demonstrated remarkable capabilities in code editing, substantially enhancing software development productivity.<n>We propose EfficientEdit, a novel method that improves LLM-based code editing efficiency through two key mechanisms based on speculative decoding.<n> Experimental results show that EfficientEdit can achieve up to 10.38$times$ and 13.09$times$ speedup compared to standard autoregressive decoding.
arXiv Detail & Related papers (2025-06-03T12:01:20Z) - RETROcode: Leveraging a Code Database for Improved Natural Language to Code Generation [10.19019476978683]
We present RETROcode, a novel adaptation of the RETRO architecture for sequence-to-sequence models.<n>Our findings indicate that RETROcode not only outperforms similar-sized traditional architectures on test sets but also approaches the effectiveness of the much larger Codex model.
arXiv Detail & Related papers (2025-04-08T07:41:13Z) - Robust Learning of Diverse Code Edits [10.565439872488328]
Software engineering activities frequently involve edits to existing code.<n>Code language models (LMs) lack the ability to handle diverse types of code-edit requirements.<n>We propose a novel synthetic data generation pipeline and an adaptation algorithm.
arXiv Detail & Related papers (2025-03-05T16:39:04Z) - Gatekeeper: Improving Model Cascades Through Confidence Tuning [45.46791873454989]
We introduce a novel loss function called Gatekeeper for calibrating smaller models in cascade setups.<n>Our approach fine-tunes the smaller model to confidently handle tasks it can perform correctly while deferring complex tasks to the larger model.
arXiv Detail & Related papers (2025-02-26T17:29:08Z) - Exploring Data-Efficient Adaptation of Large Language Models for Code Generation [64.5583894165813]
We propose a novel adaptation approach named DEED, which stands for Data-Efficient adaptation with Error-Driven learning for code generation.<n> Experimental results show that, compared to other mainstream fine-tuning approaches, DEED achieves superior performance with few training data.
arXiv Detail & Related papers (2024-02-29T16:09:02Z) - Speculative Decoding with Big Little Decoder [108.95187338417541]
Big Little Decoder (BiLD) is a framework that can improve inference efficiency and latency for a wide range of text generation applications.
On an NVIDIA T4 GPU, our framework achieves a speedup of up to 2.12x speedup with minimal generation quality degradation.
Our framework is fully plug-and-play and can be applied without any modifications in the training process or model architecture.
arXiv Detail & Related papers (2023-02-15T18:55:29Z) - CoditT5: Pretraining for Source Code and Natural Language Editing [34.77621217370665]
CoditT5 is a large language model for software-related editing tasks that is pretrained on large amounts of source code and natural language comments.
We fine-tune it on various downstream editing tasks, including comment updating, bug fixing, and automated code review.
arXiv Detail & Related papers (2022-08-10T16:59:40Z) - Memory-Based Model Editing at Scale [102.28475739907498]
Existing model editors struggle to accurately model an edit's intended scope.
We propose Semi-Parametric Editing with a Retrieval-Augmented Counterfactual Model (SERAC)
SERAC stores edits in an explicit memory and learns to reason over them to modulate the base model's predictions as needed.
arXiv Detail & Related papers (2022-06-13T23:40:34Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.