Research
X-Coder: Advancing Competitive Programming with Synthetic Tasks, Solutions, and Tests
Overview Research area: Natural Language Processing — code LLMs, LLM post-training (supervised fine-tuning and reinforcement learning), and synthetic data generation for competitive programming. Techn
- arXiv
- 2601.06953
- Published
- 2026-01-11
- Authors
- Jie Wu, Haoling Li, Xin Zhang, Jiani Guo, Jane Luo, Xuewei Yang, Steven Liu, Yangyu Huang, Ruihang Chu, Scarlett Li, Yujiu Yang
AI summary
Overview
Research area: Natural Language Processing — code LLMs, LLM post-training (supervised fine-tuning and reinforcement learning), and synthetic data generation for competitive programming.
Technical level: Advanced. The paper assumes familiarity with SFT, RL/GRPO, chain-of-thought reasoning models, and competitive-programming benchmarks.
Scope: The paper builds a pipeline that synthesizes competitive-programming tasks, solutions, and executable test cases, then uses only those synthetic artifacts to train the X-Coder model series through a full SFT-then-RL cycle.
What This Paper Is About
Competitive programming is the current frontier for code LLMs, but training such models requires high-quality reasoning data that is scarce, largely exhausted, and risks near-duplicate contamination of the very benchmarks used to evaluate it. This paper asks whether models can reach expert-level code reasoning without directly reusing any real-world tasks, solutions, or tests in post-training — relying instead on synthesized tasks, verified solutions, and synthesized executable tests that serve as RL reward signals. The answer the authors report is yes, with the caveat that the pipeline still depends indirectly on real data: abstract competition-related features are extracted from 10k TACO snippets, and teacher LLMs may have learned from real-world corpora.
Key Contributions
- A formulation of SFT-then-RL training from synthetic artifacts. The authors examine whether Code LLMs can be post-trained entirely on synthetic tasks, solutions, and tests, while explicitly accounting for indirect dependence on seed features and teacher models.
- The X-Coder model series. X-Coder-14B reaches 67.5% avg@8 on LiveCodeBench v5 and 63.4% on v6, outperforming its base model by over 40 points. X-Coder also transfers across model families and beyond LiveCodeBench.
- A synthesis and dual-verification pipeline. The pipeline produces solvable-yet-challenging multi-style tasks, verified long-CoT solutions, and executable test suites, with a dual-verification strategy that reduces noise in both selected solutions and voted test outputs.
- Extensive ablations and practical guidance. The paper analyzes synthetic data scaling, task diversity versus solution diversity, long-CoT supervision, verification reliability, data selection, and RL initialization, and releases the related models and data at github.com/JieWu02/X-Coder.
Main Findings
- Main results: During SFT, X-Coder-Qwen2.5-7B-SFT scores 60.3/53.5 avg@8 on LiveCodeBench v5/v6 and X-Coder-Qwen2.5-14B-SFT scores 64.2/59.1. After RL, these become 62.9/55.8 and 67.5/63.4 respectively.
- Scaling laws hold for synthetic data: SFT improves monotonically as the dataset grows from 32k to 64k to 128k to 200k unique prompts (each with 1 solution), rising from 43.7% to 62.7% on LiveCodeBench v5.
- Task diversity beats solution diversity: Under a fixed compute budget, 64k tasks × 1 solution outperforms 16k × 4 and 8k × 8, showing broader algorithmic coverage generalizes better than repeated exposure to the same problems.
- Synthetic data competes with the largest real-data reasoning set: In a token-matched comparison against OpenCodeReasoning, X-Coder-7B-SFT at 25k prompts × 8 solutions scored 52.5 average pass@1 versus 53.6 for OpenCodeReasoning, but was already better on medium (67.4 vs 67.0) and hard (27.7 vs 21.8) splits. Scaling to 200k prompts × 1 solution gave 60.3, beating OpenCodeReasoning by 6.7 points.
- Dual verification is critical: Training on verified solutions (64k tasks) reached 53.4 on LCB v5 versus 47.0 for raw solutions, a 6.4-point gap. Verifying 200k samples required 1.6M CoT trajectories and 24M sandbox executions, a one-time construction cost.
- Voting accuracy is high: Consensus majority voting over candidate solutions achieved 94.7% labeling accuracy with 8 sampled solutions, measured on the TACO dataset. Roughly 36.9% of tasks were filtered out because GPT-5 (high reasoning effort) achieved a zero pass rate on the voted tests.
- Human audit results: Of 150 randomly sampled SFT tasks, 90.0% were well-defined, and both golden-solution correctness and voted test-label accuracy were 87.3%.
- SFT absorbs most of the gain, but RL still contributes: Across Qwen Instruct, Qwen Base, and Llama backbones, SFT provided the dominant first-order improvement while RL gave consistent additional gains. Stronger SFT initializers earned higher rewards during RL.
- Long CoT helps but converges slower: On the same 200k tasks, long-CoT solutions gained +17.4/+17.5 points from epoch 3 to epoch 8 (42.9→60.3 on v5, 36.0→53.5 on v6), while short-CoT gained only +8.1/+8.3 (35.0→43.1 and 29.3→37.6). The paper reports the long-CoT approach as achieving a 17.2% absolute gain, with slower convergence requiring 8–10 epochs versus 2–3 for short-CoT.
- Long-CoT tasks are a useful data-selection signal: Comparing three 50k-task selections from a 200k pool — difficulty-based (GPT-4o ratings), rationale-based (DeepSeek-R1-0528 reasoning length), and random — tasks that induce longer CoT proved more valuable.
- Model generality: The same pipeline applied to Qwen2.5-Coder-7B-Instruct (17.5→60.3→62.9 on v5), Qwen3-8B-Base (16.4→59.4→64.0), Llama-3.1-8B-Instruct (11.8→42.7→47.8), Qwen3.5-4B at 32k (39.7→63.0→65.6) and Qwen3.5-4B at 80k (63.1→63.2→67.3). At 80k, Qwen3.5-4B gains 4.2/6.0 points over the original on v5/v6.
- Benchmark generality: X-Coder-14B-RL scores 82.7 on LiveBench, 48.3 on Codeforces, and 73.0 on MBPP+, giving the highest average (68.0) across the three benchmarks.
- Test-time scaling improves: X-Coder-7B-RL improves over its foundation by 51.3 points in pass@16 and matches Qwen3-8B with 8× fewer rollouts, with a larger pass@1-to-pass@16 gap suggesting more diverse reasoning trajectories.
- Remaining bottlenecks: Wrong answers dominate failure cases, making algorithmic reasoning the main bottleneck; next most frequent are context-window exhaustion (against the 32k-token budget) and time limit errors.
Methodology in Plain English
The authors adapt a feature-based synthesis framework (from EpiCoder) to competitive programming in four steps.
Task generation. They extract and evolve competition-related features from 10k TACO code snippets using GPT-4o-0513, building a domain-specific feature tree. They split scenario creation into two stages — selecting mutually consistent features, then formulating hint-free tasks — which prevents the LLM from oversimplifying problems. One-shot prompting improves instruction-following, and tasks are generated in Codeforces style (narrative input/output problems), LeetCode style (function signatures with starter code), and AtCoder style (concise specifications). GPT-o3-mini handles task formulation.
Test input generation. Because competitive problems rarely ship test cases, the authors use two complementary methods: prompting the LLM to read the constraints and produce standard plus edge-case inputs, and a tool-based method that lets the LLM call functions from CYaRon, a dedicated test-case generation library.
Candidate solution generation. Multiple reasoning LLMs — DeepSeek-R1-0528 and Qwen3-235B-A22B-Thinking-2507 — sample solutions per task. Each candidate must contain a complete chain-of-thought and syntactically valid Python, checked by AST-based static analysis.
Dual verification. Step one builds a provisional ground-truth output for each test input by majority voting across all candidate solutions, then weights test cases by difficulty using semantic heuristics (boundary and stress tests get higher weight) and input-file size. Step two splits the candidate tests 50/50: half used as a weighted test suite to rank candidate solutions, half held out as unseen validation to confirm the winner generalizes rather than overfitting to the weighted set. Tasks that GPT-5 cannot solve at all (zero pass rate) are discarded under the assumption they are ambiguous or underspecified.
The resulting (task, golden solution) pairs drive SFT (learning rate 5e-5, global batch size 128, 8 epochs), and (task, golden test suite) pairs drive GRPO reinforcement learning, where the reward is 5.0 × (passed / total) if the code compiles, 0 if it compiles but passes nothing, and −2 if no code is extracted or compilation fails. Execution runs in a distributed FastAPI/Redis/sandbox-worker framework for concurrent code testing. Evaluation uses avg@8 on LiveCodeBench v5 and v6 with temperature 0.6, top-p 0.95, top-k 20, and a maximum generation length of 32,768 tokens.
Why This Matters
Impact on research. The work tests a strong hypothesis: that the finite pool of real-world competitive-programming tasks is not strictly necessary for expert-level code reasoning. It provides a concrete alternative to the data-scarcity and benchmark-contamination pressures that dominate current code-LLM training, and it quantifies the tradeoffs — how much performance comes from SFT versus RL, how much task diversity matters relative to solution diversity, and what verification costs in compute. It also reports an honest limitation: 12.7% residual error remains in golden solutions and voted labels before deterministic filtering, and correlated teacher errors can survive consensus voting.
Real-world applications:
- Automated generation of practice problems and judged test suites for competitive-programming platforms and training websites.
- Scalable benchmark and evaluation-set construction where licensing or contamination restricts the use of real problems.
- Reward-signal generation for code agents that must be trained with execution feedback in domains where no test suites exist.
- Synthetic long-CoT reasoning supervision for other verifiable domains where correctness can be checked by execution.
Industry relevance. Companies training code models face rising data-acquisition costs, legal exposure around scraped contest problems, and evaluation contamination. This paper shows that a synthetic pipeline can substitute for real training artifacts and generalize across model families (Qwen, Llama) and generations, which matters for teams that want to fine-tune on their own infrastructure. It also documents the concrete compute profile: SFT of X-Coder on Qwen2.5-Coder-7B-Instruct took 128 H20 Enterprise (96 GB) GPUs for 220 hours, while RL took 32 H200 GPUs over 7 days for 270 update steps — useful for capacity planning.
Future Directions
- Closing the verification gap. Reducing the 12.7% residual error in golden solutions and voted test labels before filtering, especially because RL rewards are directly shaped by label correctness while SFT tolerates more noise. The authors suggest test synthesis, feedback refinement, and adversarial testing to curb reward hacking.
- Extending beyond self-contained problems. The current setup covers clean, executable, single-file algorithmic tasks. Repository-level generation and debugging, feature implementation, command-line environments, and visual coding tasks are untested and may not follow the same conclusions.
- Tackling the reasoning bottleneck. Wrong answers dominate failures, followed by context-window exhaustion within the 32k-token budget and time-limit errors. The paper points to deeper reasoning, concise reasoning control, and execution efficiency as targets.
- Reducing the long-CoT cost. Long-CoT supervision produces much larger gains but needs 8–10 epochs versus 2–3, and the paper notes lower-confidence samples are more tolerable in SFT than RL; finding ways to get long-CoT quality with faster convergence and cheaper data construction remains open.
Target Audience
Researchers and engineers working on code LLMs, LLM post-training (SFT and RL), and synthetic data generation will get the most from this paper. It is also relevant to practitioners building competitive-programming training platforms or evaluation suites who need to understand test-case synthesis and verification reliability, and to teams planning the compute budget for a synthetic-data SFT-then-RL pipeline. Readers without a background in reinforcement learning or chain-of-thought reasoning models will find the methodology sections demanding.
Authors’ abstract
Competitive programming remains challenging for code LLMs. Despite recent progress, many training pipelines still depend on scarce real-world data, raising concerns about scalability and near-duplicate benchmark contamination. In this paper, we examine whether synthetic training artifacts can support the complete SFT-to-RL cycle for competitive programming: no real-world tasks, solutions, or test cases are directly used for post-training. To this end, we synthesize tasks, verified solutions, and reliable test cases that serve as reward signals for reinforcement learning. To improve reward reliability, we introduce a dual-verification strategy that reduces noise in both selected solutions and test outputs. Using this high-quality data, we train the X-Coder model series. X-Coder-14B achieves 67.5\% avg@8 on LiveCodeBench v5 and 63.4\% on v6, outperforming its base model by over 40 points. Further analysis provides practical insights into synthetic post-training, highlighting the value of diverse tasks, verified long-CoT supervision, and code-centric reinforcement. Our data and models are released at https://github.com/JieWu02/X-Coder