Introduction
Verification remains a critical bottleneck in Large Language Model (LLM) code generation. While execution feedback—testing code against unit tests—is a standard verification method, its effectiveness is limited by the availability of high-quality, comprehensive test suites. Human-annotated datasets like APPS often provide only a few tests per problem, which is insufficient for robust verification in real-world scenarios. GenX addresses this by introducing a framework that concurrently trains code and test generation models through an iterative execution feedback loop.
The GenX Framework
GenX utilizes a two-stage data augmentation process and a reciprocal ranking system to improve model performance. The framework treats code and test generation as mutually reinforcing tasks.
Iterative Data Augmentation
The framework operates in two primary phases:
- Execution-Guided Test Generation: The model generates test inputs, which are then executed against a ground-truth code solution. This ensures that the resulting test cases are valid and correctly labeled.
- Rejection Sampling for Code: Candidate code solutions are generated and filtered against the expanded test suite. Only solutions passing all tests are retained for subsequent training iterations, ensuring high-quality synthetic data.
Dual Critic Scoring
For inference where ground truth is unavailable, GenX employs a "Dual Critic Scoring" algorithm. By executing a set of candidate solutions against a set of generated tests, a pass/fail matrix is constructed. A reciprocal evaluation algorithm then scores solutions and tests iteratively: a solution's quality is derived from the quality of tests it passes, and vice-versa. This method allows the model to identify high-quality solutions without prior knowledge of the correct answer.
Experimental Evaluation
The framework was primarily evaluated using the APPS dataset (5,000 problems). Three variants were compared: APPS (original), APPS- (minimal solutions/tests), and APPS+ (the GenX-augmented version featuring ~20 solutions and ~184 tests per problem).
Results
Models trained on the augmented APPS+ dataset consistently outperformed those trained on standard data. The iterative feedback loop teaches general coding logic rather than simple memorization, as evidenced by performance gains on transfer tasks like HumanEval and MBPP.
Key findings include:
- Superior Ranking: Dual Critic Scoring achieved a 30.60% 1@10 score on introductory problems, surpassing existing methods like CodeT (29.60%).
- Generalization: Marked improvements on HumanEval prove the model learns robust programming patterns.
- Test Quality: In some metrics, the 5.7B parameter GenX model outperformed GPT-3.5 Turbo in generating valid test cases for standard benchmarks.
Conclusion and Future Work
GenX demonstrates that code and test generation are mutually reinforcing. While the framework currently requires an initial ground-truth solution to bootstrap the process and relies on binary pass/fail feedback, it establishes a powerful paradigm for self-improving code LLMs. Future research will explore utilizing richer execution signals, such as compiler error messages, and extending the framework to multi-language environments.
Summary updated