Author:
Sun Zeyu,Zhu Qihao,Mou Lili,Xiong Yingfei,Li Ge,Zhang Lu
Abstract
Code generation maps a program description to executable source code in a programming language. Existing approaches mainly rely on a recurrent neural network (RNN) as the decoder. However, we find that a program contains significantly more tokens than a natural language sentence, and thus it may be inappropriate for RNN to capture such a long sequence. In this paper, we propose a grammar-based structural convolutional neural network (CNN) for code generation. Our model generates a program by predicting the grammar rules of the programming language; we design several CNN modules, including the tree-based convolution and pre-order convolution, whose information is further aggregated by dedicated attentive pooling layers. Experimental results on the HearthStone benchmark dataset show that our CNN code generator significantly outperforms the previous state-of-the-art method by 5 percentage points; additional experiments on several semantic parsing tasks demonstrate the robustness of our model. We also conduct in-depth ablation test to better understand each component of our model.
Publisher
Association for the Advancement of Artificial Intelligence (AAAI)
Cited by
58 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Oracle-Guided Program Selection from Large Language Models;Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis;2024-09-11
2. Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit;ACM Computing Surveys;2024-05-18
3. A multi-encoder model for automatic code comment generation;Fourth International Conference on Sensors and Information Technology (ICSI 2024);2024-05-06
4. GrammarT5: Grammar-Integrated Pretrained Encoder-Decoder Neural Model for Code;Proceedings of the IEEE/ACM 46th International Conference on Software Engineering;2024-04-12
5. Transformers based Python Code Generation from Natural Language;2024 5th International Conference on Innovative Trends in Information Technology (ICITIIT);2024-03-15