Lune

ACL2021Top-tier venue

Exploring Dynamic Selection of Branch Expansion Orders for Code Generation

Hui Jiang, Chulun Zhou, Fandong Meng, Biao Zhang, Jie Zhou, Degen Huang, Qingqiang Wu, Jinsong Su

Abstract

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Improving Tree-Structured Decoder Training for Code Generation via Mutual Learning cites TreeGen: A Tree-Based Transformer Architecture for Code Generation
  • Bridging Subword Gaps in Pretrain-Finetune Paradigm for Natural Language Generation cites Improving Tree-Structured Decoder Training for Code Generation via Mutual Learning
  • Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Models cites When to Stop? Towards Efficient Code Generation in LLMs with Excess Token Prevention
  • CODEP: Grammatical Seq2Seq Model for General-Purpose Code Generation cites Improving Tree-Structured Decoder Training for Code Generation via Mutual Learning
  • CODEP: Grammatical Seq2Seq Model for General-Purpose Code Generation cites TreeGen: A Tree-Based Transformer Architecture for Code Generation
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. CODEP: Grammatical Seq2Seq Model for General-Purpose Code GenerationYihong Dong, Ge Li, Zhi JinISSTA 2023 · 18 citations
  2. When to Stop? Towards Efficient Code Generation in LLMs with Excess Token PreventionLianghong Guo, Yanlin Wang, Ensheng Shi, Wanjun Zhong et al.ISSTA 2024 · 16 citations
  3. Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language ModelsYanlin Wang, Tianyue Jiang, Mingwei Liu, Jiachi Chen et al.FSE 2025 · 6 citations
  4. Bridging Subword Gaps in Pretrain-Finetune Paradigm for Natural Language GenerationXin Liu, Baosong Yang, Dayiheng Liu, Haibo Zhang et al.ACL 2021

Builds on3

  1. TreeGen: A Tree-Based Transformer Architecture for Code GenerationZeyu Sun, Qihao Zhu, Yingfei Xiong, Yican Sun et al.AAAI 2020 · 196 citations
  2. Dynamic Context Selection for Document-level Neural Machine Translation via Reinforcement LearningXiaomian Kang, Yang Zhao, Jiajun Zhang, Chengqing ZongEMNLP 2020 · 61 citations
  3. Improving Tree-Structured Decoder Training for Code Generation via Mutual LearningBinbin Xie, Jinsong Su, Yubin Ge, Xiang Li et al.AAAI 2021 · 30 citations

Related papers

  1. StepCoder: Improving Code Generation with Reinforcement Learning from Compiler FeedbackShihan Dou, Yan Liu, Haoxiang Jia, Enyu Zhou et al.ACL 2024 · 12 citations
  2. CodeRM-NT: Reward Model for Code RL without Unit TestsXiao Xia, Dan Zhang, Tianrui SunACL Findings 2026
  3. Compilable Neural Code Generation with Compiler FeedbackXin Wang, Yasheng Wang, Yao Wan, Fei Mi et al.ACL Findings 2022 · 46 citations
  4. TAG : Type Auxiliary Guiding for Code Comment GenerationRuichu Cai, Zhihao Liang, Boyan Xu, Zijian Li et al.ACL 2020 · 21 citations
  5. Multi-Agent Reinforcement Learning Meets Leaf Sequencing in RadiotherapyRiqiang Gao, Florin-Cristian Ghesu, Simon Arberet, Shahab Basiri et al.ICML 2024 · 5 citations
Dusk over the sea between two cliffs drawn in fine vertical lines