AI RESEARCH
Library Hallucinations in LLM-Generated Code: A Risk Analysis Grounded in Developer Queries
arXiv CS.CL
•
ArXi:2509.22202v3 Announce Type: replace-cross Large language models (LLMs) now play a central role in code generation, yet they continue to hallucinate, frequently inventing non-existent libraries. Such library hallucinations are not just benign errors: they can mislead developers, break builds, and expose systems to supply chain threats such as slopsquatting. Despite growing awareness of these risks, there is limited understanding of how library hallucinations manifest under realistic usage conditions.