Skip to main navigation Skip to search Skip to main content

CoCoder_Repair: MISRA Code Rule Repair Based on Large Language Models

  • Zhenxin Fu*
  • , Guitao Cao
  • , Min Cai
  • *Corresponding author for this work
  • East China Normal University

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

In the automotive industry, code quality detection and repair is a rigorous, complex, and extremely important task. It typically involves assessing whether the code meets relevant industry standard rules, such as the MISRA C/CPP rules and AutoSAR rules, to ensure code quality and manage defect risks. In traditional approaches, professional tools are used to detect defects in code projects, and developers manually repair these defects, which requires a significant investment of human resources and time. With the rapid rise of LLMs in the field of code generation in recent years, numerous tools for code review and repair have emerged, which can greatly improve the efficiency of developers. However, according to industry research, large language models with limited parameters (32b and below) currently perform poorly in the field of code quality repair. To address this issue, this study proposes a paradigm for post-training of vertical domain models for code quality detection and repair using methods such as supervised fine-tuning and reinforcement learning. By collecting, cleaning, labeling, and defining metrics for original code data, this approach aims to achieve a certain level of accuracy for vertical domain large language models with limited parameters (below 32b) in this task. In terms of target selection, the MISRA C/CPP 2008 rules are chosen as the code quality validation standard for this project. Based on actual projects, the most frequently violated rules in the MISRA C/CPP 2008 rule checks are selected as the code rules that need to be detected and modified. Relevant metrics for code repair, such as rule recognition rate, rule repair rate, and error guidance rate, are defined to evaluate the model's capabilities in the field of code specification repair. In the post-training of large language models, the qwen2.5-coder-base-7b model is used as the base model for supervised fine-tuning and reinforcement training. A more efficient reward strategy for this task is proposed by combining the GRPO algorithm with RLAIF. As a result, the performance in this task far exceeds that of similar models with the same parameter volume and even surpasses that of flagship models with larger parameter volumes.

Original languageEnglish
Title of host publicationAICCC 2025 - 2025 8th Artificial Intelligence and Cloud Computing Conference
PublisherAssociation for Computing Machinery, Inc
Pages460-468
Number of pages9
ISBN (Electronic)9798400718892
DOIs
StatePublished - 4 May 2026
Event2025 8th Artificial Intelligence and Cloud Computing Conference, AICCC 2025 - Tokyo, Japan
Duration: 20 Dec 202522 Dec 2025

Publication series

NameAICCC 2025 - 2025 8th Artificial Intelligence and Cloud Computing Conference

Conference

Conference2025 8th Artificial Intelligence and Cloud Computing Conference, AICCC 2025
Country/TerritoryJapan
CityTokyo
Period20/12/2522/12/25

Keywords

  • Automotive industry
  • Code quality detection and repair
  • LLM4Code
  • RL
  • SFT

Fingerprint

Dive into the research topics of 'CoCoder_Repair: MISRA Code Rule Repair Based on Large Language Models'. Together they form a unique fingerprint.

Cite this