Metraipolis › archive › dc_981e0ad0fd1b
Understanding and Mitigating Library-Related Issues in LLM-Generated Code — arXiv:2610.00622
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2610.00622
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-06T15:16:51.792Z
- SHA-256 of the archived text
69f58d609fd940f08319b08f33c8305b6d6e88e00d407da6b58aefec3519ab0b- Stable URL of this page
https://metraipolis.com/documento/dc_981e0ad0fd1b
How to cite
Understanding and Mitigating Library-Related Issues in LLM-Generated Code — arXiv:2610.00622 — arXiv (en), https://arxiv.org/abs/2610.00622 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_981e0ad0fd1b (Metraipolis archive dc_981e0ad0fd1b, sha256 69f58d609fd940f08319b08f33c8305b6d6e88e00d407da6b58aefec3519ab0b)
BibTeX
@misc{dc981e0ad0fd1b,
title = {Understanding and Mitigating Library-Related Issues in LLM-Generated Code — arXiv:2610.00622},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2610.00622},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_981e0ad0fd1b; sha256 69f58d609fd940f08319b08f33c8305b6d6e88e00d407da6b58aefec3519ab0b},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2610.00622. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Software practitioners increasingly rely on Large Language Models (LLMs) to generate code that integrates external libraries. However, LLMs often produce incorrect library usage, such as invalid imports, outdated API calls, and hallucinated dependencies, leading to compilation or runtime failures that reduce the reliability of AI-assisted software development. In this paper, we propose an agentic approach to mitigate libraryrelated errors in LLM-generated code. More specifically, we first conduct an exploratory study to characterize the library-related issues produced by LLMs. Our analysis of 100 LLM-generated code files reveals that 84% of generated files contain at least one library-related error, with recurring patterns including incorrect import paths, missing imports, hallucinated libraries, deprecated library usage, and unused imports. Based on these findings, we design an agentic approach that integrates task analysis, documentation grounding, code generation, and automated validation to improve library usage during code synthesis. We evaluate our approach on 300 code generation tasks derived from realworld implementations of rapidly evolving Python frameworks, including LangChain and AutoGen, across five LLMs: GPT-5, DeepSeek-V3, Qwen3, Mistral, and Llama 3. The results show that our approach consistently improves code generation quality across all evaluated models, reducing library-related errors by 38.1% - 54.6% and increasing code correctness by up to 16%. Tema degli esploratori: calcolo e infrastrutture (retro-catalogo arXiv: annunci del 2026-10-02 in cs.SE). Categorie arXiv: Software Engineering (cs.SE). Pagina del lavoro: https://arxiv.org/abs/2610.00622 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-10-06T15:11:52.277Z dalla pagina https://arxiv.org/catchup/cs.SE/2026-10-02?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).