OpenCodeReasoning
The largest open reasoning dataset for code: 735,255 Python samples distilled from DeepSeek R1 across 28,319 unique competitive-programming problems from CodeForces, LeetCode, AtCoder, and more. SFT-only training on it reached 61.8% on LiveCodeBench — beating RL-trained alternatives. Predominantly CC BY 4.0 with some Apache 2.0/MIT-sourced subsets.
加载
from datasets import load_dataset
ds = load_dataset("nvidia/OpenCodeReasoning")预览示例数据
{
"input": "Given an array of n integers, find the length of the longest strictly increasing subsequence. n ≤ 2500.",
"output": "<think>O(n log n) with patience sorting: keep tails array, binary search each element...</think>\nimport bisect\ndef lis(a):\n tails = []\n for x in a:\n i = bisect.bisect_left(tails, x)\n if i == len(tails): tails.append(x)\n else: tails[i] = x\n return len(tails)",
"source": "codeforces",
"difficulty": "medium"
}用这个数据集微调
使用 QLoRA(4-bit 基础模型 + LoRA 适配器)微调的预计显存需求(保守默认参数):
7B QLoRA · ~6GB VRAM13B QLoRA · ~10GB VRAM
检测你的 GPU 能否微调 →微调新手?跟着分步教程走: 一小时微调你的第一个 LLM
常见问题
OpenCodeReasoning 可以商用吗?
可以——OpenCodeReasoning 采用 CC BY 4.0 宽松许可证,允许商业使用,包括训练用于产品的模型。发布前请查看数据集卡片中的署名要求。
OpenCodeReasoning 有多少数据?需要全部使用吗?
OpenCodeReasoning 包含 735k Samples。通常不需要全部:风格和格式微调只需几百到几千条样本——先加载切片(如 split="train[:1000]"),质量到达瓶颈时再扩大规模。
OpenCodeReasoning 最适合做什么?
Fine-tuning coding models that show their reasoning before writing the solution。它属于数据集中心的「推理」板块,那里有替代和互补的数据集。