nemotron-gym-competitive-coding
收藏数据集概述
数据集名称:laion/nemotron-gym-competitive-coding
许可证:CC-BY-4.0
任务类别:强化学习(reinforcement-learning)
语言:英语(en)
数据集规模:10K < n < 100K 条样本
标签:harbor、nemotron-gym、rl、verifiable-rewards
数据来源与转换
- 该数据集是 nvidia/Nemotron-RL-coding-competitive_coding 的 Harbor 格式转换版本。
- 转换工具来源于 OpenThoughts-Agent 项目中的
data/nemotron_gym适配器。 - 转换过程采用 安全构建 方式:
- 数据内容不会插入到 shell、Python 或 Dockerfile 源代码中,所有值通过
tests/verifier_data.json(JSON 格式,运行时解析)传递。 - 基础镜像使用固定名称的
python:3.11-slim-bookworm;pip 依赖项经过严格的正则表达式白名单验证。 - 文本字段经过 C0/C1 控制字符剥离、长度截断、tarball 路径验证(防止路径遍历、空字节、绝对路径攻击)。
- tarball 文件具有确定性(排序条目、
mtime=0、uid/gid=0),确保字节可复现。
- 数据内容不会插入到 shell、Python 或 Dockerfile 源代码中,所有值通过
数据列说明
| 列名 | 类型 | 描述 |
|---|---|---|
path |
string | 确定性短 ID,格式为 <family>-<sha256[:12]>.tar.gz |
task_binary |
binary | 包含完整 Harbor 任务的 gzip 压缩 tar 包 |
Harbor 任务布局
每个 task_binary 解压后的目录结构如下:
instruction.md # 提供给智能体的提示信息 environment/Dockerfile # python:3.11-slim-bookworm 基础镜像 + 任务特定 pip 依赖 tests/test.sh # 验证器入口(写入 /logs/verifier/reward.txt) tests/verifier.py # 验证器实现(内嵌、确定性) tests/verifier_data.json # 每个任务的验证器输入(JSON 格式,无代码插值) metadata.json # 来源信息:source_dataset、row_index、family 等 task.toml # 标准 Harbor 任务配置(CPU/内存/超时默认值)
验证器类型
stdio_diff:运行 /app/solution.py,针对隐藏的 stdin/stdout 测试用例进行对比验证。
使用示例
加载数据集: python from datasets import load_dataset
ds = load_dataset("laion/nemotron-gym-competitive-coding", split="train") print(ds[0]["path"], len(ds[0]["task_binary"]))
运行单个任务(使用 Harbor): bash python - <<PY import gzip, io, tarfile from datasets import load_dataset ds = load_dataset("laion/nemotron-gym-competitive-coding", split="train") row = ds[0] with tarfile.open(fileobj=io.BytesIO(row["task_binary"]), mode="r:gz") as tar: tar.extractall("/tmp/competitive-coding-task") PY harbor run -t /tmp/competitive-coding-task -e daytona # 或 -e docker
来源
该数据集是 nvidia/Nemotron-RL-coding-competitive_coding 的衍生作品,属于 NVIDIA 的 NeMo-Gym 集合。




