Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
80 tokens/sec
GPT-4o
59 tokens/sec
Gemini 2.5 Pro Pro
43 tokens/sec
o3 Pro
7 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Improving the Learning of Code Review Successive Tasks with Cross-Task Knowledge Distillation (2402.02063v1)

Published 3 Feb 2024 in cs.SE

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

Definition Search Book Streamline Icon: https://streamlinehq.com
References (49)
  1. 2000. PMD. https://pmd.github.io/.
  2. 2001. Checkstyle. https://checkstyle.org/.
  3. 2005. FindBugs. https://findbugs.sourceforge.net/.
  4. Software inspections: an effective verification process. IEEE software 6, 3 (1989), 31–36.
  5. Software inspections and the industrial production of software. In Proc. of a symposium on Software validation: inspection-testing-verification-alternatives. 13–40.
  6. Managing technical debt in software engineering (Dagstuhl seminar 16162). In Dagstuhl Reports, Vol. 6. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik.
  7. Alberto Bacchelli and Christian Bird. 2013. Expectations, outcomes, and challenges of modern code review. In 2013 35th International Conference on Software Engineering (ICSE). 712–721. https://doi.org/10.1109/ICSE.2013.6606617
  8. Gabriele Bavota and Barbara Russo. 2015. Four eyes are better than two: On the impact of code reviews on software quality. In 2015 IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE, 81–90.
  9. Learning a static analyzer from data. In International Conference on Computer Aided Verification. Springer, 233–253.
  10. Breaking down multilingual machine translation. arXiv preprint arXiv:2110.08130 (2021).
  11. BERT: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 (2018).
  12. Does code decay? assessing the evidence from change management data. IEEE Transactions on Software Engineering 27, 1 (2001), 1–12.
  13. Michael Fagan. 2002. Design and code inspections to reduce errors in program development. In Software pioneers. Springer, 575–607.
  14. CodeBERT: A pre-trained model for programming and natural languages. arXiv preprint arXiv:2002.08155 (2020).
  15. Martin Fowler and Matthew Foemmel. 2006. Continuous integration. https://martinfowler.com/articles/continuousIntegration.html.
  16. Generative adversarial networks. Commun. ACM 63, 11 (2020), 139–144.
  17. Anshul Gupta and Neel Sundaresan. 2018. Intelligent code reviews using deep learning. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD’18) Deep Learning Day.
  18. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531 (2015).
  19. David Hovemeyer and William Pugh. 2004. Finding bugs is easy. Acm sigplan notices 39, 12 (2004), 92–106.
  20. James M Joyce. 2011. Kullback-leibler divergence. In International encyclopedia of statistical science. Springer, 720–722.
  21. Comparing kullback-leibler divergence and mean squared error loss in knowledge distillation. arXiv preprint arXiv:2105.08919 (2021).
  22. Prototype-guided Cross-task Knowledge Distillation for Large-scale Models. arXiv preprint arXiv:2212.13180 (2022).
  23. Prototype-guided Cross-task Knowledge Distillation for Large-scale Models. arXiv:2212.13180 [cs.CV]
  24. Automating code review activities by large-scale pre-training. In Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 1035–1047.
  25. RoBERTa: A robustly optimized BERT pretraining approach. arXiv preprint arXiv:1907.11692 (2019).
  26. AST-Probe: Recovering abstract syntax trees from hidden representations of pre-trained language models. arXiv preprint arXiv:2206.11719 (2022).
  27. The impact of code review coverage and code review participation on software quality: A case study of the Qt, VTK, and ITK projects. In Proceedings of the 11th working conference on mining software repositories. 192–201.
  28. An empirical study of the impact of modern code review practices on software quality. Empirical Software Engineering 21, 5 (2016), 2146–2189.
  29. Do code review practices impact design quality? A case study of the Qt, VTK, and ITK projects. In 2015 IEEE 22nd international conference on software analysis, evolution, and reengineering (SANER). IEEE, 171–180.
  30. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting of the Association for Computational Linguistics. 311–318.
  31. Language models are unsupervised multitask learners. OpenAI blog 1, 8 (2019), 9.
  32. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683 (2019).
  33. Codebleu: a method for automatic evaluation of code synthesis. arXiv preprint arXiv:2009.10297 (2020).
  34. Tricorder: Building a program analysis ecosystem. In 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering, Vol. 1. IEEE, 598–608.
  35. Oussama Ben Sghaier and Houari Sahraoui. 2023. A Multi-Step Learning Approach to Assist Code Review. In 2023 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER). IEEE.
  36. Continuous integration, delivery and deployment: a systematic review on approaches, tools, challenges and practices. IEEE Access 5 (2017), 3909–3943.
  37. Core: Automating review recommendation for code changes. In 2020 IEEE 27th International Conference on Software Analysis, Evolution and Reengineering (SANER). IEEE, 284–295.
  38. Towards automating code review activities. In 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE). 163–174.
  39. Using pre-trained models to boost code review automation. arXiv preprint arXiv:2201.06850 (2022).
  40. Attention is all you need. Advances in neural information processing systems 30 (2017).
  41. Codet5: Identifier-aware unified pre-trained encoder-decoder models for code understanding and generation. arXiv preprint arXiv:2109.00859 (2021).
  42. Industrial perspective on static analysis. Software Engineering Journal 10, 2 (1995), 69–75.
  43. Cross-task knowledge distillation in multi-task recommendation. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 36. 4318–4326.
  44. XLNet: Generalized autoregressive pretraining for language understanding. Advances in neural information processing systems 32 (2019).
  45. Distilling cross-task knowledge via relationship matching. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 12396–12405.
  46. Distilling Cross-Task Knowledge via Relationship Matching. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR).
  47. Mingkuan Yuan and Yuxin Peng. 2019. CKD: Cross-task knowledge distillation for text-to-image synthesis. IEEE Transactions on Multimedia 22, 8 (2019), 1955–1968.
  48. Mingkuan Yuan and Yuxin Peng. 2020. CKD: Cross-Task Knowledge Distillation for Text-to-Image Synthesis. IEEE Transactions on Multimedia 22, 8 (2020), 1955–1968. https://doi.org/10.1109/TMM.2019.2951463
  49. Multilingual code snippets training for program translation. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 36. 11783–11790.
User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (2)
  1. Oussama Ben Sghaier (6 papers)
  2. Houari Sahraoui (31 papers)
Citations (3)
X Twitter Logo Streamline Icon: https://streamlinehq.com