Delulu:一种经过验证的多语言基准,用于检测填充中间任务中的代码幻觉
Delulu: A Verified Multi-Lingual Benchmark for Code Hallucination Detection in Fill-in-the-Middle Tasks
AI总结:
Delulu是一个包含1951个跨7种语言和4种幻觉类型的填充中间任务样本的多语言基准,通过对抗性流程筛选出经过验证的样本,评估了11种开放式FIM模型,证明了任务内在难度而非模型家族特定。
摘要:
大型语言模型在代码生成中经常在填充中间(FIM)任务中产生幻觉—— plausible但错误的完成,如虚构的API方法、无效参数、未定义变量或不存在的导入。这些失败表面上通过审查,但会引入运行时错误。我们介绍了Delulu,一个经过验证的多语言基准,包含1951个FIM样本,覆盖7种语言和4种幻觉类型。样本通过对抗性流程筛选:前沿LLM生成 plausible幻觉,四个多样化的评估模型评估它们,基于嵌入的聚类挖掘更难的例子,自包含的Docker容器验证黄金完成编译,而幻觉变体产生预期的运行时错误,最后由人类专家审查去除任何剩余的偏见或明显可决定的样本。我们评估了11种开放式FIM模型,来自五个家族,覆盖0.5B-32B参数:六点Qwen2.5-Coder扩展系列,加上跨家族系列(CodeLlama,DeepSeek-Coder-V2,StarCoder2)。最强的模型仅达到84.5%的pass@1,没有家族超过0.77的编辑相似度,且每个家族在非平凡的样本份额上产生幻觉对齐的完成,证实了Delulu暴露的难度是任务内在而非家族特定。我们发布基准、容器和评估框架在https://github.com/microsoft/delulu。
英文摘要:
Large Language Models for code generation frequently produce hallucinations in Fill-in-the-Middle (FIM) tasks -- plausible but incorrect completions such as invented API methods, invalid parameters, undefined variables, or non-existent imports. These failures pass superficial review yet introduce runtime errors. We introduce Delulu, a verified multi-lingual benchmark of 1,951 FIM samples across 7 languages and 4 hallucination types. Samples are curated through an adversarial pipeline: a frontier LLM generates plausible hallucinations, four diverse judge models evaluate them, embedding-based clustering mines progressively harder examples, self-contained Docker containers verify that golden completions compile while hallucinated variants produce the expected runtime error, and a final human-expert review removes any remaining biased or trivially decidable samples. We evaluate 11 open-weight FIM models from five families spanning 0.5B-32B parameters: a six-point Qwen2.5-Coder scaling slate, plus a cross-family slate (CodeLlama, DeepSeek-Coder-V2, StarCoder2). The strongest model reaches only 84.5% pass@1, no family exceeds 0.77 Edit Similarity, and every family produces hallucination-aligned completions on a non-trivial share of samples, confirming that the difficulty exposed by Delulu is task-intrinsic rather than family-specific. We release the benchmark, containers, and evaluation framework at https://github.com/microsoft/delulu.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。