Transformer with Tree-order Encoding for Neural Program Generation
While a considerable amount of semantic parsing approaches have employed RNN architectures for code generation tasks, there have been only few attempts to investigate the applicability of Transformers for this task. Including hierarchical information of the underlying programming language syntax has proven to be effective for code generation. Since the positional encoding of the Transformer can only represent positions in a flat sequence, we have extended the encoding scheme to allow the attention mechanism to also attend over hierarchical positions in the input. Furthermore, we have realized a decoder based on a restrictive grammar graph model to improve the generation accuracy and ensure the well-formedness of the generated code. While we did not surpass the state of the art, our findings suggest that employing a tree-based positional encoding in combination with a shared natural-language subword vocabulary improves generation performance over sequential positional encodings.
Code (1)
Tasks
Code GenerationDecoderSemantic ParsingMethods 이 논문이 사용한 방법론
Similar Papers 제목 키워드 기반
Novel positional encodings to enable tree-structured transformers
With interest in program synthesis and similarly flavored problems rapidly increasing, neural models optimized for tree-domain problems are of great value. In the sequence domain, transformers can learn relationships acro…
Program SynthesisSemantic ParsingTranslationNovel positional encodings to enable tree-based transformers
Neural models optimized for tree-based problems are of great value in tasks like SQL query extraction and program synthesis. On sequence-structured data, transformers have been shown to learn relationships across arbitra…
Program SynthesisSemantic ParsingTranslationAST-Transformer: Encoding Abstract Syntax Trees Efficiently for Code Summarization
Code summarization aims to generate brief natural language descriptions for source code. As source code is highly structured and follows strict programming language grammars, its Abstract Syntax Tree (AST) is often lever…
Code SummarizationTree Decomposition Attention for AMR-to-Text Generation
Text generation from AMR requires mapping a semantic graph to a string that it annotates. Transformer-based graph encoders, however, poorly capture vertex dependencies that may benefit sequence prediction. To impose orde…
AMR-to-Text GenerationText GenerationAn empirical study on the limitation of Transformers in program trace generation
We study Transformers on the task \emph{program trace generation} (PTG), where models produce step-by-step execution traces for synthetic programs. Unlike existing algorithmic problems, PTG externalizes reasoning through…