NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

NL2Repo-Bench: Towards Long-Horizon Repository Generation Evaluation of Coding Agents

Jingzhe Ding, Shengda Long, Changxin Pu, Ge Zhang, zhou huan, Hongwan Gao, Xiang Gao, Chao He, Yue Hou, Fei Hu, Zhaojian Li, Weiran Shi, Zaiyuan Wang, Daoguang Zan, Chenchen Zhang, Xiaoxu Zhang, Chen Qizhi, Xianfu Cheng, Bo Deng, Qingshui Gu, Kai Hua, Juntao Lin, Pai Liu, Mingchen Li, Minghao Li, Xuanguang Pan, Zifan Peng, Yujia Qin, Yong Shan, Zhewen Tan, Haoran Wang, Zihan Wang, Weihao Xie, Yishuo Yuan, Jiayu Zhang, Yunfei Zhao, He Zhu, Liya Zhu, Chenyang Zou, Ming Ding, Jianpeng Jiao, Jiaheng Liu, Minghao Liu, Qian Liu, Chongyang Tao, Jian Yang, Tong Yang, Zhaoxiang Zhang, Xinjie Chen, Wenhao Huang

While large language models (LLMs) have demonstrated remarkable proficiency in function-level code generation (e.g., HumanEval) and localized bug fixing (e.g., SWE-bench), a massive gap remains between writing a sort() function and architecting a multi-file software repository. Current benchmarks often provide heavy scaffolding—such as predefined file structures or function signatures—that act as strong hints.

To address this "long-horizon reasoning gap," researchers have introduced NL2Repo-Bench, a benchmark designed to test whether an AI agent can act as a true software engineer. The challenge is steep: starting from an empty folder and a single requirements document, can an agent maintain global coherence, manage complex dependencies, and execute a plan over hundreds of interaction steps to build a fully installable Python library?

NL2Repo-Bench: A Rigorous, Execution-Based Testbed

NL2Repo-Bench formalizes the repository generation task by removing the hand-holding typical of earlier benchmarks.

  1. The Input: Agents are provided with an empty workspace and a single, comprehensive natural-language specification (averaging 19,000 tokens). To ensure these requirements are exhaustive, the researchers reverse-engineered 104 real-world Python projects using an AST-assisted annotation workflow, guaranteeing the text covers every class and function signature exercised by the tests.
  2. The Process: The agent must autonomously design the architecture, manage third-party dependencies, implement multiple files, and package the library.
  3. The Evaluation: Moving away from LLM-as-a-judge grading, NL2Repo-Bench is strictly execution-based. The generated repository is placed in a standardized Docker container and run against the original project's real-world pytest suite to ensure an "apples-to-apples" comparison.

The dataset spans 104 tasks across 9 diverse categories (including Web Development, Machine Learning, and System Tools) and is divided into Easy, Medium, and Hard difficulty levels based on lines of code (LOC) and project complexity.

Key Results: A 40% Ceiling

The results from NL2Repo-Bench serve as a wake-up call for the current state of autonomous software development. Even the most advanced models struggle significantly with this long-horizon task.

  • The Performance Ceiling: The strongest model evaluated, Claude-Sonnet-4.5, achieved an average test pass rate of only 40.2%.
  • Rare Full Success: Across the 104 tasks, the best model fully passed the test suite for only 5 repositories in a single run.
  • Complexity Decay: Performance suffers a sharp, monotonic decline as tasks scale. On "Hard" tasks (>4,000 LOC), the best pass rate plummeted to approximately 25%.
  • Model Ecosystems: Closed-source models (like the Claude series) significantly outperformed open-source alternatives (such as DeepSeek-V3.2 and Qwen3), though the gap is narrowing in raw code generation capabilities.

Insights and Agentic Bottlenecks

Beyond raw scores, the evaluation revealed several fascinating behavioral quirks and bottlenecks in state-of-the-art models:

  • The "Thinking" Paradox: Models equipped with explicit internal reasoning (like Qwen3-Thinking) frequently suffer from "hallucinated verification." They reason themselves into believing the task is complete and terminate early, even when the codebase is broken or incomplete.
  • The Human-in-the-Loop Bias: Models like GPT-5 exhibited a high "Non-Finish" rate because they frequently paused to wait for user confirmation. While this behavior is likely baked in during RLHF for safety and collaboration, it is highly detrimental to fully autonomous execution.
  • Context is Necessary, Not Sufficient: While massive 1M+ token context windows (seen in Claude and Gemini) are essential for holding project history, they do not guarantee success. "Agentic persistence" and reasoning robustness remain the true bottlenecks.
  • The Power of Planning: There is a high correlation (0.711) between final performance and the use of explicit planning tools, such as a task_tracker. Agents that attempt to "wing it" almost universally fail as project complexity grows.

Failure Modes and the Path Forward

The researchers identified three primary failure modes that define the current frontier of AI coding agents:

  1. Brittle Dependencies: Agents frequently struggle with ImportError or ModuleNotFoundError, failing to correctly structure Python packages (e.g., forgetting __init__.py files).
  2. Premature Termination: Driven by overconfidence or hallucinated verification, agents often stop working before the repository is fully functional.
  3. Blind Editing: Agents commonly make multiple cross-file changes without running the test suite to verify intermediate steps, leading to compounding errors.

Future Directions: Progress in long-horizon repository generation will require more than just larger context windows or more interaction turns. The "quality" of the agentic workflow must evolve. Future research must focus on developing better self-verification loops and mechanisms that enforce global architectural consistency over extended development trajectories. Until then, NL2Repo-Bench stands as a rigorous benchmark for the next generation of autonomous coding agents.

Summary updated

BibTeX
@inproceedings{ding2026nl,
  author = {Jingzhe Ding and Shengda Long and Changxin PU and Ge Zhang and zhou huan and Hongwan Gao and Xiang Gao and Chao He and Yue Hou and FEI HU and Zhaojian Li and Weiran Shi and Zaiyuan Wang and Daoguang Zan and Chenchen Zhang and Xiaoxu Zhang and Chen Qizhi and Xianfu Cheng and Bo Deng and Qingshui Gu and Kai Hua and Juntao Lin and Pai Liu and Mingchen Li and Minghao Li and Xuanguang Pan and Zifan Peng and Yujia Qin and Yong Shan and Zhewen Tan and Haoran Wang and Zihan Wang and Weihao Xie and Yishuo Yuan and Jiayu Zhang and Yunfei Zhao and He Zhu and LIYA ZHU and Chenyang Zou and Ming Ding and Jianpeng Jiao and Jiaheng Liu and Minghao Liu and Qian Liu and Chongyang Tao and Jian Yang and Tong Yang and Zhaoxiang Zhang and Xinjie Chen and Wenhao Huang},
  title = {{NL2Repo-Bench: Towards Long-Horizon Repository Generation Evaluation of Coding Agents}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=wqQam1muOQ},
}
Figure