An AST Structure Enhanced Decoder for Code Generation
- 28 December 2021
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE/ACM Transactions on Audio, Speech, and Language Processing
- Vol. 30 (23299290) , 468-476
Abstract
Currently, the most dominant neural code generation modelsare often equipped with a tree-structured LSTM decoder, which outputs a sequence of actions to construct an Abstract Syntax Tree (AST) via pre-order traversal. However, such a decoder has two obvious drawbacks. First, except for the parent action, other faraway and important history actions rarely contribute to the current decision. Second, it also neglects future actions, which may be crucial for the prediction of the current action. To deal with these issues, in this paper, we propose a novel AST structure enhanced decoder for code generation, which significantly extends the decoder with respect to the above two aspects. First, we introduce an AST information enhanced attention mechanism to fully exploit history actions, of which impacts are further distinguished according to their syntactic distances, action types and relative positions; Second, we jointly model the predictions of current action and its important future action via multi-task learning, where the learned hidden state of the latter can be further leveraged to improve the former. Experimental results on commonly-used datasets demonstrate the effectiveness of our proposed decoder.1Keywords
Funding Information
- National Key Research and Development Program of China (2020AAA0108004)
- National Natural Science Foundation of China (61672440)
- Natural Science Foundation of Fujian Province of China (2020J06001)
- Youth Innovation Fund of Xiamen (3502Z20206059)
- Fundamental Research Funds for the Central Universities (20720200077)
This publication has 27 references indexed in Scilit:
- A Syntactic Neural Model for General-Purpose Code Generation2017
- Abstract Syntax Networks for Code Generation and Semantic Parsing2017
- Variational Neural Machine Translation2016
- Language to Logical Form with Neural Attention2016
- Latent Predictor Networks for Code Generation2016
- Learning to Generate Pseudo-Code from Source Code Using Statistical Machine Translation2015
- Interactive Synthesis Using Free-Form Queries2015
- Keyword programming in JavaAutomated Software Engineering, 2008
- NOVELNEURALMODULATORSAnnual Review of Neuroscience, 2003
- A 15 Year Perspective on Automatic ProgrammingIEEE Transactions on Software Engineering, 1985