Improving LLM Code Generation via Requirement-Aware Curriculum Reinforcement Learning
A new framework teaches LLMs to tackle programming challenges by mastering difficulty step-by-step.
Researchers from academia have introduced RECRL, a novel framework designed to improve large language model (LLM) code generation using requirement-aware curriculum reinforcement learning. The method tackles three key weaknesses in existing curriculum reinforcement learning approaches: misaligned difficulty perception, lack of requirement difficulty optimization, and suboptimal curriculum sampling. By treating programming requirements as the sole model input, RECRL automatically evaluates how difficult a specific requirement is for the given LLM, then optimizes those requirements to maximize training data utility. An adaptive sampling strategy smoothly increases the difficulty of training batches, mimicking a natural learning progression.
In extensive experiments across five state-of-the-art LLMs and five widely-used code generation benchmarks, RECRL outperformed five strong baselines. The framework achieved an average Pass@1 improvement of 1.23%–5.62%—a significant gain in code generation accuracy. RECRL integrates insights from software requirements engineering, making it distinct from prior work that ignores requirement-level difficulty. The authors provide full experimental details, including a PDF and HTML version of the paper, available on arXiv. This work has immediate implications for improving AI-assisted coding tools and reducing the engineering effort needed to debug generated code.
- RECRL automatically perceives model-specific requirement difficulty and optimizes requirements to improve training data utilization.
- Tested on 5 state-of-the-art LLMs and 5 benchmarks, achieving 1.23%–5.62% average Pass@1 improvement over baselines.
- Addresses limitations of existing curriculum reinforcement learning: misaligned difficulty, absence of optimization, and suboptimal sampling.
Why It Matters
Better code generation means fewer errors and faster development, directly boosting productivity for software engineers using AI assistants.