Lune

AAAI2021Top-tier venue

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 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.

6 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

  • End-to-End Learning of LTLf Formulae by Faithful LTLf Encoding cites TreeGen: A Tree-Based Transformer Architecture for Code Generation
  • Exploring Dynamic Selection of Branch Expansion Orders for Code Generation cites TreeGen: A Tree-Based Transformer Architecture for Code Generation
  • A Tree-Based Structure-Aware Transformer Decoder for Image-To-Markup Generation cites TreeGen: A Tree-Based Transformer Architecture for Code Generation
  • CODEP: Grammatical Seq2Seq Model for General-Purpose Code Generation cites Exploring Dynamic Selection of Branch Expansion Orders for Code Generation
  • 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 papers6

  1. CODEP: Grammatical Seq2Seq Model for General-Purpose Code GenerationYihong Dong, Ge Li, Zhi JinISSTA 2023 · 18 citations
  2. 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
  3. End-to-End Learning of LTLf Formulae by Faithful LTLf EncodingHai Wan, Pingjia Liang, Jianfeng Du, Weilin Luo et al.AAAI 2024 · 8 citations
  4. Code-Aware Cross-Program Transfer Hyperparameter OptimizationZijia Wang, Xiangyu He, Kehan Chen, Chen Lin et al.AAAI 2023 · 1 citation
  5. Exploring Dynamic Selection of Branch Expansion Orders for Code GenerationHui Jiang, Chulun Zhou, Fandong Meng, Biao Zhang et al.ACL 2021

Builds on2

  1. TreeGen: A Tree-Based Transformer Architecture for Code GenerationZeyu Sun, Qihao Zhu, Yingfei Xiong, Yican Sun et al.AAAI 2020 · 196 citations
  2. Improving Domain-Adapted Sentiment Classification by Deep Adversarial Mutual LearningQianming Xue, Wei Zhang, Hongyuan ZhaAAAI 2020 · 40 citations

Related papers

  1. 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
  2. Better Language Models of Code through Self-ImprovementHung Quoc To, Nghi D. Q. Bui, Jin L. C. Guo, Tien N. NguyenACL Findings 2023 · 7 citations
  3. What Do They Capture? - A Structural Analysis of Pre-Trained Language Models for Source CodeYao Wan, Wei Zhao, Hongyu Zhang, Yulei Sui et al.ICSE 2022 · 66 citations
  4. UniXcoder: Unified Cross-Modal Pre-training for Code RepresentationDaya Guo, Shuai Lu, Nan Duan, Yanlin Wang et al.ACL 2022
  5. AST-T5: Structure-Aware Pretraining for Code Generation and UnderstandingLinyuan Gong, Mostafa Elhoushi, Alvin CheungICML 2024 · 42 citations
Dusk over the sea between two cliffs drawn in fine vertical lines