Secure or Suspect? Investigating Package Hallucinations of Shell Command in Original and Quantized LLMs
Md Nazmul Haque, Elizabeth Lin, Lawrence Arkoh, Biruk Tadesse, Bowen Xu

TL;DR
This study systematically examines how quantization of large language models affects their tendency to hallucinate package dependencies and introduce security vulnerabilities in generated code, especially in resource-constrained environments.
Contribution
It provides the first empirical analysis of the impact of quantization on package hallucination and security risks in LLM-generated software dependencies.
Findings
Quantization increases package hallucination rates, especially at 4-bit precision.
Lower-precision models show higher vulnerability presence rates in generated packages.
Hallucinated packages often resemble realistic URLs and repository paths.
Abstract
Large Language Models for code (LLMs4Code) are increasingly used to generate software artifacts, including library and package recommendations in languages such as Go. However, recent evidence shows that LLMs frequently hallucinate package names or generate dependencies containing known security vulnerabilities, posing significant risks to developers and downstream software supply chains. At the same time, quantization has become a widely adopted technique to reduce inference cost and enable deployment of LLMs on resource-constrained environments. Despite its popularity, little is known about how quantization affects the correctness and security of LLM-generated software dependencies while generating shell commands for package installation. In this work, we conduct the first systematic empirical study of the impact of quantization on package hallucination and vulnerability risks in…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Security and Verification in Computing · Advanced Malware Detection Techniques
