Preference and reward data
Teach what better means: pairs and judgments that rank code, ideally grounded in tests.
Who needs this
Useful when SFT has plateaued and you want a cheap alignment step before (or instead of) full RL. Pairs derived from test results are far more reliable than pairs judged by another model alone.
Decisions you will make
- Execution-grounded pairs (passes tests versus fails tests) versus LLM-judged pairs. Prefer the first where you can get it.
- Whether to train a reward model or skip it. For code, tests are often a better reward than a learned model, so verifiable-reward RL can replace this stage.
- DPO versus other offline methods. Use the simplest one your trainer supports and compare on a held-out eval.
Pitfalls
- LLM-judged preferences reward style and length. Control for length, or your model learns to write longer code.
- Pairs where both samples pass (or both fail) carry little signal. Filter to pairs with a clear outcome gap.
- Preference data built from a benchmark's tests can leak that benchmark into training.
Datasets 9
AceCode-87K (TIGER-Lab)
Questions rewritten by GPT-4o-mini with synthesized test cases; includes completions with pass rates, used for reward models and RL (AceCoder).
AceCode-V2-122K (TIGER-Lab)
Improved AceCode: questions and tests rewritten by OpenAI o1-mini and filtered with Qwen2.5-Coder-32B-Instruct; card includes RL results for Qwen2.5-Coder-7B-Base.
AceCodePair-300K (TIGER-Lab)
Test-case-derived preference pairs built from AceCode-87K pass rates, used to train AceCode reward models with Bradley-Terry loss.
CodeUltraFeedback
Preference data: coding instructions with responses ranked on five coding preferences by GPT-3.5 as judge, with scores and textual feedback.
H4 Stack Exchange preferences
Stack Overflow questions with at least two scored answers, built for preference-model training and usable for LM training.
Ling-Coder-DPO
Code DPO pairs derived from CodeContests, choosing positive and negative samples by test pass rate, perplexity distribution and reward-model score.
nebius SWE-agent-trajectories
SWE-agent trajectories with resolved or failed labels and patches, from a Llama-3.1-70B based agent on SWE-bench-like tasks.
Qwen3-Coder-Next OpenCode Preference
DPO pairs from rejection sampling: 8 samples per problem, chosen passes 100% of tests, rejected fails, with labeled rejection types. Companion to an SFT set of 49,374 examples.
Vezora Code-Preference-Pairs
DPO-style pairs from the Open-Critic-GPT synthetic pipeline: code with inserted bugs as the rejected side.
Papers 2
AceCoder
Automated test-case synthesis creates (question, tests) pairs for reward models and RL; best-of-32 gains of about 5 to 10 points reported.
Dynamic Scaling of Unit Tests for Code Reward Modeling (CodeRM)
More generated unit tests give better reward signals, especially on hard problems; proposes CodeRM-8B.
Recipes 1
Tools 5
Axolotl
YAML-driven fine-tuning framework with multi-GPU and many model families.
LLaMA-Factory
Unified fine-tuning of 100+ LLMs and VLMs (SFT, DPO, etc.) with a web UI.
Open-Instruct (AI2)
AI2 post-training codebase including RLVR (GRPO) training. Verified active on GitHub API.
torchtune
PyTorch-native post-training library.
TRL
Hugging Face RL library with GRPO trainer and custom reward functions. Verified active on GitHub API.
