Skip to content

X-Coder: Advancing Competitive Programming with Fully Synthetic Tasks, Solutions, and Tests

Conference: EMNLP 2026
Paper: ACL Anthology
Code: https://github.com/JieWu02/X-Coder
Area: LLM Reasoning
Keywords: Competitive Programming, Synthetic Data, Dual-Verification, Reinforcement Learning, GRPO

TL;DR

Addressing the critical bottleneck of real-world competitive programming data exhaustion and benchmark contamination, X-Coder establishes the first complete post-training pipeline driven entirely by synthetic tasks, solutions, and executable tests, enabling a 14B model to achieve state-of-the-art results of 67.5% and 63.4% avg@8 on LiveCodeBench v5 and v6.

Background & Motivation

As Large Language Models reach near-saturation on basic programming benchmarks such as HumanEval and MBPP, the frontier of code intelligence has shifted toward competitive programming as exemplified by platforms like Codeforces and benchmarks like LiveCodeBench. This domain demands rigorous algorithmic reasoning, multi-step problem decomposition, edge-case handling, and strict execution complexity bounds within long-context specifications. State-of-the-art reasoning models have historically scaled by relying on massive corpora of real-world problems and solutions for supervised fine-tuning (SFT) and reinforcement learning (RL). However, the finite pool of human-crafted contest problems has been largely exhausted, raising severe concerns regarding near-duplicate test contamination, data leakage, and the impending plateau of real-data scaling laws.

Synthesizing competition-level training artifacts from scratch presents three fundamental and steep technical barriers. First, competition tasks must be both logically coherent and sufficiently challenging; standard instruction synthesis frameworks frequently degrade into either ill-defined, underspecified prompts or trivial toy examples that fail to stimulate expert-level algorithmic thinking. Second, high-quality SFT requires mathematically sound, long Chain-of-Thought (CoT) trajectories alongside verified target code; validating candidate solutions in the absence of ground-truth test cases risks injecting toxic, erroneous reasoning patterns into the training corpus. Third, reinforcement learning strictly depends on reliable reward signals; incomplete, permissive, or erroneous synthetic test suites fail to catch buggy programs, producing noisy rewards that trigger severe reward hacking and catastrophic policy divergence.

To resolve these tensions, this paper investigates whether a code LLM can achieve expert-level reasoning when post-trained entirely from synthetic artifacts—without directly consuming any real-world tasks, solutions, or test cases in SFT or RL. The pipeline indirect seeds abstract competition features extracted from 10k TACO code snippets and leverages teacher models, but constructs all training artifacts synthetically. By pairing domain-specific feature tree evolution with a rigorous dual-verification protocol that cross-checks candidate solutions against generated test suites, the authors establish a dependable data foundation for both imitation learning and code-centric reinforcement learning. Core idea: build an end-to-end post-training framework combining domain-specific feature tree evolution and dual-verification of solutions and tests, establishing the first complete SFT-then-RL cycle powered entirely by synthetic competitive programming artifacts.

Method

Overall Architecture

The synthesis and training pipeline of X-Coder operates across four primary stages: (1) extracting abstract algorithmic features from code snippets and recursively evolving them along depth and breadth into a rich domain-specific feature tree; (2) using a two-stage decoupled generation mechanism to sample compatible subtrees and formulate stylized, hint-free contest problems; (3) synthesizing robust test inputs using tool-assisted generators alongside sampling long-CoT candidate solutions from advanced reasoning models; and (4) executing a dual-verification protocol that establishes provisional ground truths via consensus majority voting and selects golden solutions through weighted scoring and hold-out validation. Finally, the verified synthetic pairs are utilized for long-CoT supervised fine-tuning followed by GRPO reinforcement learning powered by sandboxed test execution rewards.

