A Deep Dive into Scaling RL for Code Generation with Synthetic Data and Curricula

Cansu Sancaktar, David Zhang, Gabriel Synnaeve, Taco CohenarXiv 2026

TL;DR

Sustaining performance gains in reinforcement learning (RL) for language models is often bottlenecked by data diversity and structure rather than sheer volume. This paper introduces a scalable, multi-turn synthetic data generation pipeline where an un-fine-tuned teacher model iteratively refines coding problems based on student performance feedback. This approach creates structured "stepping stones" of difficulty and diverse training environments, significantly boosting both in-domain coding and out-of-domain mathematical reasoning across multiple model families.

What Problem Does This Paper Address?

While reinforcement learning (RL) has successfully pushed large language models (LLMs) beyond the limits of supervised fine-tuning, scaling it effectively remains a major challenge. Simply increasing the volume of real-world training problems quickly leads to diminishing returns.

Real-world datasets typically feature an uncontrolled mix of difficulties: overly simple problems cause the model's policy entropy to collapse too early (leading to overfitting), while excessively hard problems provide sparse rewards that stall exploration entirely. Traditional curriculum learning struggles to fix this because real-world hard problems rarely build cleanly on top of easy ones. The authors address this gap by exploring how to synthetically generate structured, diverse, and appropriately paced problem distributions to sustain RL scaling.

Methods

The authors propose a multi-turn synthetic data generation pipeline driven entirely by an in-context teacher-student framework, requiring no gradient updates or fine-tuning for the teacher model.

  1. Inspiration Seed: The teacher model (e.g., GPT-OSS 120B in high-reasoning mode) takes a code snippet from real coding puzzles or open-source repositories to ground the problem domain.
  2. Initial Generation (Turn 1): The teacher generates an initial problem, and a student model (the same model in low-reasoning mode) attempts to solve it multiple times ($M=32$).
  3. Iterative Mutation (Turn > 1): The teacher receives a summary of the student's success/failure rates and representative solutions. It then mutates the problem to either increase or decrease complexity based on a targeted progression strategy. This reverse construction naturally creates coherent chains of easy-medium-hard variants ("stepping stones").

The pipeline generates data across four distinct RL environments:

  • Induction: Classical program synthesis.
  • Abduction: Input prediction given a function and an output.
  • Deduction: Output prediction given a function and an input.
  • Fuzzing: Finding an input that exploits a subtle bug in a function.

For the actual RL training, the authors utilize an asynchronous variant of Group Relative Policy Optimization (GRPO).

Datasets

  • Generation Seeds: Successful solutions from initial RL runs and random open-source code snippets from starcoderdata.
  • Evaluation Benchmarks: LiveCodeBench (LCB) (including LCBv5 easy, medium, and hard splits) is used to evaluate in-domain coding capabilities. Math500 and AIME2024 serve as benchmarks to test out-of-domain mathematical reasoning generalization.

Key Insights and Ideas

  • Structure Over Volume: Naively scaling real data from 25K to 81K problems plateaus early due to entropy collapse. Synthetically structured data provides a far more efficient learning signal under a fixed compute budget.
  • The Multi-Turn Advantage: Allowing the teacher to iteratively refine problems yields a fourfold increase in valid, well-formatted synthetic problems compared to standard single-turn generation.
  • The "Goldilocks" Difficulty: Training exclusively on medium-difficulty questions offers the best balance between convergence speed and downstream generalization. Easy questions cause overfitting to simple patterns, while hard questions suffer from sparse rewards.
  • Environment Diversity as a Scaling Axis: Distributing a fixed problem budget across four structurally distinct environments (Induction, Abduction, Deduction, Fuzzing) acts as an independent axis of improvement. It prevents overfitting on easy tasks and significantly improves out-of-domain math performance.

Key Results

  • Performance Boost: Augmenting 25K real problems with 20K synthetic problems led to faster and more stable convergence across Llama3.1-8B Instruct, Qwen3-8B Base, and Qwen2.5-32B Base.
  • Outperforming Real Data: Synthetic augmentation outperformed the larger 81K real-data baseline on most LiveCodeBench metrics.
  • Pure Synthetic Competitiveness: Models trained solely on synthetic data matched or exceeded the performance of models trained on real data.
  • Curriculum Matters: Reverse curricula that begin with medium-difficulty tasks mitigate early overfitting while maintaining strong performance on harder splits.

Limitations and Future Work

  • Decoupled Generation: The data generation pipeline is currently decoupled from active RL training. The teacher and student models used to generate the data are frozen API models rather than the active model undergoing training. Putting the teacher dynamically "in-the-loop" during active RL training is a suggested next step.
  • Curation Requirements: Without explicit filtering or flattening of the difficulty distribution, synthetic generation naturally skews toward easier questions, meaning the data still requires careful curation to avoid overfitting.

Summary updated

BibTeX
@misc{sancaktar2026deep,
  author = {Cansu Sancaktar and David Zhang and Gabriel Synnaeve and Taco Cohen},
  title = {{A Deep Dive into Scaling RL for Code Generation with Synthetic Data and Curricula}},
  year = {2026},
  eprint = {2603.24202},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.24202},
}
Figure