Large language models are increasingly used to suggest software dependencies, but they sometimes invent package names that do not exist. Such hallucinations can break builds or lead to supply-chain attacks. A new arXiv preprint introduces PackMonitor, a decoding-time monitoring approach designed to eliminate this problem.

Unlike methods that filter outputs after generation, PackMonitor intervenes while the model is still producing text. It monitors each step of decoding and suppresses or corrects candidate tokens that would form a nonexistent package name. The abstract claims this achieves zero package hallucinations, though the paper is a preprint and has not yet been peer-reviewed.

The authors position PackMonitor as a trustworthiness safeguard for LLM-assisted development workflows. By catching hallucinations at the source, it aims to make dependency recommendation more reliable without requiring changes to the underlying model.