HYUKI5's picture
nvidia/OpenCodeReasoning-2@eadf53593145 を複製し、カードを日本語で書く
1bf685b verified
|
Raw History Blame Contribute Delete
21.2 kB
---
license: cc-by-4.0
pretty_name: nvidia/OpenCodeReasoning-2 (mirror)
source_datasets:
- nvidia/OpenCodeReasoning-2
tags:
- laya
- laya-finetune
- mirror
- domain-code
- use-permissive
- genre-instruction
- label-binary
- annot-llm
task_categories:
- text-generation
size_categories:
- 100K<n<1M
configs:
- config_name: train
data_files:
- split: python
path: train/python/train-*
- split: cpp
path: train/cpp/train-*
dataset_info:
- config_name: train
features:
- name: question
dtype: string
- name: r1_generation
dtype: string
- name: qwq_critique
dtype: string
- name: solution
dtype: string
- name: judgement
dtype: string
- name: pass_rate
dtype: string
- name: source
dtype: string
- name: license
dtype: string
- name: dataset
dtype: string
- name: split
dtype: string
- name: difficulty
dtype: string
- name: index
dtype: string
- name: id
dtype: string
- name: question_id
dtype: string
splits:
- name: python
num_bytes: 72296224095
num_examples: 1398166
- name: cpp
num_bytes: 44739645805
num_examples: 1174475
---
# nvidia/OpenCodeReasoning-2(複製)
## データの内容
競技プログラミングの問題に対する Python と C++ の解答と批評のデータ。1 行が 1 つの応答で、R1 の解答 `r1_generation` とそのコード `solution`、QwQ の批評 `qwq_critique` と判定 `judgement`、通過率 `pass_rate` を持つ。問題は TACO・APPS・CodeContests・open-r1/codeforces から集め、解答は R1、批評は QwQ が生成した。問題文の `question` は空のままなので、別途取得する必要がある。
## データの概要
| 項目 | 値 |
|---|---|
| 行数 | 約 2,164,812(1 構成・2 分割の合計) |
| 列数 | 14 |
| 容量 | 49.41 GB(ファイル 131 本) |
| ファイルの形式 | parquet 129 |
| 公開 | public |
### 構成と分割
| 構成(config) | 分割(split)ごとの行数 | 列数 |
|---|---|---:|
| `train` | `python` 約 1,422,489、`cpp` 約 742,323 | 14 |
### 列(構成 `train`・分割 `python`)
| 列 | 型 | 先頭の行の値 |
|---|---|---|
| `question` | `string` | `-` |
| `r1_generation` | `string` | `<think> Okay, I need to solve this problem where…` |
| `qwq_critique` | `string` | `<think> Okay, let's see. I need to check if the …` |
| `solution` | `string` | `T = int(input()) for _ in range(T): s = inpu…` |
| `judgement` | `string` | `right` |
| `pass_rate` | `string` | `0.9` |
| `source` | `string` | `codechef` |
| `license` | `string` | `apache-2.0` |
| `dataset` | `string` | `taco` |
| `split` | `string` | `train` |
| `difficulty` | `string` | `UNKNOWN_DIFFICULTY` |
| `index` | `string` | `20120` |
| `id` | `string` | `21306138af031d61bb31cd6636057168` |
| `question_id` | `string` | `c0d4209f929db2b5bf3526a47a2520b0` |
行数と列は HF のデータセットビューアの集計(元のデータセットの現在の版で数えたもの)。全データセットの一覧は [HYUKI5/dataset-catalog](https://huggingface.co/datasets/HYUKI5/dataset-catalog) にある。
## 複製について
[`nvidia/OpenCodeReasoning-2`](https://huggingface.co/datasets/nvidia/OpenCodeReasoning-2) をリビジョン `eadf535931451525f3e5621d0f960c240bc62fd9` の時点でそのまま複製したもの。中身は変えていない。判断モデル Laya(`convaiinnovations/laya`)の微調整に使う候補として、調査メモ(`Laya 学習用データセット調査`)に載せたデータを集めている。
## 出典
- 元のデータセット: https://huggingface.co/datasets/nvidia/OpenCodeReasoning-2
- 複製したリビジョン: `eadf535931451525f3e5621d0f960c240bc62fd9`(2025-05-17 00:19:15+00:00)
- 元のライセンス表記: `cc-by-4.0`
## 論文
- 元のカードに論文へのリンクは見つからなかった
## アノテーションの方法
**データセットの作成日**
2025 年 3 月 〜 2025 年 5 月
## 微調整に使うときの注意
- 調査メモの台帳での区分: A(許諾型のライセンスだけで、疑義の注記が無い)。区分は記載の文言で機械的に付けたもので、法的な判定ではない。学習に入れる前に元のカードとライセンスの原文で確かめる。
- Laya の入力は 2,048 token まで(ModernBERT-large / mmBERT)。長い本文は先頭から黙って切られるので、切れる行は事前に除くか、要約・切り出しをしてから入れる。
- 分割は記事・文書単位で行い、同じ本文から作った別の問いを学習側と較正側に分けない。温度と閾値は学習に使っていない分割で別々に当てる。
## 調査メモの記述
| メモ | 節 | ライセンス(記載) | 確認 | 注記 |
|---|---|---|---|---|
| `nvidia_nemotron.md` | 付録. 取得した nvidia 組織のデータセット全件の簡易一覧 (L378) | cc-by-4.0 | 確認済 | 確認印なし(各ファイルの凡例により確認済扱い) / 原文注記: × 数学・コード・科学・計測 |
## 元のカード(日本語訳)
以下は元のデータセットのカードの本文を日本語に訳したもの(機械翻訳)。訳に疑問があるときは、末尾の原文を確かめる。
---
# OpenCodeReasoning-2: コード生成と批評における推論のための大規模データセット
## データセットの説明
OpenCodeReasoning-2 は、コーディングのための推論ベースの合成データセットとして現時点で最大のものであり、34,799 の一意の競技プログラミング問題にわたって、Python で 1.4M、C++ で 1.1M のサンプルを含む。
OpenCodeReasoning-2 は、コード補完とコード批評の教師あり微調整(SFT)タスク向けに設計されている。
- [GitHub リポジトリ](https://github.com/NVIDIA/NeMo-Skills) - SFT の実行に使われた完全なパイプラインにアクセスできる。
このデータセットは、商用・非商用のどちらでも使える。
## データの分布
- CodeForces の問題は http://codeforces.com に由来する。
- 問題の集合は、TACO (https://huggingface.co/datasets/BAAI/TACO)、APPS (https://huggingface.co/datasets/codeparrot/apps)、CodeContests
(https://huggingface.co/datasets/deepmind/code_contests)、open-r1/codeforces (https://huggingface.co/datasets/open-r1/codeforces) から集めた。
- CodeContests と open-r1/codeforces のテスト分割は含めていない。
- 解答の応答は R1 が、批評の応答は QwQ が生成した。
### Python
| Source | # Question | #Sample |
|:---------------|:-----------|:-------------|
| AIZU | 2150 | 71,681 |
| AtCoder | 2080 | 64,468 |
| CodeChef | 3869 | 120,040 |
| CodeForces | 15641 | 834,523 |
| Codewars | 2506 | 79,771 |
| GeeksForGeeks | 2670 | 58,154 |
| HackerEarth | 2285 | 73,559 |
| HackerRank | 912 | 26,106 |
| Kattis | 1235 | 39,938 |
| LeetCode | 777 | 29,926 |
| 合計 | 34,125 | 1,398,166 |
### C++
| Source | # Question | #Sample |
|:---------------|:-----------|:-------------|
| AIZU | 2067 | 35,471 |
| AtCoder | 1988 | 62,493 |
| CodeChef | 3830 | 171,882 |
| CodeForces | 11887 | 355,180 |
| Codewars | 2492 | 155,162 |
| GeeksForGeeks | 2668 | 167,610 |
| HackerEarth | 2273 | 82,765 |
| HackerRank | 903 | 43,867 |
| Kattis | 1209 | 49,699 |
| LeetCode | 775 | 50,346 |
| 合計 | 30,092 | 1,174,475 |
## データフィールド
|Field|Type|Description|
|:---|:---|:---|
|id|string|各データインスタンスの一意の ID|
|question_id|string|各問題の一意の ID|
|question|string|入力となる競技プログラミングの問題。ここでは空のままにしている。取得方法は「使い方」の節を参照。|
|r1_generation|string|R1 の応答。|
|qwq_critique|string|QwQ の応答。|
|solution|string|R1 の応答のうちコード部分のみ。|
|judgement|string|QwQ の応答からの判定(正解・不正解)のみ。|
|pass_rate|float|[0, 1] の範囲の値、または -1(ユニットテストが不足している、または実行システムで検証できなかった)。|
|dataset|string|この問題の収集元データセットの名前(例: "apps"、"taco"、"code_contests")。|
|license|string|データセットに付随するライセンス(例: "mit"、"apache-2.0"、"cc-by-4.0")。|
|split|string|この問題の収集元データセットの分割の名前(例: "train"、"valid"、"test")。|
|source|string|競技プログラミングのプラットフォームの名前(例: CodeForces、CodeChef)。|
|difficulty|string|入力された問題の難易度ラベル。|
|index|string|APPS/TACO データセットから入力された問題を取り出すためのインデックス(train-extra 分割でのみ利用可能)。|
## 使い方
```
from tqdm import tqdm
from datasets import load_dataset
hf_datasets = {
"taco": load_dataset("BAAI/TACO", trust_remote_code=True),
"apps": load_dataset("codeparrot/apps", trust_remote_code=True),
"code_contests": load_dataset("deepmind/code_contests"),
"open-r1/codeforces": load_dataset("open-r1/codeforces")
}
def get_question(ds_name, split, index):
benchmark = hf_datasets[ds_name][split][int(index)]
if ds_name == "code_contests":
if not benchmark["description"]:
return None
return benchmark["description"]
elif ds_name in ["taco", "apps"]:
return benchmark["question"]
elif ds_name == "open-r1/codeforces":
if not benchmark["description"]:
return None
question = benchmark["description"]
if benchmark["input_format"]:
question += "\n\nInput\n\n" + benchmark["input_format"]
if benchmark["output_format"]:
question += "\n\nOutput\n\n" + benchmark["output_format"]
if benchmark["examples"]:
question += "\n\nExamples"
for example in benchmark["examples"]:
if "input" in example:
question += "\n\nInput\n\n" + example["input"]
if "output" in example:
question += "\n\nOutput\n\n" + example["output"]
if benchmark["note"]:
question += "\n\nNote\n\n" + benchmark["note"]
return question
return None
ocr2_dataset = load_dataset("nvidia/OpenCodeReasoning-2")
for ocr2_ds in [ocr2_dataset["python"], ocr2_dataset["cpp"]]:
for ocr2_ds_item in tqdm(ocr2_ds):
assert ocr2_ds_item["dataset"] in ["taco", "apps", "code_contests", "open-r1/codeforces"]
ds_name, ds_split, ds_index = ocr2_ds_item["dataset"], ocr2_ds_item["split"], int(ocr2_ds_item["index"])
question = get_question(ds_name, ds_split, ds_index)
assert question is not None
assert ocr2_ds_item["question"] == "-"
ocr2_ds_item["question"] = question
```
## データセットの所有者
NVIDIA Corporation
## データセットの作成日
2025 年 3 月 〜 2025 年 5 月
## ライセンス/利用規約
準拠条件: 準拠条件: このデータセットは、https://creativecommons.org/licenses/by/4.0/legalcode で入手できる Creative Commons Attribution 4.0 International License(CC BY 4.0)でライセンスされている。
スクリプトに関する注意: 以下のスクリプトを実行して、データセットを元のソースから取得してよい。基礎となるデータセットは、それぞれのライセンス条件に従って元のソースから入手できる。
**データの開発者:** NVIDIA
### 用途: <br>
コード生成とコード批評に LLM を特化させるために、大規模言語モデル(LLM)を訓練する開発者。 <br>
### 公開日: <br>
05/15/2025 <br>
## データのバージョン
1.0 (05/15/2025)
## データセットの特性
** データ収集の方法<br>
* [ハイブリッド: 自動、合成] <br>
** ラベリングの方法<be>
* [ハイブリッド: 自動、合成] <br>
## 想定される用途
OpenCodeReasoning-2 データセットは、コミュニティがオープンなモデルを改善し続けるために使われることを想定している。このデータは、モデルの訓練に自由に使ってよい。**ただし、利用者が使うことを選んだデータセットごとに、そのライセンスが目的に適合するかを確かめる責任は利用者にある**。
## 倫理上の配慮:
NVIDIA は、信頼できる AI は共有の責任であると考えており、幅広い AI 応用の開発を可能にするための方針と実践を整えている。利用者は、利用規約に従ってダウンロードまたは利用する場合、関連する業界と用途の要件をこのモデルが満たすか、また予期しない製品の誤用に対処できるかを、社内のモデルチームと確かめるべきである。
セキュリティ上の脆弱性や NVIDIA の AI に関する懸念は、[こちら](https://www.nvidia.com/en-us/support/submit-security-vulnerability/) から報告してほしい。
<details>
<summary>原文(英語)</summary>
# OpenCodeReasoning-2: A Large-scale Dataset for Reasoning in Code Generation and Critique
## Dataset Description
OpenCodeReasoning-2 is the largest reasoning-based synthetic dataset to date for coding, comprising 1.4M samples in Python and 1.1M samples in C++ across 34,799 unique competitive programming questions.
OpenCodeReasoning-2 is designed for supervised fine-tuning (SFT) tasks of code completion and code critique.
- [Github Repo](https://github.com/NVIDIA/NeMo-Skills) - Access the complete pipeline used to perform SFT.
This dataset is ready for commercial/non-commercial use.
## Data distribution
- The CodeForces problems are sourced from http://codeforces.com.
- The question collections are gathered from TACO (https://huggingface.co/datasets/BAAI/TACO), APPS (https://huggingface.co/datasets/codeparrot/apps), CodeContests
(https://huggingface.co/datasets/deepmind/code_contests), and open-r1/codeforces (https://huggingface.co/datasets/open-r1/codeforces).
- We do not include the test split of CodeContests and open-r1/codeforces.
- The solution responses are generated by R1 and critique responses are generated by QwQ.
### Python
| Source | # Question | #Sample |
|:---------------|:-----------|:-------------|
| AIZU | 2150 | 71,681 |
| AtCoder | 2080 | 64,468 |
| CodeChef | 3869 | 120,040 |
| CodeForces | 15641 | 834,523 |
| Codewars | 2506 | 79,771 |
| GeeksForGeeks | 2670 | 58,154 |
| HackerEarth | 2285 | 73,559 |
| HackerRank | 912 | 26,106 |
| Kattis | 1235 | 39,938 |
| LeetCode | 777 | 29,926 |
| Total | 34,125 | 1,398,166 |
### C++
| Source | # Question | #Sample |
|:---------------|:-----------|:-------------|
| AIZU | 2067 | 35,471 |
| AtCoder | 1988 | 62,493 |
| CodeChef | 3830 | 171,882 |
| CodeForces | 11887 | 355,180 |
| Codewars | 2492 | 155,162 |
| GeeksForGeeks | 2668 | 167,610 |
| HackerEarth | 2273 | 82,765 |
| HackerRank | 903 | 43,867 |
| Kattis | 1209 | 49,699 |
| LeetCode | 775 | 50,346 |
| Total | 30,092 | 1,174,475 |
## Data Fields
|Field|Type|Description|
|:---|:---|:---|
|id|string|A unique id for each data instance|
|question_id|string|A unique id for each question|
|question|string|The input competitive programming question. We leave it blank. Check the how-to-use-it section to get them.|
|r1_generation|string|R1's response.|
|qwq_critique|string|QwQ's response.|
|solution|string|Only the code portion of R1's response.|
|judgement|string|Only the judgement (right/wrong) from QwQ's response.|
|pass_rate|float|Value in range [0, 1] or -1 (not enough unit tests or execution system couldn't validate).|
|dataset|string|The name of the dataset from which this question is collected from (e.g., "apps", "taco", "code_contests")|
|license|string|The license associated with the dataset (e.g., "mit", "apache-2.0", "cc-by-4.0")|
|split|string|The name of the split of the dataset from which this question is collected from (e.g., "train", "valid", "test")|
|source|string|The name of the competitive programming platform (e.g., CodeForces, CodeChef)|
|difficulty|string|A difficulty label for the input question.|
|index|string|An index to retrieve the input question from APPS/TACO dataset (only available for train-extra split).|
## How to use it
```
from tqdm import tqdm
from datasets import load_dataset
hf_datasets = {
"taco": load_dataset("BAAI/TACO", trust_remote_code=True),
"apps": load_dataset("codeparrot/apps", trust_remote_code=True),
"code_contests": load_dataset("deepmind/code_contests"),
"open-r1/codeforces": load_dataset("open-r1/codeforces")
}
def get_question(ds_name, split, index):
benchmark = hf_datasets[ds_name][split][int(index)]
if ds_name == "code_contests":
if not benchmark["description"]:
return None
return benchmark["description"]
elif ds_name in ["taco", "apps"]:
return benchmark["question"]
elif ds_name == "open-r1/codeforces":
if not benchmark["description"]:
return None
question = benchmark["description"]
if benchmark["input_format"]:
question += "\n\nInput\n\n" + benchmark["input_format"]
if benchmark["output_format"]:
question += "\n\nOutput\n\n" + benchmark["output_format"]
if benchmark["examples"]:
question += "\n\nExamples"
for example in benchmark["examples"]:
if "input" in example:
question += "\n\nInput\n\n" + example["input"]
if "output" in example:
question += "\n\nOutput\n\n" + example["output"]
if benchmark["note"]:
question += "\n\nNote\n\n" + benchmark["note"]
return question
return None
ocr2_dataset = load_dataset("nvidia/OpenCodeReasoning-2")
for ocr2_ds in [ocr2_dataset["python"], ocr2_dataset["cpp"]]:
for ocr2_ds_item in tqdm(ocr2_ds):
assert ocr2_ds_item["dataset"] in ["taco", "apps", "code_contests", "open-r1/codeforces"]
ds_name, ds_split, ds_index = ocr2_ds_item["dataset"], ocr2_ds_item["split"], int(ocr2_ds_item["index"])
question = get_question(ds_name, ds_split, ds_index)
assert question is not None
assert ocr2_ds_item["question"] == "-"
ocr2_ds_item["question"] = question
```
## Dataset Owner(s)
NVIDIA Corporation
## Dataset Creation Date
March 2025 - May 2025
## License/Terms of Use
GOVERNING TERMS: GOVERNING TERMS: This dataset is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0) available at https://creativecommons.org/licenses/by/4.0/legalcode.
NOTICE FOR SCRIPTS: You may run the scripts below to pull datasets from their original source. The underlying datasets are available from the original sources subject to their own license terms.
**Data Developer:** NVIDIA
### Use Case: <br>
Developers training Large Language Models (LLMs) to specialize LLMs in code generation and code critique. <br>
### Release Date: <br>
05/15/2025 <br>
## Data Version
1.0 (05/15/2025)
## Dataset Characterization
** Data Collection Method<br>
* [Hybrid: Automated, Synthetic] <br>
** Labeling Method<be>
* [Hybrid: Automated, Synthetic] <br>
## Intended Usage
The OpenCodeReasoning-2 Dataset is intended to be used by the community to continue to improve open models. The data may be freely used to train models. **However, for
each dataset a user elects to use, the user is responsible for checking if the dataset license is fit for the intended purpose**.
## Ethical Considerations:
NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
</details>