Two-Stage Reinforcement Learning for Sound and Adversarial Test Generation in Code LLMs
Not on the map. Why?
Abstract (arXiv)
Reinforcement learning (RL) has substantially advanced code generation with large language models (LLMs) through executable feedback. The feedback for coding problems mainly comes from specific test cases, where high-quality test cases are often scarce since they should be both sound and discriminative. We thus turn to study the auto-generation of test cases using the learned model. We find this is naturally an adversarial RL problem: the model is expected to generate effective test cases as counterexamples, depending on the solver's current failure modes. We propose Test Cases Scaling (TCS), a two-stage RL framework for effective test generation. Both stages train a test generator from a rolling policy-aligned buffer: Stage 1 generates tests consistent with the reference solution, and Stage 2 restricts the buffer to current failure modes and learns counterexample tests. Across TACO and LiveCodeBench, TCS improves both pass@1 and inference-time answer selection according to generated tests. We find the learned test generator also enables effective selection among other LLM outputs.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 21 of its 43 references that are in the map. First posted on arXiv 3 Sep 2026.
Builds on
21 of 43 references.
References · 21
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
- 2025DAPO: An Open-Source LLM Reinforcement Learning System at Scalecited by 2,810
- 2024HybridFlow: A Flexible and Efficient RLHF Frameworkcited by 2,057
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2022CodeT: Code Generation with Generated Testscited by 384
- 2024Inference Scaling Laws: An Empirical Analysis of Compute-Optimal Inference for Problem-Solving with Language Modelscited by 290
- 2025Inference-Time Scaling for Generalist Reward Modelingcited by 239
- 2023TACO: Topics in Algorithmic COde generation datasetcited by 160
- 2024ODIN: Disentangled Reward Mitigates Hacking in RLHFcited by 136
- 2025Reward Shaping to Mitigate Reward Hacking in RLHFcited by 88
9 more
- 2024Code Repair with LLMs gives an Exploration-Exploitation Tradeoffcited by 51
- 2024LeDex: Training LLMs to Better Self-Debug and Explain Codecited by 40
- 2025Learning to Solve and Verify: A Self-Play Framework for Code and Test Generationcited by 35
- 2025Dynamic Scaling of Unit Tests for Code Reward Modelingcited by 33
- 2024Large Language Models as Test Case Generators: Performance Evaluation and Enhancementcited by 28
- 2024Reasoning Through Execution: Unifying Process and Outcome Rewards for Code Generationcited by 21
- 2025Incentivizing LLMs to Self-Verify Their Answerscited by 17
- 2024PyTester: Deep Reinforcement Learning for Text-to-Testcase Generationcited by 6
- 2025FGIT: Fault-Guided Fine-Tuning for Code Generationcited by 2
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2025Learning to Generate Unit Test via Adversarial Reinforcement Learning
- 2025Klear-CodeTest: Scalable Test Case Generation for Code Reinforcement Learning
- 2026EvolveCoder: Evolving Test Cases via Adversarial Verification for Code Reinforcement Learning
- 2026Code-A1: Adversarial Evolving of Code LLM and Test LLM via Reinforcement Learning
- 2025Rethinking Verification for LLM Code Generation: From Generation to Testing
- 2025ACECODER: Acing Coder RL via Automated Test-Case Synthesis
- 2025CodeContests+: High-Quality Test Case Generation for Competitive Programming
- 2026CodeScaler: Scaling Code LLM Training and Test-Time Inference via Reward Models