Code Generation as a Dual Task of Code Summarization
By Bolin Wei, Ge Li, Xin Xia, Zhiyi Fu, Zhi Jin. 2019
241 citations recorded by the source corpus.
Code summarization (CS) and code generation (CG) are two crucial tasks in the field of automatic software development. Various neural network-based approaches are proposed to solve these two tasks separately. However, there exists a specific intuitive correlation between CS and CG, which has not been exploited in previous work. In this paper, we apply the relations between two tasks to improve the performance of both tasks. In other words, exploiting the duality between the two tasks, we propose a dual training framework to train the two tasks simultaneously. In this framework, we consider the dualities on probability and attention weights, and design corresponding regularization terms to constrain the duality. We evaluate our approach on two datasets collected from GitHub, and experimental results show that our dual framework can improve the performance of CS and CG tasks over baselines.
Subfields: Artificial Intelligence, Information Systems, Software, Natural Language Processing, Code Generation & Program Synthesis
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Prem Devanbu
- Nan Duan
- Toufique Ahmed
- Daya Guo
- Baishakhi Ray
- Jianfeng Gao
- Saikat Chakraborty
- Mohit Bansal
In Information Systems
- Prem Devanbu
- Toufique Ahmed
- Nan Duan
- Daya Guo
- Baishakhi Ray
- Saikat Chakraborty
- Neel Sundaresan
- Alexey Svyatkovskiy
In Software
- Prem Devanbu
- Toufique Ahmed
- Daya Guo
- Nan Duan
- Alexey Svyatkovskiy
- Neel Sundaresan
- Baishakhi Ray
- Yangruibo Ding
In Natural Language Processing
- Prem Devanbu
- Toufique Ahmed
- Nan Duan
- Baishakhi Ray
- Neel Sundaresan
- Saikat Chakraborty
- Alexey Svyatkovskiy
- Daya Guo
In Code Generation & Program Synthesis
- Prem Devanbu
- Toufique Ahmed
- Baishakhi Ray
- Wasi Uddin Ahmad
- Ge Li
- Saikat Chakraborty
- Zhi Jin
- Yangruibo Ding
Citations in the corpus
- CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generation (2021, background): “• code-code (clone detection [65, 84, 46, 80, 9, 89, 86], defect detection [91, 55, 51, 42, 78, 79], cloze test [15], code completion [57, 1, 56, 66, 67, 8, 27, 7], code repair [69, 4, 23, 26, 71, 73], and code-to-code translation [48, 37, 10, 41]) • text-code (natural language code search [32, 20, ”
- Neural-Symbolic Solver for Math Word Problems with Auxiliary Tasks (2021, background): “…widely applied in various fields, such as machine translation (He et al., 2016), sentiment classification (Xia et al., 2017), question answering (Tang et al., 2017), visual question answering (Li et al., 2018), machine reading comprehension (Xiao et al., 2018), and code generation (Wei et al., 2019).”
- CoDesc: A Large Code–Description Parallel Dataset (2021, methodology): “In future works, we wish to apply new techniques for code search, code summarization, along with exploring our dataset for general-purpose code synthesis, where the best models are still struggling in accuracy (Wei et al., 2019; Yin and Neubig, 2017).”
- CODIT: Code Editing With Tree-Based Neural Models (2018, background): “Other NMT application in source code and software engineering include program comprehension [46], [49], [71], [72], commit message generation [73], [74], program synthesis [62], [75] etc.”
- Integrating Tree Path in Transformer for Code Representation (2021, methodology): “The initial representation of source code relied on sequential models adopted from natural language processing, such as n -gram language model [Hindle et al., 2016, Hellendoorn and Devanbu, 2017], Recurrent Neural Networks (RNNs) [Wei et al., 2019] and so on.”
- Multi-task Learning based Pre-trained Language Model for Code Completion (2020, background): “[19] found that source code contained predictable statistical properties, statistical language models began to be used formodeling source code [17, 27, 30, 38, 50], where N-gram is the most widely used model.”
- A Transformer-based Approach for Source Code Summarization (2020, methodology): “(Iyer et al., 2016) 27 (Wei et al., 2019).”
- Out of the BLEU: how should we assess quality of the Code Generation models? (2022, background): “[26] RNN BLEU, Percentage of valid code 2019 Yin et al.”
- Multilingual training for Software Engineering (2021, background): “Comment synthesis is now an active research area, including many projects such as CodeNN [30], DeepCom [26], Astattgru [40], CodeBERT [18], Rencos [74], SecNN [42], PLBART [1], CoTexT [54], ProphetNet-X [55], NCS [2], Code2seq [7], Re2Com [71], and many more [19, 24, 25, 27, 28, 38, 39, 41, 49, 50, ”
- An Empirical Study of the Non-Determinism of ChatGPT in Code Generation (2023, unknown): “Compared with the Base prompt and Concise prompt, the CoT prompt has a higher mean-variance (0.02), higher mean maximum difference (0.15), and a rather higher ratio of worst cases (1.82%).”
- CodeGen-Test: An Automatic Code Generation Model Integrating Program Test Information (2022, methodology): “…[17] chose different decoders according to different nodes of the generated abstract syntax tree to improve the performance of the model; Li et al. [18] propose code generation as a dual task of code summarization;Sun et al. [10], [11] used convolutional neural network [19] and Transformer [20] to…”
- LLMs Corrupt Your Documents When You Delegate (2026, unknown): “…applied in other domains, for instance to the code domain, where it was leveraged to train unsupervised code translation models across programming languages (Lachaux et al., 2020; Rozière et al., 2021), and to jointly train code generation and summarization as dual tasks (Wei et al., 2019).”