arXiv:2605.23491 · 中英对照阅读
CoSPlay:利用自生成代码与单元测试进行测试时协作式自博弈
CoSPlay: Cooperative Self-Play at Test-Time with Self-Generated Code and Unit Test
中文速览
在没有标准答案测试用例的情况下,怎样判断哪段代码更可靠,是无监督代码生成面临的难题。CoSPlay不更新模型,也不依赖人工标注,而是在生成多种解法和针对性测试后,让代码与测试反复互相检验、修正和替换,最后再用不同代码对随机输入的输出共识来选出答案。实验显示,它在四个编程基准上达到或超过一些依赖大量标准测试训练的强模型,也优于同等生成预算下的其他无标准答案方法,而且增加预算还能继续提升表现。它的重要性在于,代码和测试可以在推理时共同变得更可靠,为降低人工测试成本、扩展代码生成提供了新路径。
摘要
Recently, advanced by RLVR [6, 40, 33] and TTS [3, 20, 23], LLMs have achieved significant progress in coding capability. In code generation, UTs provide executable input-output checks that make functional correctness verifiable [35, 41]. This has made them widely used for guiding recent code-generation methods. As shown in Figure 2, SOTA RLVR methods leverage large collections of GT UTs for training, i.e. test cases with guaranteed-correct input-output pairs, typically curated by human experts or official problem setters [22, 44, 35]. However, curating such GT UTs is too costly to scale [4, 21], and GT-free RLVR methods like Absolute-Zero [47] still remain less competitive in practice and require costly model-weight updates [42, 48].
术语表
- RLVR
- 可验证奖励强化学习(RLVR)
- TTS
- 测试时扩展(TTS)
- LLM
- 大语言模型(LLM)
- UT
- 单元测试(UT)
- GT
- 真实标注(GT)
- GT UTs
- 真实标注单元测试
- SOTA
- 当前最优(SOTA)
- Absolute-Zero
- Absolute-Zero
- CoSPlay
- CoSPlay
- BoN
- Best-of-N(BoN)
- PlanSearch
- PlanSearch
- code generation
- 代码生成
- code candidate
- 代码候选
- co-evolution
- 协同演化
- test-time
- 测试时
- self-play
- 自博弈
- execution matrix
- 执行矩阵
- pass count
- 通过次数
- pass rate
- 通过率
- output self-consistency
- 输出自一致性
- output consensus
- 输出共识
- consensus cluster
- 共识簇
- failure mode
- 失效模式
- edge case
- 边界情况
- solution plan
- 解题方案
- attack idea
- 攻击思路
- posterior probability
- 后验概率
- input-output pair
- 输入—输出对