Exploring Dynamic Selection of Branch Expansion Orders for Code Generation
Not on the map. Why?
Abstract (arXiv)
Due to the great potential in facilitating software development, code generation has attracted increasing attention recently. Generally, dominant models are Seq2Tree models, which convert the input natural language description into a sequence of tree-construction actions corresponding to the pre-order traversal of an Abstract Syntax Tree (AST). However, such a traversal order may not be suitable for handling all multi-branch nodes. In this paper, we propose to equip the Seq2Tree model with a context-based Branch Selector, which is able to dynamically determine optimal expansion orders of branches for multi-branch nodes. Particularly, since the selection of expansion orders is a non-differentiable multi-step operation, we optimize the selector through reinforcement learning, and formulate the reward function as the difference of model losses obtained through different expansion orders. Experimental results and in-depth analysis on several commonly-used datasets demonstrate the effectiveness and generality of our approach. We have released our code at https://github.com/DeepLearnXMU/CG-RL.
Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Builds on 23 of its 30 references that are in the map. First posted on arXiv 1 Jun 2021.
Builds on
23 of 30 references.
References · 23
- 2017Attention Is All You Needcited by 59,932
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2016Self-critical Sequence Training for Image Captioningcited by 544
- 2017SkipNet: Learning Dynamic Routing in Convolutional Networkscited by 328
- 2019Levenshtein Transformercited by 197
- 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
- 2016Language to Logical Form with Neural Attentioncited by 158
- 2019Insertion Transformer: Flexible Sequence Generation via Insertion Operationscited by 123
- 2018Coarse-to-Fine Decoding for Neural Semantic Parsingcited by 110
- 2017Abstract Syntax Networks for Code Generation and Semantic Parsingcited by 92
- 2018TRANX: A Transition-based Neural Abstract Syntax Parser for Semantic Parsing and Code Generationcited by 88
- 2016Latent Predictor Networks for Code Generationcited by 73
11 more
- 2019Code Generation as a Dual Task of Code Summarizationcited by 62
- 2019TreeGen: A Tree-Based Transformer Architecture for Code Generationcited by 58
- 2019Non-Monotonic Sequential Text Generationcited by 55
- 2019Insertion-based Decoding with automatically Inferred Generation Ordercited by 43
- 2018Retrieval-Based Neural Code Generationcited by 41
- 2020Incorporating External Knowledge through Pre-training for Natural Language to Code Generationcited by 36
- 2019Program Synthesis and Semantic Parsing with Learned Code Idiomscited by 34
- 2018A Grammar-Based Structural CNN Decoder for Code Generationcited by 29
- 2020Dynamic Context Selection for Document-level Neural Machine Translation via Reinforcement Learningcited by 25
- 2018Asynchronous Bidirectional Decoding for Neural Machine Translationcited by 21
- 2021Improving Tree-Structured Decoder Training for Code Generation via Mutual Learningcited by 10
Built on by
Citing papers per year: 2021: 1; 2022: 4; 2023: 2; 2024: 1; 2025: 2.
10 papers.
- 2023Large Language Model-Aware In-Context Learning for Code Generationcited by 42
- 2022StructCoder: Structure-Aware Transformer for Code Generationcited by 33
- 2025EpiCoder: Encompassing Diversity and Complexity in Code Generationcited by 21
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Modelscited by 15
- 2021Bridging Subword Gaps in Pretrain-Finetune Paradigm for Natural Language Generationcited by 14
- 2022Incorporating Domain Knowledge through Task Augmentation for Front-End JavaScript Code Generationcited by 11
- 2022CodePAD: Sequence-based Code Generation with Pushdown Automatoncited by 7
- 2023Search-Engine-augmented Dialogue Response Generation with Cheaply Supervised Query Productioncited by 4
- 2025UniGenCoder: Merging Seq2Seq and Seq2Tree Paradigms for Unified Code Generationcited by 2
- 2022Antecedent Predictions Are More Important Than You Think: An Effective Method for Tree-Based Code Generationcited by 0
- 2025UniGenCoder: Merging Seq2Seq and Seq2Tree Paradigms for Unified Code Generation18 Feb 2025
- 2025EpiCoder: Encompassing Diversity and Complexity in Code Generation8 Jan 2025
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Models29 Jun 2024
- 2023Large Language Model-Aware In-Context Learning for Code Generation15 Oct 2023
- 2023Search-Engine-augmented Dialogue Response Generation with Cheaply Supervised Query Production16 Feb 2023
- 2022CodePAD: Sequence-based Code Generation with Pushdown Automaton2 Nov 2022
- 2022Incorporating Domain Knowledge through Task Augmentation for Front-End JavaScript Code Generation22 Aug 2022
- 2022Antecedent Predictions Are More Important Than You Think: An Effective Method for Tree-Based Code Generation22 Aug 2022
- 2022StructCoder: Structure-Aware Transformer for Code Generation10 Jun 2022
- 2021Bridging Subword Gaps in Pretrain-Finetune Paradigm for Natural Language Generation11 Jun 2021