CoSPlay: Cooperative Self-Play at Test-Time with Self-Generated Code and Unit Test
On the map: LLM reasoning → Reinforcement learning for reasoning
Abstract (arXiv)
Recently, Reinforcement Learning with Verifiable Rewards (RLVR) and Test-Time Scaling (TTS) have advanced LLM code generation through executable verification. Yet Ground-Truth Unit Tests (GT UTs) remain a bottleneck: SOTA RLVR methods require them for costly training, while existing TTS methods lose competitiveness without them. This motivates GT-free TTS, where existing methods directly use self-generated UTs to refine and select code candidates. Yet such UTs are often noisy or spuriously coupled with wrong code, and UT quality in turn cannot be validated without reliable code. The key challenge is therefore to jointly improve both. To this end, we present CoSPlay, a GT-free, training-free framework that jointly improves codes and UTs through cooperative self-play. It first explores diverse solution ideas and identifies their potential failure modes to produce discriminative UT ideas. It then uses bidirectional pass-count signals from the Code-UT execution matrix to iteratively prune or fix weak codes and refresh or replace unreliable UTs, letting the two pools co-evolve. Finally, when multiple codes remain tied at the highest pass count, it picks the final code from the largest output-consensus cluster, since correct codes agree on the same inputs while wrong codes diverge. Experiments on four challenging benchmarks show that CoSPlay on Qwen2.5-7B-Instruct improves average BoN from 22.1% to 33.2% and UT accuracy from 14.6% to 78.3%, matching or surpassing the RLVR model CURE-7B. When applied to CURE-7B, it further improves BoN by 5.7%. CoSPlay also generalizes across diverse backbones and outperforms GT-free TTS baselines under comparable token budgets, with continued gains as the budget scales up. These results suggest a scalable inference strategy for competitive code generation without any GT data.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Placed in Reinforcement learning for reasoning, one of 17 directions in LLM reasoning. Builds on 0 of its 49 references that are in the map. First posted on arXiv 22 May 2026.
Builds on
0 of 49 references.
No references here yet.
Built on by
Citing papers per year: 2026: 3.
3 papers.
Similar, not cited
Close in wording, no citation either way
- 2025Co-Evolving LLM Coder and Unit Tester via Reinforcement Learning
- 2025ReVeal: Self-Evolving Code Agents via Reliable Self-Verification
- 2026CodeScaler: Scaling Code LLM Training and Test-Time Inference via Reward Models
- 2026Information-Gain Rewards over Diversity-Pruned Tests: GT-Anchored Verifier Co-Training for Reliable Code Generation
- 2026Skill Self-Play: Pushing the Frontier of LLM Capability with Co-Evolving Skills
- 2025Rethinking Verification for LLM Code Generation: From Generation to Testing
- 2025Learning to Solve and Verify: A Self-Play Framework for Code and Test Generation
- 2025SWE-RM: Execution-free Feedback For Software Engineering Agents