arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.01047cs.CRcs.AIcs.CLcs.LG

LLM Ghostbusters: 通过自适应反学习实现精准幻觉抑制

LLM Ghostbusters: Surgical Package Hallucination Suppression via Adaptive Unlearning

University of Texas San Antonio(德克萨斯大学圣安东尼奥分校);University of California San Diego(加州大学圣地亚哥分校)

Joseph Spracklen, Pedram Aghazadeh, Farinaz Koushanfar, Murtuza Jadliwala

AI总结:

本文提出自适应反学习框架,通过混合token级目标和自适应发现循环,有效抑制LLM幻觉,减少81%的包幻觉率,同时保持编码基准性能,验证其对特定分布的针对性效果。

摘要:

幻觉,即看似合理但事实错误的输出,仍是部署LLM的主要挑战。在代码生成中,模型常虚构不存在的软件包,推荐虚构库的导入和安装命令,造成供应链漏洞:攻击者可抢先在公共注册表中注册此类包,恶意负载随后被开发者或自主代理安装执行,即slopsquatting攻击。一旦模型部署,缓解此故障模式困难:完全再训练成本高,现有方法或导致模型效用严重下降,或依赖预设的遗忘集,假设不适用于无界幻觉空间。为解决此问题,我们提出自适应反学习(AU),一种部署后框架,可精准抑制幻觉同时保持通用模型效用。AU引入混合token级目标,同时强化有效输出并抑制幻觉输出。结合自适应发现循环,持续揭示新幻觉诱导上下文,无需人工监督。AU使模型能泛化到未见提示和幻觉。我们证明,AU将包幻觉率减少81%,对应显著降低slopsquatting攻击面,同时保持标准编码基准性能。分析显示,分布变化集中在包相关生成上,通用编码行为基本不受影响,证实AU效果局限于目标分布。AU完全基于模型生成数据,无需人工标注,且跨领域泛化。

英文摘要:

Hallucinations remain an unsolved problem for LLMs, and package hallucinations are a particularly dangerous instance of this phenomenon. Package hallucinations occur during code generation when a model fabricates non-existent software packages, recommending imports and installation commands for fictional libraries. This creates a critical supply-chain vulnerability; an attacker can proactively register such packages on public registries with malicious payloads that are subsequently installed and executed by developers or autonomous agents. These hallucinations enable a class of package confusion attack known as slopsquatting. To address this issue, we present Adaptive Unlearning (AU), a post-deployment framework that surgically suppresses package hallucinations while preserving general model utility. AU introduces a hybrid token-level objective that simultaneously reinforces valid outputs and suppresses hallucinated ones. Combined with an adaptive discovery loop that continuously surfaces new hallucination-inducing contexts without human supervision, AU enables generalization to unseen prompts and hallucinations. We demonstrate that AU reduces package hallucination rates by 88%, while maintaining performance on standard coding benchmarks. Our analysis shows that distributional changes are concentrated on package-related generations, leaving general coding behavior largely unaffected and confirming that AU's effect is isolated to the targeted distribution. AU relies entirely on model-generated data and requires no human annotation, representing a post-deployment hallucination mitigation framework.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