SkCoder: A Sketch-based Approach for Automatic Code Generation
Jia Li, Yongmin Li, Ge Li, Zhi Jin, Yiyang Hao, Xing Hu

TL;DR
SkCoder introduces a sketch-based method for automatic code generation that retrieves, extracts, and edits code sketches to produce more accurate programs, outperforming existing models on multiple datasets.
Contribution
The paper presents SkCoder, a novel approach that leverages code sketches for improved accuracy in code generation, addressing limitations of previous copy-based methods.
Findings
SkCoder outperforms state-of-the-art models by over 30% on three datasets.
The approach enhances multiple code generation models, increasing Pass@1 by up to 120%.
Manual evaluation confirms SkCoder's superior code quality.
Abstract
Recently, deep learning techniques have shown great success in automatic code generation. Inspired by the code reuse, some researchers propose copy-based approaches that can copy the content from similar code snippets to obtain better performance. Practically, human developers recognize the content in the similar code that is relevant to their needs, which can be viewed as a code sketch. The sketch is further edited to the desired code. However, existing copy-based approaches ignore the code sketches and tend to repeat the similar code without necessary modifications, which leads to generating wrong results. In this paper, we propose a sketch-based code generation approach named SkCoder to mimic developers' code reuse behavior. Given a natural language requirement, SkCoder retrieves a similar code snippet, extracts relevant parts as a code sketch, and edits the sketch into the desired…
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.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Advanced Malware Detection Techniques · Software Testing and Debugging Techniques
