CriticGPT: A New Tool for Improving AI Review | Festina Lente - Your leading source of AI news | Turtles AI

CriticGPT: A New Tool for Improving AI Review
CriticGPT, a model based on GPT-4, enhances error detection in code generated by ChatGPT, outperforming human reviewers 60% of the time.
DukeRem28 June 2024

CriticGPT: a new tool for improving AI code review

Highlights

  • CriticGPT improves human reviewers’ performance by 60% in detecting errors in code generated by ChatGPT.
  • CriticGPT was trained with data from natural bugs and manually inserted bugs, enhancing its ability to detect complex errors.
  • CriticGPT’s critiques are preferred over human critiques 63% of the time for natural bugs and 85% for manually inserted bugs.
  • CriticGPT has demonstrated generalization capabilities, identifying issues in non-code-related responses.

 

OpenAI has developed CriticGPT, a model based on GPT-4, to identify errors in code generated by ChatGPT. When used for code review, CriticGPT allows human reviewers to outperform those without assistance 60% of the time. This integration will significantly enhance the accuracy of our AI systems.

CriticGPT was trained to detect errors in code generated by ChatGPT. This innovation stems from the need to overcome the intrinsic limitations of Reinforcement Learning from Human Feedback (RLHF), where humans evaluate AI responses. As ChatGPT becomes more advanced, its errors become subtler and harder to spot, making the task challenging for human trainers. CriticGPT was created to address this challenge, providing detailed critiques that highlight inaccuracies in ChatGPT’s answers.

During CriticGPT’s training, data from natural AI errors and manually inserted bugs by experts were used. This approach refined the model, making it capable of identifying more complex errors than those detected by human reviewers alone. The data was collected through a process called "tampering," where experts deliberately introduced bugs into the model-generated code to test CriticGPT’s detection capabilities. This method improved the subtlety of the introduced bugs, increasing detection difficulty and making CriticGPT a more robust tool.

Critiques generated by CriticGPT are evaluated based on various attributes, including comprehensiveness, the ability to identify specific bugs, and overall accuracy. Results show that CriticGPT’s critiques are preferred over human critiques 63% of the time for natural code errors and 85% for manually inserted bugs. Additionally, CriticGPT helps human reviewers write more comprehensive critiques while reducing the rate of false positives and minor inaccuracies.

The training methodology for CriticGPT included Reinforcement Learning with human feedback, combined with an advanced search strategy called Force Sampling Beam Search (FSBS). This technique allows for generating longer and more comprehensive critiques, reducing the rate of hallucinations or nonexistent errors. FSBS searches through various possible critiques, selecting the most promising ones based on a reward model.

CriticGPT not only excels at detecting code bugs but has also demonstrated generalization capabilities to general assistance tasks. In an experiment, the model identified issues in responses rated as flawless by a first human annotator 24% of the time, compared to 6% without CriticGPT’s assistance. This suggests that CriticGPT can improve response quality in various contexts, making the AI system overall more reliable.