CodeGen-Search: A Code Generation Model Incorporating Similar Sample Information
- 30 October 2023
- journal article
- research article
- Published by World Scientific Pub Co Pte Ltd in International Journal of Software Engineering and Knowledge Engineering
- Vol. 33 (11n12) , 1899-1921
Abstract
Code generation has a positive significance in supporting software development, reducing labor intensity, and improving development efficiency. Some scholars use similar code information to enhance the quality of code generation. However, to improve the efficiency and accuracy of programming in daily development tasks, developers often search for similar samples as references. They get the code’s syntactic structure and semantic information from similar samples to assist in programming development. Inspired by this, we argue that similar samples are helpful for code generation. This paper proposes a CodeGen-Search model to improve code generation quality by incorporating similar samples. To fully utilize the information of similar samples, the model adopts the “pre-training [ ] fine-tuning” pattern. The model uses a minimum edit distance algorithm to find some similar samples with natural language (NL), and uses different encoders to extract the features of the NL and the code in similar samples. Experimental results show that our model efficiently improves the quality of the generated code. Compared to the state-of-the-art model, the CodeGen-Search model improves the BLEU by 1.5%, the Rough by 0.8% on the HS dataset, and the StrAcc by 0.5% on the ATIS dataset.Keywords
Funding Information
- National Natural Science Foundation of China (61877031)
- Jiangxi Normal University (YJS2021031)
This publication has 17 references indexed in Scilit:
- TRANX: A Transition-based Neural Abstract Syntax Parser for Semantic Parsing and Code Generation2018
- Coarse-to-Fine Decoding for Neural Semantic Parsing2018
- Xception: Deep Learning with Depthwise Separable Convolutions2017
- A Syntactic Neural Model for General-Purpose Code Generation2017
- Abstract Syntax Networks for Code Generation and Semantic Parsing2017
- Deep Residual Learning for Image Recognition2016
- Language to Logical Form with Neural Attention2016
- Latent Predictor Networks for Code Generation2016
- Morpho-syntactic Lexical Generalization for CCG Semantic Parsing2014
- The ATIS spoken language systems pilot corpus1990