Improving Tree-Structured Decoder Training for Code Generation via Mutual Learning
Binbin Xie, Jinsong Su, Yubin Ge, Xiang Li, Jianwei Cui, Junfeng Yao, Bin Wang
Abstract
Code generation aims to automatically generate a piece of code given an input natural language utterance. Currently, among dominant models, it is treated as a sequence-to-tree task, where a decoder outputs a sequence of actions corresponding to the pre-order traversal of an Abstract Syntax Tree. However, such a decoder only exploits the pre-order traversal based preceding actions, which are insufficient to ensure correct action predictions. In this paper, we first throughly analyze the context modeling difference between neural code generation models with different traversals based decodings (preorder traversal vs breadth-first traversal), and then propose to introduce a mutual learning framework to jointly train these models. Under this framework, we continuously enhance both two models via mutual distillation, which involves synchronous executions of two one-to-one knowledge transfers at each training step. More specifically, we alternately choose one model as the student and the other as its teacher, and require the student to fit the training data and the action prediction distributions of its teacher. By doing so, both models can fully absorb the knowledge from each other and thus could be improved simultaneously. Experimental results and in-depth analysis on several benchmark datasets demonstrate the effectiveness of our approach. We release our code at https://github.com/DeepLearnXMU/CGML.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 63127ea0-c83f-4790-9333-736aa03a3f63Cited by top-tier papers6
- CODEP: Grammatical Seq2Seq Model for General-Purpose Code GenerationYihong Dong, Ge Li, Zhi JinISSTA 2023 · 18 citations
- A Tree-Based Structure-Aware Transformer Decoder for Image-To-Markup GenerationShuhan Zhong, Sizhe Song, Guanyao Li, S.-H. Gary ChanACM MM 2022 · 17 citations
- End-to-End Learning of LTLf Formulae by Faithful LTLf EncodingHai Wan, Pingjia Liang, Jianfeng Du, Weilin Luo et al.AAAI 2024 · 8 citations
- Code-Aware Cross-Program Transfer Hyperparameter OptimizationZijia Wang, Xiangyu He, Kehan Chen, Chen Lin et al.AAAI 2023 · 1 citation
- Exploring Dynamic Selection of Branch Expansion Orders for Code GenerationHui Jiang, Chulun Zhou, Fandong Meng, Biao Zhang et al.ACL 2021
Builds on2
Related papers
- SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code RepresentationsChangan Niu, Chuanyi Li, Vincent Ng, Jidong Ge et al.ICSE 2022 · 99 citations
- UniXcoder: Unified Cross-Modal Pre-training for Code RepresentationDaya Guo, Shuai Lu, Nan Duan, Yanlin Wang et al.ACL 2022
- AST-T5: Structure-Aware Pretraining for Code Generation and UnderstandingLinyuan Gong, Mostafa Elhoushi, Alvin CheungICML 2024 · 42 citations
- GrammarT5: Grammar-Integrated Pretrained Encoder-Decoder Neural Model for CodeQihao Zhu, Qingyuan Liang, Zeyu Sun, Yingfei Xiong et al.ICSE 2024 · 10 citations
- Multi-task Learning based Pre-trained Language Model for Code CompletionFang Liu, Ge Li, Yunfei Zhao, Zhi JinASE 2020 · 162 citations
