Fine-Tuning LLMs to Analyze Multiple Dimensions of Code Review: A Maximum Entropy Regulated Long Chain-of-Thought Approach

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yu, Yongda, Shi, Guohao, Wu, Xianwei, He, Haochuan, Gu, XueMing, Zhao, Qianqian, Liu, Kui, Wang, Qiushi, Tian, Zhao, Shen, Haifeng, Rong, Guoping
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918147992322048
author Yu, Yongda
Shi, Guohao
Wu, Xianwei
He, Haochuan
Gu, XueMing
Zhao, Qianqian
Liu, Kui
Wang, Qiushi
Tian, Zhao
Shen, Haifeng
Rong, Guoping
author_facet Yu, Yongda
Shi, Guohao
Wu, Xianwei
He, Haochuan
Gu, XueMing
Zhao, Qianqian
Liu, Kui
Wang, Qiushi
Tian, Zhao
Shen, Haifeng
Rong, Guoping
contents Large Language Models (LLMs) have shown great potential in supporting automated code review due to their impressive capabilities in context understanding and reasoning. However, these capabilities are still limited compared to human-level cognition because they are heavily influenced by the training data. Recent research has demonstrated significantly improved performance through fine-tuning LLMs with code review data. However, compared to human reviewers who often simultaneously analyze multiple dimensions of code review to better identify issues, the full potential of these methods is hampered by the limited or vague information used to fine-tune the models. This paper contributes MelcotCR, a chain-of-thought (COT) fine-tuning approach that trains LLMs with an impressive reasoning ability to analyze multiple dimensions of code review by harnessing long COT techniques to provide rich structured information. To address context loss and reasoning logic loss issues that frequently occur when LLMs process long COT prompts, we propose a solution that combines the Maximum Entropy (ME) modeling principle with pre-defined reasoning pathways in MelcotCR to enable more effective utilization of in-context knowledge within long COT prompts while strengthening the logical tightness of the reasoning process. Empirical evaluations on our curated MelcotCR dataset and the public CodeReviewer dataset reveal that a low-parameter base model, such as 14B Qwen2.5, fine-tuned with MelcotCR can surpass state-of-the-art methods in terms of the accuracy of detecting and describing code issues, with its performance remarkably on par with that of the 671B DeepSeek-R1 model.
format Preprint
id arxiv_https___arxiv_org_abs_2509_21170
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Fine-Tuning LLMs to Analyze Multiple Dimensions of Code Review: A Maximum Entropy Regulated Long Chain-of-Thought Approach
Yu, Yongda
Shi, Guohao
Wu, Xianwei
He, Haochuan
Gu, XueMing
Zhao, Qianqian
Liu, Kui
Wang, Qiushi
Tian, Zhao
Shen, Haifeng
Rong, Guoping
Software Engineering
Artificial Intelligence
D.2.3; I.2.7
Large Language Models (LLMs) have shown great potential in supporting automated code review due to their impressive capabilities in context understanding and reasoning. However, these capabilities are still limited compared to human-level cognition because they are heavily influenced by the training data. Recent research has demonstrated significantly improved performance through fine-tuning LLMs with code review data. However, compared to human reviewers who often simultaneously analyze multiple dimensions of code review to better identify issues, the full potential of these methods is hampered by the limited or vague information used to fine-tune the models. This paper contributes MelcotCR, a chain-of-thought (COT) fine-tuning approach that trains LLMs with an impressive reasoning ability to analyze multiple dimensions of code review by harnessing long COT techniques to provide rich structured information. To address context loss and reasoning logic loss issues that frequently occur when LLMs process long COT prompts, we propose a solution that combines the Maximum Entropy (ME) modeling principle with pre-defined reasoning pathways in MelcotCR to enable more effective utilization of in-context knowledge within long COT prompts while strengthening the logical tightness of the reasoning process. Empirical evaluations on our curated MelcotCR dataset and the public CodeReviewer dataset reveal that a low-parameter base model, such as 14B Qwen2.5, fine-tuned with MelcotCR can surpass state-of-the-art methods in terms of the accuracy of detecting and describing code issues, with its performance remarkably on par with that of the 671B DeepSeek-R1 model.
title Fine-Tuning LLMs to Analyze Multiple Dimensions of Code Review: A Maximum Entropy Regulated Long Chain-of-Thought Approach
topic Software Engineering
Artificial Intelligence
D.2.3; I.2.7
url https://arxiv.org/abs/2509.21170