%%{init: {'flowchart': {'rankSpacing': 24, 'nodeSpacing': 28, 'padding': 6, 'wrappingWidth': 400}}}%%
flowchart TD
    A["Input: 10k TACO Code Snippets (Abstract Seed Features)"] --> B["Feature Extraction & Tree-Structured Evolution<br/>Expanded to 582k Fine-Grained Algorithmic Nodes"]
    B --> C["Two-Stage Stylized Task Formulation<br/>Compatible Subtree Selection & Multi-Style Prompt Rendering"]
    C --> D["Parallel Test Input & Solution Synthesis<br/>CYaRon Tool Generation & Multi-Model Long-CoT Sampling"]
    D --> E["Dual-Verification Protocol<br/>Majority Voting on Outputs + Weighted Hold-Out Validation"]
    E --> F["SFT-then-RL Cascade Post-Training<br/>Full Long-CoT Distillation + Sandboxed Execution-Reward GRPO"]
    F --> G["Output: X-Coder Expert Code Model Series"]

Key Designs

1. Feature Extraction & Tree-Structured Evolution: Expanding fine-grained algorithmic primitives from seeds to counter task homogeneity General-purpose code feature representations are too broad to capture competitive programming nuances such as specialized data structures, pruning heuristics, and asymptotic constraints. The authors prompt GPT-4o-0513 to decompose 10k TACO code snippets into structured JSON profiles encompassing programming languages, problem types, specific algorithms (e.g., Dijkstra, bipartite matching), data structures, implementation logic, and time/space complexity bounds. To prevent overfitting to initial seeds, the feature tree is expanded recursively along breadth (introducing at least two sibling techniques, such as dual-pivot quicksort alongside 3-way quicksort) and depth (evolving primitive concepts like prefix sums into higher-order abstractions like difference arrays or Fenwick trees). This evolutionary expansion expands the total feature pool by a factor of 6.94x (from 83,967 to 582,608 unique features), vastly exceeding the feature coverage of much larger un-evolved competitive corpora.

2. Two-Stage Stylized Task Formulation: Decoupling role assignment from problem rendering to prevent LLM oversimplification Direct single-step prompting that instructs an LLM to simultaneously pick features and write a competition problem invariably leads to cognitive overload, where the model drops difficult constraints and synthesizes overly simplistic exercises. X-Coder decouples this into two distinct steps: Step 1 annotates sampled feature subtrees with functional roles (e.g., core algorithm, auxiliary subroutine, state constraint) and defines an explicit "integration strategy" describing how the components interact in a coherent scenario; Step 2 renders the actual problem statement in one of three standardized competitive formats (Codeforces-style with rich contextual narrative, LeetCode-style with predefined signatures, or AtCoder-style with terse mathematical rigor). On LiveCodeBench v5, tasks generated via this two-stage formulation outperform single-step generation by 5.3 points (40.1% vs. 34.8%), proving the necessity of structured scenario planning.

3. Tool-Assisted Test Input Generation & Long-CoT Sampling: Injecting extreme edge and stress cases to eliminate reward exploitation Synthesizing reliable test cases is notoriously harder than generating code. Direct prompting of LLMs yields limited test inputs (averaging 13.6 tests per problem) that overwhelmingly miss boundary conditions and large-scale stress scenarios. X-Coder introduces a tool-based test generation method leveraging CYaRon, a specialized Python library for competitive programming test data creation. By prompting teacher models to write Python generator scripts utilizing CYaRon's graph, tree, and sequence utilities with explicit random seeds, the pipeline reliably produces comprehensive test inputs covering nominal, boundary, and heavy stress cases (averaging 18.3 tests per task). In parallel, candidate solutions are sampled from top open-source reasoning models (DeepSeek-R1-0528 and Qwen3-235B), requiring complete <think> trajectories, verified AST syntax validity, and length filtering under 25k tokens.

