Exploring Dynamic Selection of Branch Expansion Orders for Code Generation

06/01/2021
by   Hui Jiang, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/18/2020

Multi-branch Attentive Transformer

While the multi-branch architecture is one of the key ingredients to the...
research
03/25/2022

Supplemental Material: Lifelong Generative Modelling Using Dynamic Expansion Graph Model

In this article, we provide the appendix for Lifelong Generative Modelli...
research
12/12/2021

Tree-based Focused Web Crawling with Reinforcement Learning

A focused crawler aims at discovering as many web pages relevant to a ta...
research
08/22/2022

Antecedent Predictions Are More Important Than You Think: An Effective Method for Tree-Based Code Generation

Code generation focuses on the automatic conversion of natural language ...
research
09/25/2019

"Good Robot!": Efficient Reinforcement Learning for Multi-Step Visual Tasks via Reward Shaping

In order to learn effectively, robots must be able to extract the intang...
research
11/27/2020

TaylorGAN: Neighbor-Augmented Policy Update for Sample-Efficient Natural Language Generation

Score function-based natural language generation (NLG) approaches such a...
research
11/30/2022

BEVPoolv2: A Cutting-edge Implementation of BEVDet Toward Deployment

We release a new codebase version of the BEVDet, dubbed branch dev2.0. W...

Please sign up or login with your details

Forgot password? Click here to reset