Prompting and Fine-tuning Large Language Models for Automated Code Review Comment Generation
Not on the map. Why?
Abstract (arXiv)
Generating accurate code review comments remains a significant challenge due to the inherently diverse and non-unique nature of the task output. Large language models pretrained on both programming and natural language data tend to perform well in code-oriented tasks. However, large-scale pretraining is not always feasible due to its environmental impact and project-specific generalizability issues. In this work, first we fine-tune open-source Large language models (LLM) in parameter-efficient, quantized low-rank (QLoRA) fashion on consumer-grade hardware to improve review comment generation. Recent studies demonstrate the efficacy of augmenting semantic metadata information into prompts to boost performance in other code-related tasks. To explore this in code review activities, we also prompt proprietary, closed-source LLMs augmenting the input code patch with function call graphs and code summaries. Both of our strategies improve the review comment generation performance, with function call graph augmented few-shot prompting on the GPT-3.5 model surpassing the pretrained baseline by around 90% BLEU-4 score on the CodeReviewer dataset. Moreover, few-shot prompted Gemini-1.0 Pro, QLoRA fine-tuned Code Llama and Llama 3.1 models achieve competitive results (ranging from 25% to 83% performance improvement) on this task. An additional human evaluation study further validates our experimental findings, reflecting real-world developers' perceptions of LLM-generated code review comments based on relevant qualitative metrics.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Builds on 43 of its 71 references that are in the map. First posted on arXiv 15 Nov 2024.
Builds on
43 of 71 references.
References · 43
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023GPT-4 Technical Reportcited by 18,396
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,893
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,915
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
31 more
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
- 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,418
- 2022Self-Instruct: Aligning Language Models with Self-Generated Instructionscited by 2,724
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2023StarCoder: may the source be with you!cited by 799
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 619
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2021Unified Pre-training for Program Understanding and Generationcited by 366
- 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 256
- 2023Large Language Models Understand and Can be Enhanced by Emotional Stimulicited by 146
- 2022Few-shot training LLMs for project-specific code-summarizationcited by 129
- 2023The CoT Collection: Improving Zero-shot and Few-shot Learning of Language Models via Chain-of-Thought Fine-Tuningcited by 108
- 2022Automating Code Review Activities by Large-Scale Pre-trainingcited by 98
- 2023Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization)cited by 72
- 2023Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context Learningcited by 72
- 2023A Survey of Large Language Models for Code: Evolution, Benchmarking, and Future Trendscited by 66
- 2022Using Pre-Trained Models to Boost Code Review Automationcited by 63
- 2021Towards Automating Code Review Activitiescited by 54
- 2023Principled Instructions Are All You Need for Questioning LLaMA-1/2, GPT-3.5/4cited by 48
- 2023What Makes Good In-context Demonstrations for Code Intelligence Tasks with LLMs?cited by 47
- 2023LLaMA-Reviewer: Advancing Code Review Automation with Large Language Models through Parameter-Efficient Fine-Tuningcited by 47
- 2023Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Studycited by 44
- 2023Prompting Is All You Need: Automated Android Bug Replay with Large Language Modelscited by 40
- 2022Automatic Code Documentation Generation Using GPT-3cited by 37
- 2022AUGER: Automatically Generating Review Comments with Pre-training Modelscited by 23
- 2019CORE: Automating Review Recommendation for Code Changescited by 14
- 2022Modeling Review History for Reviewer Recommendation:A Hypergraph Approachcited by 3
Built on by
Citing papers per year: 2025: 3; 2026: 4.
7 papers.
- 2025Large Language Models (LLMs) for Source Code Analysis: applications, models and datasetscited by 16
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
- 2026Gated Differentiable Working Memory for Long-Context Language Modelingcited by 6
- 2026Understanding Dominant Themes in Reviewing Agentic AI-authored Codecited by 5
- 2026AgenticSCR: An Autonomous Agentic Secure Code Review for Immature Vulnerabilities Detectioncited by 2
- 2025AI-Mediated Code Comment Improvementcited by 0
- 2026OpenCodeReview: Determinism over Non-Determinism for Cost-Effective Agent-Based Code Reviewcited by 0
- 2026OpenCodeReview: Determinism over Non-Determinism for Cost-Effective Agent-Based Code Review10 Aug 2026
- 2026Understanding Dominant Themes in Reviewing Agentic AI-authored Code27 Jan 2026
- 2026AgenticSCR: An Autonomous Agentic Secure Code Review for Immature Vulnerabilities Detection27 Jan 2026
- 2026Gated Differentiable Working Memory for Long-Context Language Modeling19 Jan 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025AI-Mediated Code Comment Improvement13 May 2025
- 2025Large Language Models (LLMs) for Source Code Analysis: applications, models and datasets21 Mar 2025
Similar, not cited
Close in wording, no citation either way
- 2025LAURA: Enhancing Code Review Generation with Context-Enriched Retrieval-Augmented LLM
- 2025CodeReviewQA: The Code Review Comprehension Assessment for Large Language Models
- 2025Leveraging Reward Models for Guiding Code Review Comment Generation
- 2025Fine-Tuning Multilingual Language Models for Code Review: An Empirical Study on Industrial C# Projects
- 2024Distilling Desired Comments for Enhanced Code Review with Large Language Models
- 2026Rethinking Training Data for Generating Code Review Comments
- 2025Retrieval-Augmented Code Review Comment Generation
- 2024Comments as Natural Logic Pivots: Improve Code Generation via Comment Perspective