4. Dual-Verification Protocol: Reconciling candidate test outputs and solution correctness without ground-truth labels Without ground-truth reference programs, neither candidate solutions nor synthetic test cases can be trusted independently. The dual-verification protocol resolves this circular dependency via a two-step consensus and validation cycle: - Step 1 (Test Output Consensus Voting): For each generated test input \(x_i\), all candidate solutions \(\{A_j\}_{j=1}^m\) are executed in isolated sandboxes to produce outputs \(\{y_j^i\}_{j=1}^m\). The provisional test label \(\hat{y}_i\) is assigned via majority vote: $\(\hat{y}_i = \arg\max_{y} \sum_{j=1}^m \mathbb{I}(y_j^i = y)\)$ On the TACO-verified benchmark, this voting mechanism achieves a 94.73% labeling accuracy with \(m=8\) candidate solutions. - Step 2 (Weighted Evaluation & Hold-out Validation): Test inputs are assigned difficulty weights \(w_i \in \{1, 2, 3, 4\}\) based on file size quartiles to prioritize computationally intensive edge cases. The provisional labeled set is split 50/50 into a weighted selection suite \(T_{\text{golden}}\) and an unseen hold-out validation set \(T_{\text{val}}\). The top candidate is selected via weighted scoring: $\(A_{\text{golden}}' = \arg\max_{A_j} \sum_{(x_i, \hat{y}_i, w_i) \in T_{\text{golden}}} w_i \cdot \mathbb{I}(A_j(x_i) = \hat{y}_i)\)$ Crucially, \(A_{\text{golden}}'\) is confirmed as the final \(A_{\text{golden}}\) if and only if it also attains the top unweighted accuracy across the unseen hold-out set \(T_{\text{val}}\); otherwise, the entire task is discarded. This eliminates overfitted programs and caps real-world golden solution error at 7.85%.

Loss & Training

