|
Download README.zh-CN.md from Tokenwave-AI/NL2Repo-Pro: direct link, hf CLI and curl.
- Browser
- Download file 8.9 kB
-
https://huggingface.co/datasets/Tokenwave-AI/NL2Repo-Pro/resolve/main/README.zh-CN.md
- Command line
-
hf download hf://datasets/Tokenwave-AI/NL2Repo-Pro/README.zh-CN.md
-
curl -L -o README.zh-CN.md https://huggingface.co/datasets/Tokenwave-AI/NL2Repo-Pro/resolve/main/README.zh-CN.md
8.9 kB
| <p align="right"><a href="https://huggingface.co/datasets/Tokenwave-AI/NL2Repo-Pro">English</a> · <b>中文</b></p> | |
| <p align="center"> | |
| <picture> | |
| <source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/Tokenwave-AI/NL2Repo-Pro/resolve/main/assets/brand/tokenwave-dark.png"> | |
| <img src="https://huggingface.co/datasets/Tokenwave-AI/NL2Repo-Pro/resolve/main/assets/brand/tokenwave.png" alt="TokenWave" width="185" style="display: inline-block; margin: 0; border: 0; border-radius: 0; background: none;"> | |
| </picture> | |
| </p> | |
| # NL2Repo-Pro | |
| <p align="center"> | |
| <picture style="display: inline; margin: 0;"><img src="https://huggingface.co/datasets/Tokenwave-AI/NL2Repo-Pro/resolve/main/assets/icons/tokenwave.png" alt="" width="16" style="display: inline-block; vertical-align: middle; margin: 0; border: 0; border-radius: 0; background: none;"></picture> <a href="https://tokenwave-ai.github.io/NL2Repo-Pro/">博客</a> · | |
| <picture style="display: inline; margin: 0;"><img src="https://huggingface.co/datasets/Tokenwave-AI/NL2Repo-Pro/resolve/main/assets/icons/arxiv.png" alt="" width="16" style="display: inline-block; vertical-align: middle; margin: 0; border: 0; border-radius: 0; background: none;"></picture> <a href="https://arxiv.org/abs/2611.38050">论文</a> · | |
| <a href="https://github.com/TokenWave-AI/NL2Repo-Pro"><picture style="display: inline; margin: 0;"><source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/Tokenwave-AI/NL2Repo-Pro/resolve/main/assets/icons/github-dark.png"><img src="https://huggingface.co/datasets/Tokenwave-AI/NL2Repo-Pro/resolve/main/assets/icons/github.png" alt="" width="16" style="display: inline-block; vertical-align: middle; margin: 0; border: 0; border-radius: 0; background: none;"></picture> 代码</a> · | |
| <a href="https://huggingface.co/datasets/Tokenwave-AI/NL2Repo-Pro">English</a> | |
| </p> | |
| NL2Repo-Pro 是一个面向编程 agent 的基准:根据自然语言规格,从零写出一个完整的库。150 道题都来自固定 commit 的真实仓库。agent 拿到一份总览文档,以及每个 feature 一份规格,按依赖关系排序,据此写出实现。仓库原有的测试不对 agent 开放,用来逐个 feature 给结果评分。 | |
| | | Python | Go | Rust | Java | JavaScript | 合计 | | |
| |---|--:|--:|--:|--:|--:|--:| | |
| | 题数 | 70 | 20 | 20 | 20 | 20 | 150 | | |
| 每道题都是标准的 [Harbor](https://github.com/laude-institute/harbor) 题目目录,用 `harbor run` 运行。 | |
| ## 结果 | |
| 平均 reward,全部 150 道题,每道题作答一次。 | |
| | 模型 | Agent harness | 全部 | Python | Go | Rust | Java | JavaScript | | |
| |---|---|--:|--:|--:|--:|--:|--:| | |
| | claude-opus-5-5 | Claude Code 2.1.311,推理强度 xhigh | 0.617 | 0.589 | 0.576 | 0.592 | 0.610 | 0.786 | | |
| | gpt-6.1-sol | Codex CLI 0.164.0,推理强度 xhigh | 0.471 | 0.396 | 0.497 | 0.499 | 0.432 | 0.717 | | |
| | deepseek-v4.1-flash | Claude Code 2.1.311,推理强度 xhigh | 0.377 | 0.315 | 0.434 | 0.350 | 0.329 | 0.615 | | |
| | grok-4.7 | Claude Code 2.1.311,推理强度 xhigh | 0.225 | 0.155 | 0.251 | 0.185 | 0.233 | 0.474 | | |
| 所有运行都使用下文的题目设置,并关闭了网页搜索和网页抓取。每一份作答都检查过有没有 reward hacking。 | |
| ## 内容 | |
| ``` | |
| README.md | |
| README.zh-CN.md 本卡片的中文版 | |
| assets/ 本卡片用到的 logo 和图标 | |
| LICENSE Apache-2.0,适用于我们编写的部分(见许可) | |
| SHA256SUMS 下面每个文件的 sha256 | |
| tasks/<lang>/<instance_id>.tar.zst 题目目录(150 道共 4.3 GB) | |
| images/<lang>/<instance_id>.tar 该题的两个 Docker 镜像(150 道共 83 GB,最大的 4.7 GB) | |
| ``` | |
| `<lang>` 是 `python`、`go`、`rust`、`java` 或 `javascript`,`<instance_id>` 的格式是 `<owner>__<repo>__<commit prefix>`。一个题目目录包含: | |
| ``` | |
| <instance_id>/ | |
| ├── task.toml 镜像、资源、限制、来源仓库和许可证 | |
| ├── instruction.md 总览文档 | |
| ├── environment/ 空目录(Harbor 需要它,请保持为空) | |
| ├── image_build/ agent 镜像的构建方式,docs/ 是 agent 在 /docs 看到的内容 | |
| ├── solution/ 参考答案(原始源码) | |
| └── tests/ 评分脚本、计分表和原始测试 | |
| ``` | |
| ## 快速开始 | |
| 需要 Docker、Python 3.12 和 Harbor 0.23.0(`pip install harbor==0.23.0`),这是我们运行时使用的版本。 | |
| ```bash | |
| # 1. 下载一道题(不写文件名则下载全部) | |
| hf download Tokenwave-AI/NL2Repo-Pro SHA256SUMS tasks/python/<instance_id>.tar.zst images/python/<instance_id>.tar \ | |
| --repo-type dataset --revision v1.0 --local-dir NL2Repo-Pro | |
| cd NL2Repo-Pro | |
| sha256sum -c SHA256SUMS --ignore-missing | |
| # 2. 解压题目并加载它的镜像 | |
| mkdir -p run && tar -I zstd -xf tasks/python/<instance_id>.tar.zst -C run | |
| docker load -i images/python/<instance_id>.tar | |
| # 3. 检查题目:参考答案得 1.0,空答案得 0 | |
| harbor run -p run/<instance_id> -a oracle -y -o jobs | |
| harbor run -p run/<instance_id> -a nop -y -o jobs | |
| ``` | |
| 镜像没有发布到任何镜像仓库:`docker load` 会给它们加上 `task.toml` 里使用的本地名称,用这些名称 `docker pull` 会失败。请保持镜像名称和 `task.toml` 不变,改过名的镜像或编辑过的 `task.toml` 就不再是这里计分的那道题。 | |
| ### 运行 agent | |
| ```bash | |
| # 与我们的运行相同,使用 Claude Code。M:模型(Opus 5.5 为 'claude-opus-5-5[1m]');W:它的上下文窗口,单位是 token | |
| harbor run -p run/<instance_id> -a claude-code -m "$M" \ | |
| --ak version=2.1.311 --ak reasoning_effort=xhigh --ak disallowed_tools=WebSearch,WebFetch \ | |
| --ae ANTHROPIC_API_KEY=<key> --ae ANTHROPIC_BASE_URL=https://<endpoint host> \ | |
| --ae CLAUDE_CODE_MAX_CONTEXT_TOKENS=$W --ae CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS=0 \ | |
| --ae ANTHROPIC_DEFAULT_FABLE_MODEL="$M" --ae ANTHROPIC_SMALL_FAST_MODEL="$M" \ | |
| --allow-agent-host <endpoint host> \ | |
| --agent-setup-timeout-multiplier 10 -n 1 -y -o jobs | |
| ``` | |
| `-p run` 会运行所有已解压的题目,`-n` 设置同时运行的数量。一次运行的分数是 `jobs/<job>/<trial>/verifier/reward.json` 里的 `reward`。 | |
| - agent 作答期间没有网络,`--allow-agent-host` 只放行它的模型 endpoint。 | |
| - 有些模型网关会在服务端执行 Claude Code 的 WebSearch 等工具,绕过容器的网络规则。我们的运行关闭了 WebSearch 和 WebFetch,要得到可比的结果也请这样做。 | |
| - 对于不认识的模型,Claude Code 默认上下文窗口是 200K,`CLAUDE_CODE_MAX_CONTEXT_TOKENS` 用来给出真实值(模型名带 `[1m]` 时不需要)。等待上限的设置让后台 subagent 在运行结束前完成。设置了 base URL 时,Harbor 会把 opus、sonnet、haiku 和 subagent 的别名都指向 `-m`,其余的由两个 `--ae` 模型变量覆盖。测试非 Claude 模型时,加上 `--ae CLAUDE_CODE_NO_MODEL_FALLBACK=1`,避免由 Claude 模型代替它作答。 | |
| ## 运行环境 | |
| | | 作答(agent) | 评分(verifier) | | |
| |---|---|---| | |
| | CPU / 内存 / 磁盘 | 4 核 / 32 GB / 64 GB | 4 核 / 32 GB / 64 GB | | |
| | 时间限制 | 10 小时 | 6.5 小时(测试在 6 小时时停止,未运行到的测试按失败计) | | |
| | 网络 | 无(仅模型 endpoint) | 公网 | | |
| 少数题目评分时内存接近 32 GB 的上限。 | |
| ## 评分 | |
| 每道题的文档把库划分为若干 feature。一个测试计入它直接调用的每个 feature,一个 feature 的所有计分测试都通过,它才算被接受。reward 是被接受的 feature 所占的比例,取值 0 到 1。 | |
| ## 许可 | |
| 我们编写的部分采用 Apache-2.0(`LICENSE`)。每道题的源码和文字沿用来源仓库的许可证,写在 `task.toml` 里。有三道题限制商业使用(mmr、Draftpaper_loop、drusniel-gods-end),另有六道题来自没有许可证的仓库(cg、Zetta-Embodiment、scansci-harness、Chunklate、benson.github.io、lire-compter-samuser),仅供评测使用,权利人要求时会移除。 | |
| ## 移除请求 | |
| 如果你是某个来源仓库的作者,希望修改或移除对应的题目,请发邮件到 heli.qi@akane.waseda.jp,或者在本数据集下发起讨论(discussion)。 | |
| ## 引用 | |
| 如果用到了 NL2Repo-Pro,请引用论文: | |
| ```bibtex | |
| @article{qi2026nl2repopro, | |
| title = {NL2Repo-Pro: Benchmarking Multilingual Production-Scale Library Development Feature by Feature}, | |
| author = {Qi, Heli and Liu, Minghao and Liu, Jiarui and Ding, Jingzhe and Zeng, Qingcheng and Zhang, Weijia and Xiao, Yunze and Wu, Yuchen and Zhao, Bing and Huang, Jen-Tse and Huang, Stephen and Jin, Zhijing and Cheung, Eli and Diab, Mona and Xuan, Weihao}, | |
| journal = {arXiv preprint arXiv:2611.38050}, | |
| year = {2026} | |
| } | |
| ``` | |