DI-BENCH: Benchmarking Large Language Models on Dependency Inference with Testable Repositories at Scale

Linghao Zhang, Junhao Wang, Shilin He, Chaoyun Zhang, Yu Kang, Bowen Li, Jiaheng Wen, Chengxing Xie, Maoquan Wang, Yufan Huang, Elsie Nallipogu, Qingwei Lin, Yingnong Dang, Saravan Rajmohan, Dongmei Zhang, Qi Zhang

Large Language Models (LLMs) have demonstrated remarkable proficiency in generating code snippets and even entire functions. However, a significant "execution gap" remains: while an AI might write logic correctly, it often fails to configure the environment necessary to run that code. DI-BENCH is a new, large-scale benchmark designed to evaluate LLMs on Dependency Inference—the ability to identify and specify the external libraries and internal module mappings required for a software repository to function.

The Dependency Inference Problem

As AI moves toward generating full-scale software projects, the "glue" that holds a project together—configuration files like pyproject.toml, package.json, or Cargo.toml—becomes critical. Research indicates that over 50% of runtime errors in LLM-generated repositories are caused by missing or incorrectly specified dependencies.

The execution gap: even with correct logic, a version mismatch in dependencies can lead to runtime failure.

The challenge isn't just naming the right packages; it's identifying the correct versions. A model might suggest scikit-learn>=1.2.2, but if the code uses a feature deprecated in that version (like SCORERS in sklearn.metrics), the program will crash. DI-BENCH addresses this by moving beyond simple text-matching metrics to execution-based validation.

Methodology: Automated Execution Validation

The authors treat dependency inference as a "mask-and-fill" task. They take real-world repositories, remove the dependency sections from their configuration files, and task an LLM with regenerating them based on the source code.

The DI-BENCH pipeline: from repository crawling to automated execution validation using CI runners.

The core innovation is the Dual-Use CI Infrastructure. Instead of relying on string similarity, the benchmark uses GitHub Actions and local containerization (via act) to run the repository’s actual test suite. If the tests pass with the LLM-inferred dependencies, the model is considered successful. This ensures that the evaluation captures the functional correctness of the environment configuration.

The DI-BENCH Dataset

The benchmark consists of 581 verified, real-world repositories across four major languages: Python, C#, Rust, and JavaScript. The curation process is fully automated, ensuring each repository has a working, testable Continuous Integration (CI) setup. The dataset is split into "Regular" repositories (fitting within a 128k token context window) and "Large" repositories that require more advanced processing strategies.

Key Insights and Results

The study reveals several critical bottlenecks in current AI capabilities:

  • Low Execution Success: Even the best-performing model, DeepSeek V3, achieved only a 48% execution pass rate on Python repositories. Claude 3.5 Sonnet and GPT-4o followed closely, but all models showed a significant drop in performance as the number of dependencies increased.
  • The Compiled Language Penalty: LLMs struggle significantly more with Rust and C# than with Python or JavaScript. This is attributed to the stricter versioning requirements and more complex build systems (e.g., Cargo, NuGet) inherent in compiled languages.
  • Versioning is the Bottleneck: Identifying that a package is used is relatively easy; identifying the correct version is where models fail. When provided with "Oracle" (perfect) version numbers, model success rates improved dramatically—by as much as 246% in Rust.
  • Human Superiority: In a controlled experiment, human developers achieved a 77.5% success rate, far outstripping the best LLM's 47.5%. Humans benefit from the ability to iteratively debug and consult external documentation, a capability most current LLM workflows lack.

Conclusion

DI-BENCH highlights that writing code is only half the battle. For AI to truly automate software engineering, it must master the complex web of dependencies that allow code to execute. The authors suggest that moving toward "agentic" workflows—where LLMs can iteratively run code, interpret error messages, and search for documentation—is the necessary next step to bridge the execution gap.

Summary updated

BibTeX
@inproceedings{zhang2025di,
  author = {Linghao Zhang and Junhao Wang and Shilin He and Chaoyun Zhang and Yu Kang and Bowen Li and Jiaheng Wen and Chengxing Xie and Maoquan Wang and Yufan Huang and Elsie Nallipogu and Qingwei Lin and Yingnong Dang and Saravan Rajmohan and Dongmei Zhang and Qi Zhang},
  title = {{DI-BENCH: Benchmarking Large Language Models on Dependency Inference with Testable Repositories at Scale}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure