Table of Contents
Fetching ...

Scaling Data Difficulty: Improving Coding Models via Reinforcement Learning on Fresh and Challenging Problems

Zongqian Li, Tengchao Lv, Shaohan Huang, Yixuan Su, Qinzheng Sun, Qiufeng Yin, Ying Xin, Scarlett Li, Lei Cui, Nigel Collier, Furu Wei

TL;DR

This work introduces a four-stage Data Processing Framework encompassing collection, processing, filtering, and verification, incorporating Automatic Difficulty Filtering via an LLM-based predict-calibrate-select framework that leverages multi-dimensional difficulty metrics across five weighted dimensions to retain challenging problems while removing simplistic ones.

Abstract

Training next-generation code generation models requires high-quality datasets, yet existing datasets face difficulty imbalance, format inconsistency, and data quality problems. We address these challenges through systematic data processing and difficulty scaling. We introduce a four-stage Data Processing Framework encompassing collection, processing, filtering, and verification, incorporating Automatic Difficulty Filtering via an LLM-based predict-calibrate-select framework that leverages multi-dimensional difficulty metrics across five weighted dimensions to retain challenging problems while removing simplistic ones. The resulting MicroCoder dataset comprises tens of thousands of curated real competitive programming problems from diverse platforms, emphasizing recency and difficulty. Evaluations on strictly unseen LiveCodeBench demonstrate that MicroCoder achieves 3x larger performance gains within 300 training steps compared to widely-used baseline datasets of comparable size, with consistent advantages under both GRPO and its variant training algorithms. The MicroCoder dataset delivers obvious improvements on medium and hard problems across different model sizes, achieving up to 17.2% relative gains in overall performance where model capabilities are most stretched. These results validate that difficulty-aware data curation improves model performance on challenging tasks, providing multiple insights for dataset creation in code generation.

Scaling Data Difficulty: Improving Coding Models via Reinforcement Learning on Fresh and Challenging Problems

TL;DR

This work introduces a four-stage Data Processing Framework encompassing collection, processing, filtering, and verification, incorporating Automatic Difficulty Filtering via an LLM-based predict-calibrate-select framework that leverages multi-dimensional difficulty metrics across five weighted dimensions to retain challenging problems while removing simplistic ones.

Abstract

Training next-generation code generation models requires high-quality datasets, yet existing datasets face difficulty imbalance, format inconsistency, and data quality problems. We address these challenges through systematic data processing and difficulty scaling. We introduce a four-stage Data Processing Framework encompassing collection, processing, filtering, and verification, incorporating Automatic Difficulty Filtering via an LLM-based predict-calibrate-select framework that leverages multi-dimensional difficulty metrics across five weighted dimensions to retain challenging problems while removing simplistic ones. The resulting MicroCoder dataset comprises tens of thousands of curated real competitive programming problems from diverse platforms, emphasizing recency and difficulty. Evaluations on strictly unseen LiveCodeBench demonstrate that MicroCoder achieves 3x larger performance gains within 300 training steps compared to widely-used baseline datasets of comparable size, with consistent advantages under both GRPO and its variant training algorithms. The MicroCoder dataset delivers obvious improvements on medium and hard problems across different model sizes, achieving up to 17.2% relative gains in overall performance where model capabilities are most stretched. These results validate that difficulty-aware data curation improves model performance on challenging tasks, providing multiple insights for dataset creation in code generation.
Paper Structure (19 sections, 6 figures, 1 table)

This paper contains 19 sections, 6 figures, 1 table.

Figures (6)

  • Figure 1: Data Processing Framework Overview.Top: Four-stage pipeline transforming raw datasets into high-quality training data through data collection, standardization processing, quality filtering, correctness verification, and final dataset creation. Middle: Standardization steps including translation of foreign language problems to English, noise removal and refinement, format prompt unification, and LLM-based test case generation and selection. Bottom: Multi-stage filtering implementing hard requirements (text-only problems via content-type distinction, uniqueness via overlap identification, unseen status via test set comparison) and adaptive selection (difficulty-based filtering using multidimensional difficulty matrix with LLM to distinguish easy and difficult problems), producing the filtered dataset for verification.
  • Figure 2: Multi-dimensional Difficulty Metrics Framework.Top: Five-dimensional assessment system where each dimension is evaluated on a 1-5 scale with specific descriptors defining evaluation criteria. Bottom Left: Example of scoring a question with three independent GPT-4O assessments. Each assessment rates all dimensions (for example, Assessment 1: PCD=4, KBR=2, ATC=3, ID=3, OD=3) and applies weights (ATC 45%, ID 35%, OD 10%, PCD 5%, KBR 5%) to yield individual scores (3, 3, 3.1), which average to a final difficulty score of 3.03. Bottom Right: Distribution curve showing that the difficulty score of the example problem (3.03) positions it in the top 30% of the dataset, indicating a relatively challenging problem.
  • Figure 3: Difficulty Filtering Case Study on LiveCodeBench v6.Left: Actual difficulty distribution based on model pass rates. Middle Left: GPT-4O predicted difficulty calibrated against ground truth to determine boundaries at 2.5 (easy/medium) and 2.75 (medium/hard), achieving near-perfect distribution with actual distribution and enabling accurate difficulty-based filtering for subsequent data. Middle Right: Recall curves showing the proportion of each difficulty category removed, where high easy recall (more than 60% at 30% filtering) versus low difficult recall demonstrates selective removal of simple problems. Right: Difficulty composition of retained problems, where filtering 30% of data changes the distribution from 45% easy to under 25% easy while increasing difficult problem proportion to over 50%, confirming effective difficulty-based selection.
  • Figure 4: Dataset Composition and Processing Flow. Sankey diagram illustrating the complete data pipeline from diverse sources to final difficulty categorization. The dataset comprises exclusively real competitive programming problems without generated content. Open-source contributions undergo substantial filtering, with most problems abandoned and primarily difficult problems retained. Private collections contribute the majority of challenging and recent problems across platforms, resulting in a challenging and high-quality dataset.
  • Figure 5: Dataset Statistical Characteristics and Diversity Analysis.Left: Problem length distribution across platforms, with privately collected datasets (AIZU, AtCoder) showing comparable length profiles to open-source datasets (Kattis, CodeChef), where AIZU exhibits the longest average problem length. Middle Left: Test case distribution where privately collected datasets exhibit more test cases per problem, with all datasets capped at 15 longest test cases following DeepCoder to prevent training pause from problems with hundreds of lengthy test cases. Middle Right: t-SNE clustering visualization demonstrating clear platform separation and complementary coverage between privately collected and open-source datasets. Right: Cosine similarity table where training datasets (y-axis) show low similarity (0.04-0.14) against test benchmarks (x-axis: AtCoder, LeetCode, LiveCodeBench), confirming no overlap between training and test sets.
  • ...and 1 more figures