使用渐进式、自适应和交互式反馈对代码改进进行基准测试
Benchmarking Code Improvement with Progressive, Adaptive, and Interactive Feedback
AI总结:
提出PAIR-Bench基准,通过渐进式提示和结构化反馈协议,细粒度评估大语言模型在代码改进中的修复能力、泛化能力和所需辅助程度。
摘要:
大型语言模型(LLM)通常在代码生成和程序修复中通过二元功能正确性进行评估:生成的程序或补丁要么通过测试套件,要么失败。这种协议简单但粗糙,因为它忽略了部分进展、反馈使用、回归以及模型通常用于改进代码的细化轨迹。我们引入了PAIR-Bench,一个用于评估代码改进的渐进式和自适应基准:通过反馈引导的细化将不正确或不完整的程序转变为更正确的程序。PAIR-Bench使用渐进式提示,一种具有两个控制的结构化反馈协议。失败区域控制通过将隐藏的失败测试分组为失败场景来确定反馈的目标,而提示深度控制则确定从粗略症状到实现级指导的修复相关信息被揭示的程度。这种设计使PAIR-Bench能够衡量模型是否修复了目标失败、是否泛化到提示之外、是否保留了已经正确的行为,以及需要多少辅助。通过评估修复轨迹的渐进指标,而不仅仅是最终的通过/失败结果,PAIR-Bench提供了对LLM代码改进能力的更细粒度评估。
英文摘要:
Large language models (LLMs) are typically evaluated on code generation and program repair using binary functional correctness: a generated program or patch either passes or fails a test suite. This protocol is simple but coarse, as it ignores partial progress, feedback use, regressions, and the refinement trajectory through which models often improve code. We introduce PAIR-Bench, a progressive and adaptive benchmark for evaluating code improvement: transforming an incorrect or incomplete program into a more correct one through feedback-guided refinement. PAIR-Bench uses progressive hinting, a structured feedback protocol with two controls. Failure-region control determines what the feedback targets by grouping hidden failing tests into failure scenarios, while hint-depth control determines how much repair-relevant information is revealed, from coarse symptoms to implementation-level guidance. This design enables PAIR-Bench to measure whether a model repairs targeted failures, generalizes beyond the hint, preserves already-correct behavior, and how much assistance it requires. By evaluating repair trajectories progressive metrics rather than only final pass/fail outcomes, PAIR-Bench provides a finer-grained assessment of LLM code-improvement capability.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。