# Stdlib or Third-Party? Empirical Performance and Correctness of LLM-Assisted Zero-Dependency Python Libraries

arXiv: https://arxiv.org/abs/2605.21405 · HTML: https://mlsanity.com/paper/2605.21405/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 8 of its 11 references that are in the map.
- First posted on arXiv 20 May 2026.

## Builds on (most cited first, 8 of 8)

- [We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs](https://mlsanity.com/paper/2406.10279/) (2024)
- [Commit0: Library Generation from Scratch](https://mlsanity.com/paper/2412.01769/) (2024)
- [LLMs Meet Library Evolution: Evaluating Deprecated API Usage in LLM-based Code Completion](https://mlsanity.com/paper/2406.09834/) (2024)
- [RepoZero: Can LLMs Generate a Code Repository from Scratch?](https://mlsanity.com/paper/2605.07122/) (2026)
- [Beyond Dependencies: The Role of Copy-Based Reuse in Open Source Software Development](https://mlsanity.com/paper/2409.04830/) (2024)
- [An Empirical Study of Vulnerable Package Dependencies in LLM Repositories](https://mlsanity.com/paper/2508.21417/) (2025)
- [Machine Learning Systems are Bloated and Vulnerable](https://mlsanity.com/paper/2212.09437/) (2022)
- [How Deep Does Your Dependency Tree Go? An Empirical Study of Dependency Amplification Across 10 Package Ecosystems](https://mlsanity.com/paper/2512.14739/) (2025)

## Abstract (arXiv)

Third-party Python libraries introduce dependency-management overhead, supply-chain risk, and deployment friction. We study when eliminating a dependency preserves enough correctness and performance to justify the gains in footprint, deployability, and trust surface. Our testbed is zerodep, 44 single-file, stdlib-only Python modules spanning 12 categories, each benchmarked against its reference library. Three performance regimes emerge. Stdlib-only implementations achieve parity (within 2x) in the majority of cases; many outperform their references by 5x-115x where architectural overhead dominates; and a clear cliff appears for C-extension-backed computation (image processing, binary serialization, low-level crypto), confirmed by PyPy JIT and profiling experiments. Beyond speed, stdlib modules reduce installed footprint by orders of magnitude (median 31 KB vs. 700 KB), import 2.2x faster, and eliminate 88 transitive dependencies maintained by 128 distinct PyPI accounts. Analysis of the LLM-assisted development process across all 44 modules shows that specification completeness, not model capability, is a strong predictor of generation success, and that contract-linked review reduces review volume by 5x while eliminating compatibility regressions. Together, these results turn dependency elimination from an anecdotal coding style into an evidence-based engineering tradeoff.
