Skip to content

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

Notifications You must be signed in to change notification settings

JieWu02/X-Coder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

X-Coder Logo

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

HF Model   ModelScope Model   HF SFT Data   ModelScope SFT Data   HF RL Data   ModelScope RL Data   arXiv

Overview

Left: To overcome the scarcity of real-world data, we synthesize high-quality tasks, solutions, and test cases to support both SFT and RL training. Right: Avg@8 results on LiveCodeBench. X-Coder achieves significant performance gains on competitive programming using fully synthetic data. For the full data synthesis workflow (question/answer/test generation), see data-recipe/README.md.

News

  • 2026.2.6: X-Coder datasets achieved 4.5k downloads in huggingface.
  • 2026.2.1: Added feature extraction, evolution, and sampling scripts.
  • 2026.2.1: Incorporated suggestions from reviewers.
  • 2026.1.6: Paper released.
  • 2026.1.5: Dataset, models, and code recipe released.

Pipeline

Pipeline

Framework of our synthesis pipeline. We first extract and evolve competitive programming related features from small-scale code instruction data and merge them into tree structures. It then samples subtrees from the feature tree, selects a compatible feature set, and formulates a scenario that naturally integrates these consistent features. Novel tasks are generated based on a proposed scenario according to specific styles. Advanced reasoning models are used to synthesize solutions and tests for the generated tasks, which are further cross-verified using the proposed dual-verification strategy to yield reliable test outputs and the top solution.

Results

Results

Performance on LiveCodeBench v5. X-Coder shows strong coding expertise with fewer, fully synthetic tasks, and achieves additional gains through subsequent RL stages.

SFT Training

SFT training can be performed using various frameworks such as ms-swift, LLaMA-Factory, or Megatron-LM. Below we provide a simple example using ms-swift.

Environment Setup

pip install ms-swift -U

Data Preparation

Download and convert the SFT training data from HuggingFace:

cd sft-recipe
python download_and_convert_data.py

This will download IIGroup/X-Coder-SFT-376k and convert it to hybrid_376k.jsonl format with query and response fields.

Start SFT Training

For multi-node training (8 nodes x 8 GPUs):

# On each node, set the appropriate environment variables:
export NODE_RANK=<node_rank>  # 0, 1, 2, ..., 7
export MASTER_ADDR=<master_node_ip>
export MASTER_PORT=29500

cd sft-recipe
bash train_sft.sh

For single-node training, modify train_sft.sh:

  • Set NNODES=1
  • Adjust CUDA_VISIBLE_DEVICES as needed

RLVR Training

RLVR Quick Start

# 1. Clone the repository
git clone https://github.com/JieWu02/X-Coder.git
cd X-Coder

# 2. Start Docker container
sudo docker run -it --rm \
  --gpus all \
  --ipc=host \
  -v $(pwd):/workspace \
  whatcanyousee/verl:ngc-cu124-vllm0.8.5-sglang0.4.6.post5-mcore0.12.1-te2.3-deepseekv3 \
  /bin/bash

# 3. Install dependencies
pip install sandbox_fusion pyext
cd rl-recipe

# 4. Download rl training data
python download_data.py

# 5. Start training
bash train_scripts/install.sh
bash train_scripts/xcoder-rl-train.sh

RL Data Preparation

The rl training data (~17GB total) is hosted on HuggingFace: IIGroup/X-Coder-RL-40k

Download RL Data

cd rl-recipe

# Download all data (~17GB)
python download_data.py

# Or download only synthetic data (~8.5GB)
python download_data.py --syn-only

Data Structure

After downloading, the data will be organized as:

rl-recipe/
├── syn_rl_data/
│   └── xcoder_data/
│       └── sorted_by_passrate/
│           ├── part_0000.parquet
│           ├── part_0001.parquet
│           ├── part_0002.parquet
│           ├── part_0003.parquet
│           └── rl_tasks_easy.parquet
└── real_rl_data/
    └── non_sys_prompt/
        ├── codeforces_9763.parquet
        ├── klear_code.parquet
        ├── leetcode_2772.parquet
        ├── taco_13064.parquet
        └── test_wo_prompt.parquet

Code Judge

A code execution and evaluation service is included in rl-recipe/code-judge/.

Citation

If you find this work helpful, please cite:

@article{wu2026x,
  title={X-Coder: Advancing Competitive Programming with Fully Synthetic Tasks, Solutions, and Tests},
  author={Wu, Jie and Li, Haoling and Zhang, Xin and Guo, Jiani and Luo, Jane and Liu, Steven and Huang, Yangyu and Chu, Ruihang and Li, Scarlett and Yang, Yujiu},
  journal={arXiv preprint arXiv:2601.06953},
  year={2026}
}

License

This project is licensed under the Apache License 2.0.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •