paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Improving Code Generation via Small Language Model-as-a-judge

通过小型语言模型作为评判者改进代码生成
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 2/10 · 论文主题是训练小语言模型作为代码正确性评判器以改进代码生成,属于 LLM/代码生成方向;与用户关注的静态分析、形式化验证、浮点程序分析、贝叶斯程序分析及 Agentic 程序分析无直接交集。即使涉及 PL+ML,其研究目标偏向提升 LLM/代码生成能力,而非将 LLM/Agent 用作静态分析工具。引用 5 inbox
Giuseppe Crupi, Rosalia Tufano, Gabriele Bavota
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:训练前沿小语言模型判断并排序代码候选,证明其低成本即可媲美大模型并优于 RankEF。

大型语言模型在自动代码生成上表现优异,但在小众或领域特定语言上可能不如商业工具,而小模型支持代码生成时需从多个候选解中选出正确者。已有 RankEF 用 T5 排序,但未评估其分类准确率,且实验模型较旧。本文训练多个最新小语言模型作为代码正确性评判者,评估其区分正确与错误实现的能力,并用作排序器。结果显示,现代小模型即使不利用执行信息也优于 RankEF;作为排序器时性能增益更高,可与大 5–25 倍的大语言模型竞争,成本却低得多。

问题
研究如何用小型语言模型作为代码正确性评判者与候选排序器,以低成本提升自动代码生成,并弥补 RankEF 未评估分类准确率、实验模型较旧的问题。
方法
训练多个最先进的小语言模型作为正确性评判者,区分正确与错误实现,并作为代码候选排序器;比较是否使用执行信息,并与 RankEF 和大语言模型对比。
评估
在代码生成与排序任务上评估小模型的分类准确率和排序性能,结果表明现代小模型优于 RankEF,接近大 5–25 倍的 LLM 且成本低得多。
原文摘要(Abstract)

Large language models (LLMs) have shown remarkable capabilities in automated code generation. While effective for mainstream languages, they may underperform on less common or domain-specific languages, prompting companies to develop in-house code generators. While open-source models can be trained for this, only LLMs with tens of billions of parameters match the performance of commercial tools, demanding costly training and deployment. Recent work proposed supporting code generation with smaller models (SLMs) by generating multiple candidate solutions and using another SLM to select the most likely correct one. The most recent work in this area is the one by Sun et al. [29] presenting RankEF, a T5 model trained to rank code solutions using both execution-based and non-execution-based information. However, Sun et al. do not assess the T5 ranker’s classification accuracy, that is, how often it misjudges correct implementations as incorrect or vice versa, leaving open questions about the reliability of LMs as code correctness judges for other tasks (e.g., automated code review). Moreover, their experiments involve relatively old models, making it unclear the extent to which such a methodology would still help companies in cheaply training their own code generators with performance comparable to those of massive LLMs. We present a study addressing these limitations. We train several state-of-the-art SLMs as code correctness judges and assess their ability to discriminate between correct and wrong implementations. We show that modern SLMs outperform RankEF, even without exploiting execution-based information. When used as code rankers, they achieve higher performance gains than RankEF and perform competitively with LLMs 5–25 × larger, at a fraction of the cost.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2602-11911,
  title = {Improving Code Generation via Small Language Model-as-a-judge},
  author = {Giuseppe Crupi and Rosalia Tufano and Gabriele Bavota},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3787822}
}