Balancing Usefulness and Naturalness: An LLM-based Curation Pipeline for Code Review Comments

· Source: cs.SE updates on arXiv.org · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering, Data Science & Analytics · Depth: Expert, extended

Summary

Researchers propose two LLM-based curation pipelines, CuREV and CuREV+, to address the noise and inconsistency in existing code review datasets, which limit the effectiveness of LLMs in generating high-quality feedback. The initial dataset, comprising 176,613 samples, is first filtered to 170,718 relevant reviews. CuREV systematically reformulates all comments using Llama-3.1-70B to enhance clarity, conciseness, and civility, yielding average clarity scores of 8.96 and conciseness of 8.05, up from 6.89 and 7.71 respectively. CuREV+ selectively reformulates low-quality ("poor") comments, preserving 92,894 high-quality ("good") ones as in-context exemplars. This yields similar clarity (8.95) but superior conciseness (8.53) and greater stylistic diversity. Both curated datasets improve downstream tasks, with CuREV+ achieving the highest CodeBLEU (0.49) and Exact Match (463) for code refinement, compared to 0.36 and 408 for the original dataset.

Key takeaway

For Machine Learning Engineers developing automated code review systems, your LLM's performance is directly tied to training data quality. You should prioritize implementing a selective, exemplar-guided curation pipeline, such as CuREV+, to refine noisy datasets. This approach significantly improves comment generation (BLEU up to 11.05) and code refinement (CodeBLEU up to 0.49) by balancing clarity, conciseness, and stylistic diversity, leading to more accurate and human-like feedback.

Key insights

Curating LLM training data for code review comments by balancing quality and natural diversity significantly improves model performance.

Principles

Method

Filter irrelevant comments, then classify remaining into high/low quality. Preserve high-quality comments and use them as in-context exemplars for LLM-based reformulation of low-quality comments.

In practice

Topics

Code references

Best for: Research Scientist, AI Scientist, Machine Learning Engineer, Software Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by cs.SE updates on arXiv.org.