SkCoder: A Sketch-based Approach for Automatic Code Generation
Not on the map. Why?
Abstract (arXiv)
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 code. Our motivations are that the extracted sketch provides a well-formed pattern for telling models "how to write". The post-editing further adds requirement-specific details to the sketch and outputs the complete code. We conduct experiments on two public datasets and a new dataset collected by this work. We compare our approach to 20 baselines using 5 widely used metrics. Experimental results show that (1) SkCoder can generate more correct programs, and outperforms the state-of-the-art - CodeT5-base by 30.30%, 35.39%, and 29.62% on three datasets. (2) Our approach is effective to multiple code generation models and improves them by up to 120.1% in Pass@1. (3) We investigate three plausible code sketches and discuss the importance of sketches. (4) We manually evaluate the generated code and prove the superiority of our SkCoder in three aspects.
Key facts. Cited by 40 papers in the map (data through 7 Oct 2026). First posted on arXiv 13 Feb 2023.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 13; 2024: 15; 2025: 9; 2026: 3.
40 papers.
Sort:
By area:
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Surveycited by 352
- 2023Structured Chain-of-Thought Prompting for Code Generationcited by 136
- 2023Self-Edit: Fault-Aware Code Editor for Code Generationcited by 110
- 2024EvoCodeBench: An Evolving Code Generation Benchmark Aligned with Real-World Code Repositoriescited by 71
- 2024DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositoriescited by 71
- 2023Large Language Models for Supply Chain Optimizationcited by 61
- 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translationcited by 57
- 2023Large Language Model-Aware In-Context Learning for Code Generationcited by 42
- 2023Hot or Cold? Adaptive Temperature Sampling for Code Generation with Large Language Modelscited by 37
- 2024EvoCodeBench: An Evolving Code Generation Benchmark with Domain-Specific Evaluationscited by 33
- 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Modelscited by 28
- 2024CodeS: Natural Language to Code Repository via Multi-Layer Sketchcited by 28
28 more
- 2023AceCoder: Utilizing Existing Code to Enhance Code Generationcited by 25
- 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunitiescited by 17
- 2025Exploring the Potential of Diffusion Large Language Models in Code Generationcited by 16
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Modelscited by 15
- 2023FRANC: A Lightweight Framework for High-Quality Code Generationcited by 14
- 2023Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?cited by 13
- 2024Collu-Bench: A Benchmark for Predicting Language Model Hallucinations in Codecited by 13
- 2023De-fine: Decomposing and Refining Visual Programs with Auto-Feedbackcited by 10
- 2024DevEval: Evaluating Code Generation in Practical Software Projectscited by 9
- 2024Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systemscited by 7
- 2024Building A Coding Assistant via the Retrieval-Augmented Language Modelcited by 5
- 2025Impact-driven Context Filtering For Cross-file Code Completioncited by 5
- 2025Multi-Agent GraphRAG: A Text-to-Cypher Framework for Labeled Property Graphscited by 5
- 2024A Study on Training and Developing Large Language Models for Behavior Tree Generationcited by 4
- 2024Showing LLM-Generated Code Selectively Based on Confidence of LLMscited by 4
- 2023Neural Machine Translation for Code Generationcited by 3
- 2023ZC3: Zero-Shot Cross-Language Code Clone Detectioncited by 3
- 2024NLP4PBM: A Systematic Review on Process Extraction using Natural Language Processing with Rule-based, Machine and Deep Learning Methodscited by 3
- 2026ShortCoder: Knowledge-Augmented Syntax Optimization for Token-Efficient Code Generationcited by 3
- 2024SketchFill: Sketch-Guided Code Generation for Imputing Derived Missing Valuescited by 2
- 2026EvoSci: A Bio-Inspired Multi-Agent Framework for the Evolution of Scientific Discoverycited by 2
- 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Modelscited by 1
- 2025A Systematic Approach for Assessing Large Language Models' Test Case Generation Capabilitycited by 1
- 2025Knowledge-Graph-Driven Data Synthesis for Low-Resource Software Development: A HarmonyOS Case Studycited by 1
- 2025Integrating Artificial Intelligence with Human Expertise: An In-depth Analysis of ChatGPT's Capabilities in Generating Metamorphic Relationscited by 0
- 2025A Systematic Evaluation of Parameter-Efficient Fine-Tuning Methods for the Security of Code LLMscited by 0
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Casescited by 0
- 2026From Guessing to Placeholding: A Cost-Theoretic Framework for Uncertainty-Aware Code Completioncited by 0
- 2026EvoSci: A Bio-Inspired Multi-Agent Framework for the Evolution of Scientific Discovery20 May 2026
- 2026From Guessing to Placeholding: A Cost-Theoretic Framework for Uncertainty-Aware Code Completion2 Apr 2026
- 2026ShortCoder: Knowledge-Augmented Syntax Optimization for Token-Efficient Code Generation14 Jan 2026
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Cases20 Dec 2025
- 2025Knowledge-Graph-Driven Data Synthesis for Low-Resource Software Development: A HarmonyOS Case Study29 Nov 2025
- 2025Multi-Agent GraphRAG: A Text-to-Cypher Framework for Labeled Property Graphs11 Nov 2025
- 2025A Systematic Evaluation of Parameter-Efficient Fine-Tuning Methods for the Security of Code LLMs16 Sep 2025
- 2025Exploring the Potential of Diffusion Large Language Models in Code Generation14 Sep 2025
- 2025Impact-driven Context Filtering For Cross-file Code Completion8 Aug 2025
- 2025Integrating Artificial Intelligence with Human Expertise: An In-depth Analysis of ChatGPT's Capabilities in Generating Metamorphic Relations28 Mar 2025
- 2025A Systematic Approach for Assessing Large Language Models' Test Case Generation Capability5 Feb 2025
- 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities23 Jan 2025
28 more
- 2024SketchFill: Sketch-Guided Code Generation for Imputing Derived Missing Values26 Dec 2024
- 2024Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systems29 Nov 2024
- 2024EvoCodeBench: An Evolving Code Generation Benchmark with Domain-Specific Evaluations30 Oct 2024
- 2024Building A Coding Assistant via the Retrieval-Augmented Language Model21 Oct 2024
- 2024Collu-Bench: A Benchmark for Predicting Language Model Hallucinations in Code13 Oct 2024
- 2024Showing LLM-Generated Code Selectively Based on Confidence of LLMs4 Oct 2024
- 2024NLP4PBM: A Systematic Review on Process Extraction using Natural Language Processing with Rule-based, Machine and Deep Learning Methods10 Sep 2024
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Models29 Jun 2024
- 2024DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositories30 May 2024
- 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translation23 Apr 2024
- 2024EvoCodeBench: An Evolving Code Generation Benchmark Aligned with Real-World Code Repositories31 Mar 2024
- 2024CodeS: Natural Language to Code Repository via Multi-Layer Sketch25 Mar 2024
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Survey29 Feb 2024
- 2024A Study on Training and Developing Large Language Models for Behavior Tree Generation16 Jan 2024
- 2024DevEval: Evaluating Code Generation in Practical Software Projects12 Jan 2024
- 2023De-fine: Decomposing and Refining Visual Programs with Auto-Feedback21 Nov 2023
- 2023Large Language Model-Aware In-Context Learning for Code Generation15 Oct 2023
- 2023Hot or Cold? Adaptive Temperature Sampling for Code Generation with Large Language Models6 Sep 2023
- 2023ZC3: Zero-Shot Cross-Language Code Clone Detection26 Aug 2023
- 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Models21 Aug 2023
- 2023FRANC: A Lightweight Framework for High-Quality Code Generation17 Jul 2023
- 2023Large Language Models for Supply Chain Optimization8 Jul 2023
- 2023Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?2 Jun 2023
- 2023Neural Machine Translation for Code Generation22 May 2023
- 2023Structured Chain-of-Thought Prompting for Code Generation11 May 2023
- 2023Self-Edit: Fault-Aware Code Editor for Code Generation6 May 2023
- 2023AceCoder: Utilizing Existing Code to Enhance Code Generation31 Mar 2023
- 2023Implant Global and Local Hierarchy Information to Sequence based Code Representation Models14 Mar 2023
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Surveycited by 352
- 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunitiescited by 17
- 2024Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systemscited by 7
- 2024Building A Coding Assistant via the Retrieval-Augmented Language Modelcited by 5
- 2025Impact-driven Context Filtering For Cross-file Code Completioncited by 5
- 2025Multi-Agent GraphRAG: A Text-to-Cypher Framework for Labeled Property Graphscited by 5
- 2025Multi-Agent GraphRAG: A Text-to-Cypher Framework for Labeled Property Graphs11 Nov 2025
- 2025Impact-driven Context Filtering For Cross-file Code Completion8 Aug 2025
- 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities23 Jan 2025
- 2024Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systems29 Nov 2024
- 2024Building A Coding Assistant via the Retrieval-Augmented Language Model21 Oct 2024
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Survey29 Feb 2024
- 2023Structured Chain-of-Thought Prompting for Code Generationcited by 136
- 2023Structured Chain-of-Thought Prompting for Code Generation11 May 2023
- 2023Self-Edit: Fault-Aware Code Editor for Code Generationcited by 110
- 2024EvoCodeBench: An Evolving Code Generation Benchmark Aligned with Real-World Code Repositoriescited by 71
- 2024DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositoriescited by 71
- 2023Large Language Models for Supply Chain Optimizationcited by 61
- 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translationcited by 57
- 2023Large Language Model-Aware In-Context Learning for Code Generationcited by 42
- 2023Hot or Cold? Adaptive Temperature Sampling for Code Generation with Large Language Modelscited by 37
- 2024EvoCodeBench: An Evolving Code Generation Benchmark with Domain-Specific Evaluationscited by 33
- 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Modelscited by 28
- 2024CodeS: Natural Language to Code Repository via Multi-Layer Sketchcited by 28
- 2023AceCoder: Utilizing Existing Code to Enhance Code Generationcited by 25
- 2025Exploring the Potential of Diffusion Large Language Models in Code Generationcited by 16
12 most cited of 30 All 30 (JSON)
- 2026From Guessing to Placeholding: A Cost-Theoretic Framework for Uncertainty-Aware Code Completion2 Apr 2026
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Cases20 Dec 2025
- 2025A Systematic Evaluation of Parameter-Efficient Fine-Tuning Methods for the Security of Code LLMs16 Sep 2025
- 2025Exploring the Potential of Diffusion Large Language Models in Code Generation14 Sep 2025
- 2025Integrating Artificial Intelligence with Human Expertise: An In-depth Analysis of ChatGPT's Capabilities in Generating Metamorphic Relations28 Mar 2025
- 2025A Systematic Approach for Assessing Large Language Models' Test Case Generation Capability5 Feb 2025
- 2024SketchFill: Sketch-Guided Code Generation for Imputing Derived Missing Values26 Dec 2024
- 2024EvoCodeBench: An Evolving Code Generation Benchmark with Domain-Specific Evaluations30 Oct 2024
- 2024Collu-Bench: A Benchmark for Predicting Language Model Hallucinations in Code13 Oct 2024
- 2024Showing LLM-Generated Code Selectively Based on Confidence of LLMs4 Oct 2024
- 2024NLP4PBM: A Systematic Review on Process Extraction using Natural Language Processing with Rule-based, Machine and Deep Learning Methods10 Sep 2024
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Models29 Jun 2024
12 newest of 30 All 30 (JSON)