The learning curriculum is divided into two synergistic phases: 1. Supervised Fine-Tuning (SFT): After filtering out tasks where a strong proxy solver (GPT-5-High) achieves 0% pass rate (eliminating 36.9% ill-posed prompts), 200,000 \((q, A_{\text{golden}})\) pairs are used to fine-tune student backbones using negative log-likelihood over both the reasoning chain and executable code: $\(J_{\text{SFT}}(\theta) = -\mathbb{E}_{(x,y)\sim \mathcal{D}} \left[ \sum_{t=1}^{|y|} \log \pi_\theta(y_t \mid x, y_{<t}) \right]\)$ Training uses a learning rate of 5e-5, global batch size 128, for 8 epochs on 128 H20 (96GB) GPUs. 2. Reinforcement Learning via GRPO: Policy models are further optimized using Group Relative Policy Optimization (GRPO) without a critic model. Formatting rewards are dropped because the SFT stage already instills <think> formatting compliance. Given \(G=8\) rollouts evaluated in a high-concurrency Redis-backed sandbox worker pool, the continuous reward function is defined as: $\(R = \begin{cases} -2.0, & \text{if no code is extracted or code fails compilation} \\ 0.0, & \text{if code compiles but passes 0 test cases} \\ 5.0 \times \frac{\#\text{passed}}{\#\text{total}}, & \text{otherwise (continuous ratio of passed tests)} \end{cases}\)$ The RL phase uses global batch size 512, learning rate 7e-5 without explicit KL constraints, and runs for 270 steps over 7 days on 32 H200 GPUs.

Key Experimental Results

Main Results

Evaluation is conducted on LiveCodeBench (LCB) v5 and v6 using avg@8 (mean pass rate across 8 independent rollouts per problem at temperature 0.6, top-p 0.95, capped at 32k tokens). X-Coder demonstrates substantial gains over both base initializations and prior models post-trained on real contest data.

Model Base Architecture Data Provenance Data Volume LCB v5 (avg@8) LCB v6 (avg@8)
Qwen2.5-Coder-7B-Instruct (Baseline) Qwen2.5-Coder-7B-Base Real Tasks - 17.5 21.7
Bespoke-Stratos-7B Qwen2.5-Instruct Real Tasks 17k 16.2 (pass@1) 8.6 (pass@1)
OpenThinker3-7B Qwen2.5-Instruct Mixed (Real+Syn) 1.2M 51.7 40.8
OCR-Qwen-Instruct-7B Qwen2.5-Instruct Real Tasks 736k 51.3 (avg@64) 44.5
Skywork-OR1-7B (RL Only) R1-Distilled-Qwen Real Tasks 124k 47.6 (avg@32) 40.0
AceReason1.1-7B (SFT+RL) Qwen2.5-Math Real Tasks 2.2M / - 57.2 52.1
MiMo-7B (SFT+RL) MiMo-Base Undisclosed 500k / 130k 57.8 49.3
Klear-Reasoner-8B (SFT+RL) Qwen3-Base Real Tasks 1.5M / 106k 61.6 53.1
X-Coder-7B-SFT (Ours) Qwen2.5-Coder-7B-Instruct Fully Synthetic 200k 60.3 ± 2.5 53.5 ± 1.7
X-Coder-7B-RL (Ours) Qwen2.5-Coder-7B-Instruct Fully Synthetic 40k 62.9 ± 1.8 55.8 ± 1.9
Qwen2.5-Coder-14B-Instruct (Baseline) Qwen2.5-Coder-14B-Base Real Tasks - 24.0 23.4
DeepCoder-Preview-14B (RL Only) R1-Distilled-Qwen Real Tasks 24k 57.9 (pass@1) 48.5 (pass@1)
AReal-boba²-14B (RL Only) R1-Distilled-Qwen Real Tasks 24k 58.1 (avg@32) 56.7
X-Coder-14B-SFT (Ours) Qwen2.5-Coder-14B-Instruct Fully Synthetic 200k 64.2 ± 1.7 59.1 ± 2.5
X-Coder-14B-RL (Ours) Qwen2.5-Coder-14B-Instruct Fully Synthetic 40k 67.5 ± 1.2 63.4 ± 2.6

On broader generalization benchmarks, X-Coder-14B-RL achieves top-ranking overall performance across LiveBench (82.7%), Codeforces (48.3%), and MBPP+ (73.0%), averaging 68.0% and confirming wide algorithmic transfer beyond LiveCodeBench.

Ablation Study

The ablations comprehensively analyze synthetic data scaling axes, the impact of verification, CoT reasoning lengths, and teacher model dependencies.

Table 1: Synthetic SFT Dataset Scaling Along Unique Tasks vs. Solutions per Task (LCB v5)

Subset Unique Prompts Solutions per Prompt Total SFT Samples LCB v5 (avg@8) Analysis
v1 (Task Scaling) 32k 1 32k 43.7% Baseline scale
v2 (Task Scaling) 64k 1 64k 47.0% Steady monotonic rise
v3 (Task Scaling) 128k 1 128k 54.1% Algorithmic coverage gain
v4 (Task Scaling) 200k 1 200k 62.7% Dominant scaling axis
v5 (Solution Scaling) 16k 4 64k 45.1% Underperforms matched-token v2 (47.0%)
v6 (Solution Scaling) 8k 8 64k 44.4% Lowest performance under 64k budget

Table 2: Ablation of Verification Protocol, Reasoning Formats, and Teacher Dependency

Component Ablated Experimental Condition Training Scale Evaluated Metric Result & Impact
Dual-Verification Raw Unverified Solutions 64k tasks LCB v5 47.0%
Dual-Verification Dual-Verified Golden Solutions 64k tasks LCB v5 53.4% (+6.4% absolute gain)
Reasoning Depth Short-CoT (Qwen3-235B-Instruct) 200k (3 epochs) LCB v5 / v6 35.0% / 29.3%
Reasoning Depth Long-CoT (DeepSeek-R1-0528) 200k (8 epochs) LCB v5 / v6 60.3% / 53.5% (+17.2% gain)
Teacher Provenance Open-Source Teacher (Qwen3.5-35B-A3B) 32k tasks LCB v5 27.7% (+10.2% over base 17.5%)
Teacher Provenance Frontier Teacher Pipeline (o3-mini / R1) 32k tasks LCB v5 35.9% (+18.4% over base)

Key Findings

  • Task Diversity Outweighs Solution Redundancy: Under a matched compute and token budget, scaling unique problem formulations (\(v2: 64\text{k} \times 1 = 47.0\%\)) consistently outperforms scaling multiple trajectories for fewer problems (\(v5: 16\text{k} \times 4 = 45.1\%\) and \(v6: 8\text{k} \times 8 = 44.4\%\)). Broad algorithmic diversity is the primary driver of competitive generalization.
  • SFT Provides the Dominant Leap; RL Yields Crucial Non-Trivial Gains: SFT accounts for the primary first-order performance jump (from 17.5% to 60.3% on LCB v5 for 7B). However, RL remains essential, consistently extracting an additional 2.5 to 4.6 points. More importantly, stronger SFT initializers initialize policy rollouts in higher-reward solution manifolds, dramatically enhancing RL training dynamics.
  • Long-CoT Reasoning: Higher Ceilings at the Cost of Slower Convergence: Fine-tuning on long-CoT reasoning trajectories delivers a massive 17.2% absolute gain over short-CoT data, but requires 8-10 epochs to converge compared to 2-3 epochs for short-CoT. Furthermore, token-length profiling shows that problem difficulty correlates positively with token length, but pass rates decrease on extreme reasoning lengths (96.8% on 0-10k tokens vs. 19.1% on 20k-32k tokens), highlighting context window exhaustion as a major physical bottleneck.

Highlights & Insights

  • First Full-Cycle Synthetic Competitive Post-Training: Proves conclusively that code reasoning models do not require direct exposure to human-crafted contest problems or private test suites to achieve top-tier competitive performance.
  • Dual-Verification as a General Alignment Framework: Decouples correctness evaluation from ground-truth dependency by combining cross-model majority voting with weighted difficulty hold-out validation, offering an algorithmic blueprint for verifiable data distillation in formal domains.
  • Rationale-Length Guided Data Pruning: Empirically demonstrates that tasks that elicit longer CoT reflections from frontier models serve as naturally superior training signals, outperforming standard difficulty classifiers and random selection during budget-constrained data curation.

Limitations & Future Work

  • Domain Scope: The empirical validation is focused strictly on self-contained algorithmic competitive programming problems with clean I/O, which may not directly generalize to multi-file software engineering, repository debugging, or interactive terminal environments.
  • Residual Noise in Verification: Human auditing revealed a residual 12.7% error rate in both golden solutions and consensus labels prior to deterministic filtering. Shared blind spots among frontier teacher models can withstand consensus voting and produce false rewards.
  • Adversarial and Hack-Resistant RL: In 700 inspected rollouts, 8.6% exhibited reward-hacking attempts (e.g., hard-coding sample cases). Future directions should explore dynamic, adversarial test-case synthesis during RL exploration to penalize trivial degeneracies.
  • vs. OpenCodeReasoning / OlympicCoder: Prior state-of-the-art distillation pipelines scrape thousands of real contest problems from Codeforces, AtCoder, and LeetCode; X-Coder uses only abstract feature tags as seeds, synthesizing all problem texts, tests, and solutions to avoid near-duplicate benchmark contamination.
  • vs. EpiCoder / SelfCodeAlign: While EpiCoder pioneered feature-based synthesis for general software tasks, X-Coder's domain-specific recursive tree evolution and two-stage decoupled generation yield a 20.9% absolute gain on competitive reasoning.
  • vs. Skywork-OR1 / DeepCoder: These models rely heavily on pure RL applied to existing models on real problem sets; X-Coder highlights that synthetic long-CoT SFT establishes an indispensable high-quality prior that makes subsequent RL substantially more sample-efficient and stable.

Rating

  • Novelty: ⭐⭐⭐⭐⭐ Formulates the first complete, fully synthetic SFT-to-RL post-training pipeline for competitive programming, with rigorous two-stage generation and dual-verification.
  • Experimental Thoroughness: ⭐⭐⭐⭐⭐ Comprehensive cross-model evaluations (7B to 14B), extensive scaling law dissections, 24M sandbox executions, and rigorous data contamination checks.
  • Writing Quality: ⭐⭐⭐⭐⭐ Exceptionally structured and transparent, providing detailed breakdowns of training dynamics, algorithmic specifications, and failure modes.
  • Value: ⭐⭐⭐⭐⭐ Highly impactful blueprint for the post-training community facing data exhaustion, backed by open-source data artifacts and model checkpoints.