Introduction
Large Language Models (LLMs) have made remarkable strides in code generation, yet competitive programming remains a formidable challenge. These problems demand deep algorithmic reasoning and the ability to handle obscure edge cases. Consequently, even state-of-the-art models frequently fail to produce a correct solution on their first attempt.
To mitigate this, researchers typically sample multiple candidate solutions and employ a "verifier" to select the best one. However, existing verification methods suffer from significant limitations. They either attempt to generate comprehensive test cases—a task often as difficult as solving the problem itself—or they rely on inefficient random input sampling. Because the space of valid inputs is vast, random sampling rarely triggers the specific logic errors necessary to distinguish a truly correct solution from a subtly flawed one.
To address this bottleneck, researchers from Renmin University and Alibaba’s Qwen team have developed the Agentic Verifier, an execution-based AI agent that actively hunts for inputs to expose behavioral discrepancies between candidate solutions.
The Agentic Verifier Approach
Instead of outputting a single test case or blindly guessing, the Agentic Verifier treats test-case generation as a multi-turn, interactive reasoning task.
- Multi-turn Interaction: The verifier interacts directly with a code execution environment. It proposes inputs, runs candidate solutions, and inspects the execution results.
- Active Search for Discriminative Inputs: The core innovation lies in searching for discriminative inputs—specific test cases where two different candidate solutions yield different outputs. If two programs disagree on the same input, at least one must be incorrect, allowing the verifier to systematically eliminate flawed code.
Training Pipeline
To equip the model with this bug-hunting capability, the researchers designed a scalable training pipeline:
- Data Synthesis: The team constructed a massive dataset of competitive programming problems, pairing them with labeled "correct" and "incorrect" solutions.
- Rejection Fine-Tuning (RFT): A massive 235B-parameter teacher model (Qwen3-235B) was used to generate successful bug-hunting trajectories. A smaller 30B model was then fine-tuned to mimic these high-quality trajectories.
- Agentic Reinforcement Learning: The model was further optimized using Group Relative Policy Optimization (GRPO). The RL environment rewarded the model for discovering valid, discriminative inputs and penalized it for generating invalid ones, framing verification as a verifiable game.
Evaluation and Datasets
The Agentic Verifier was rigorously tested across five diverse competitive programming benchmarks:
- USACO: Problems from the USA Computing Olympiad.
- LiveCodeBench: Recent problems from platforms like LeetCode, AtCoder, and CodeForces (post-February 2025).
- OJBench: High-difficulty problems from NOI and ICPC.
- ICPC-Eval: Problems from International Collegiate Programming Contests.
- CodeForces (New): A newly curated benchmark of 64 problems from late 2024 and early 2025, specifically designed to prevent data leakage and test true generalization.
Key Findings and Results
The Agentic Verifier demonstrates that the discriminative power of a test case is far more valuable than the sheer volume of test cases. A few targeted edge cases found by the agent consistently outperform hundreds of random inputs.
- Massive Accuracy Boosts: The Agentic Verifier achieved +10–15% absolute gains in Best@k accuracy compared to vanilla sampling baselines.
- Outperforming Ground Truth: Remarkably, on the USACO benchmark, the inputs generated by the verifier led to better solution selection than the original ground-truth test cases provided by human problem setters.
- Exposing False Positives: The research revealed that many "correct" solutions in standard benchmarks are actually false positives. They pass official test suites but fail against the rigorous, targeted inputs generated by the Agentic Verifier.
- Test-Time Scaling Laws: The method exhibits clear test-time scaling. As the verifier is allocated more "turns" or more candidate pairs to evaluate, final accuracy continues to climb—unlike random sampling, which quickly plateaus.
- Efficiency: Thanks to the agentic training pipeline, a 30B model outperformed a much larger 235B model operating in a zero-shot capacity.
Limitations and Future Directions
While highly effective for competitive programming, the Agentic Verifier currently has a specialized domain scope. A pilot test on general software engineering tasks (SWE-bench) yielded modest gains (+1.6%), indicating that broader software development applications will require more task-specific training.
Additionally, running an agentic loop for every solution pair is computationally expensive, averaging roughly 45.5 GPU-seconds per query. Future research will need to focus on optimizing the search process to reduce compute costs.
Ultimately, the authors envision a "virtuous cycle" of self-improvement: the highly discriminative inputs discovered by the verifier could be fed back into the training data to enhance the original code generation models, closing the loop on AI-driven software development.
Summary updated