Table of Contents
Fetching ...

Improving the Learning of Code Review Successive Tasks with Cross-Task Knowledge Distillation

Oussama Ben Sghaier, Houari Sahraoui

TL;DR

The paper addresses automating interconnected code review tasks by introducing DISCOREV, a cross-task knowledge distillation framework using two interacting models to leverage feedback between code refinement, quality estimation, and comment generation. It formalizes two task pairings with dedicated loss functions and adds an embedding alignment objective to unify semantic representations across reviews and edits. Empirical results on a large multi-language code review dataset show DISCOREV outperforming state-of-the-art baselines in both comment generation (BLEU) and code refinement (CodeBLEU), with embedding alignment yielding additional gains. The work demonstrates that jointly training related code review tasks via cross-task feedback can yield more coherent and accurate outputs, with practical implications for automated code review workflows and IDE integrations.

Abstract

Code review is a fundamental process in software development that plays a pivotal role in ensuring code quality and reducing the likelihood of errors and bugs. However, code review can be complex, subjective, and time-consuming. Quality estimation, comment generation, and code refinement constitute the three key tasks of this process, and their automation has traditionally been addressed separately in the literature using different approaches. In particular, recent efforts have focused on fine-tuning pre-trained language models to aid in code review tasks, with each task being considered in isolation. We believe that these tasks are interconnected, and their fine-tuning should consider this interconnection. In this paper, we introduce a novel deep-learning architecture, named DISCOREV, which employs cross-task knowledge distillation to address these tasks simultaneously. In our approach, we utilize a cascade of models to enhance both comment generation and code refinement models. The fine-tuning of the comment generation model is guided by the code refinement model, while the fine-tuning of the code refinement model is guided by the quality estimation model. We implement this guidance using two strategies: a feedback-based learning objective and an embedding alignment objective. We evaluate DISCOREV by comparing it to state-of-the-art methods based on independent training and fine-tuning. Our results show that our approach generates better review comments, as measured by the BLEU score, as well as more accurate code refinement according to the CodeBLEU score

Improving the Learning of Code Review Successive Tasks with Cross-Task Knowledge Distillation

TL;DR

The paper addresses automating interconnected code review tasks by introducing DISCOREV, a cross-task knowledge distillation framework using two interacting models to leverage feedback between code refinement, quality estimation, and comment generation. It formalizes two task pairings with dedicated loss functions and adds an embedding alignment objective to unify semantic representations across reviews and edits. Empirical results on a large multi-language code review dataset show DISCOREV outperforming state-of-the-art baselines in both comment generation (BLEU) and code refinement (CodeBLEU), with embedding alignment yielding additional gains. The work demonstrates that jointly training related code review tasks via cross-task feedback can yield more coherent and accurate outputs, with practical implications for automated code review workflows and IDE integrations.

Abstract

Code review is a fundamental process in software development that plays a pivotal role in ensuring code quality and reducing the likelihood of errors and bugs. However, code review can be complex, subjective, and time-consuming. Quality estimation, comment generation, and code refinement constitute the three key tasks of this process, and their automation has traditionally been addressed separately in the literature using different approaches. In particular, recent efforts have focused on fine-tuning pre-trained language models to aid in code review tasks, with each task being considered in isolation. We believe that these tasks are interconnected, and their fine-tuning should consider this interconnection. In this paper, we introduce a novel deep-learning architecture, named DISCOREV, which employs cross-task knowledge distillation to address these tasks simultaneously. In our approach, we utilize a cascade of models to enhance both comment generation and code refinement models. The fine-tuning of the comment generation model is guided by the code refinement model, while the fine-tuning of the code refinement model is guided by the quality estimation model. We implement this guidance using two strategies: a feedback-based learning objective and an embedding alignment objective. We evaluate DISCOREV by comparing it to state-of-the-art methods based on independent training and fine-tuning. Our results show that our approach generates better review comments, as measured by the BLEU score, as well as more accurate code refinement according to the CodeBLEU score
Paper Structure (23 sections, 17 equations, 2 figures, 7 tables)