Table of Contents
Fetching ...

On Unified Prompt Tuning for Request Quality Assurance in Public Code Review

Xinyu Chen, Lin Li, Rui Zhang, Peng Liang

TL;DR

This paper tackles improving Public Code Review by enabling developers to craft higher-quality requests through a unified prompt-tuning framework. It introduces UniPCR, which reframes two developer-facing subtasks—request necessity prediction and tag recommendation—as generation tasks within a masked language model, using hard text prompts and soft code-prefix prompts. Empirical results on a StackExchange-based PCR dataset (2011–2023) show UniPCR substantially outperforms state-of-the-art baselines on both subtasks, with ablation studies confirming the contributions of text prompts and code-prefix tuning. The work advances PCR by bridging developer and reviewer perspectives and opens pathways to extend the approach to large language models and broader PCR tasks in the future.

Abstract

Public Code Review (PCR) can be implemented through a Software Question Answering (SQA) community, which facilitates high knowledge dissemination. Current methods mainly focus on the reviewer's perspective, including finding a capable reviewer, predicting comment quality, and recommending/generating review comments. Our intuition is that satisfying review necessity requests can increase their visibility, which in turn is a prerequisite for better review responses. To this end, we propose a unified framework called UniPCR to complete developer-based request quality assurance (i.e., predicting request necessity and recommending tags subtask) under a Masked Language Model (MLM). Specifically, we reformulate both subtasks via 1) text prompt tuning, which converts two subtasks into MLM by constructing prompt templates using hard prompt; 2) code prefix tuning, which optimizes a small segment of generated continuous vectors as the prefix of the code representation using soft prompt. Experimental results on the Public Code Review dataset for the time span 2011-2022 demonstrate that our UniPCR framework adapts to the two subtasks and outperforms comparable accuracy-based results with state-of-the-art methods for request quality assurance. These conclusions highlight the effectiveness of our unified framework from the developer's perspective in public code review.

On Unified Prompt Tuning for Request Quality Assurance in Public Code Review

TL;DR

This paper tackles improving Public Code Review by enabling developers to craft higher-quality requests through a unified prompt-tuning framework. It introduces UniPCR, which reframes two developer-facing subtasks—request necessity prediction and tag recommendation—as generation tasks within a masked language model, using hard text prompts and soft code-prefix prompts. Empirical results on a StackExchange-based PCR dataset (2011–2023) show UniPCR substantially outperforms state-of-the-art baselines on both subtasks, with ablation studies confirming the contributions of text prompts and code-prefix tuning. The work advances PCR by bridging developer and reviewer perspectives and opens pathways to extend the approach to large language models and broader PCR tasks in the future.

Abstract

Public Code Review (PCR) can be implemented through a Software Question Answering (SQA) community, which facilitates high knowledge dissemination. Current methods mainly focus on the reviewer's perspective, including finding a capable reviewer, predicting comment quality, and recommending/generating review comments. Our intuition is that satisfying review necessity requests can increase their visibility, which in turn is a prerequisite for better review responses. To this end, we propose a unified framework called UniPCR to complete developer-based request quality assurance (i.e., predicting request necessity and recommending tags subtask) under a Masked Language Model (MLM). Specifically, we reformulate both subtasks via 1) text prompt tuning, which converts two subtasks into MLM by constructing prompt templates using hard prompt; 2) code prefix tuning, which optimizes a small segment of generated continuous vectors as the prefix of the code representation using soft prompt. Experimental results on the Public Code Review dataset for the time span 2011-2022 demonstrate that our UniPCR framework adapts to the two subtasks and outperforms comparable accuracy-based results with state-of-the-art methods for request quality assurance. These conclusions highlight the effectiveness of our unified framework from the developer's perspective in public code review.
Paper Structure (21 sections, 2 equations, 3 figures, 5 tables, 1 algorithm)

This paper contains 21 sections, 2 equations, 3 figures, 5 tables, 1 algorithm.

Figures (3)

  • Figure 1: An Example of Public Code Review Process (with a data sample in the middle
  • Figure 2: The overview of unified framework for public code review (UniPCR).
  • Figure 3: An Example of Refactoring Request Prediction and Tag Recommendation Subtasks under a UniPCR.