Delulu: A Verified Multi-Lingual Benchmark for Code Hallucination Detection in Fill-in-the-Middle Tasks

Mahdi Erfanian, Nelson Daniel Troncoso, Aashna Garg, Amabel Gale, Xiaoyu Liu +2 more
5/7/2026
4 citations
cs.LGcs.AI
benchmark-dataset

Official code: microsoft/delulu (3 stars, HTML, MIT, last commit 2026-05-12).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

microsoft/deluluOfficial100%
MIT

A VERIFIED MULTI-LINGUAL BENCHMARK FOR CODE HALLUCINATION DETECTION IN FILL-IN- THE-MIDDLE TASKS

33HTML, PythonMar 18, 20266 months agoMIT

Similar Papers

Cite this paper

@article{erfanian2026delulu,
  title  = {Delulu: A Verified Multi-Lingual Benchmark for Code Hallucination Detection in Fill-in-the-Middle Tasks},
  author = {Mahdi Erfanian and Nelson Daniel Troncoso and Aashna Garg and Amabel Gale and Xiaoyu Liu and Pareesa Ameneh Golnari and Shengyu Fu},
  year   = {2026},
  eprint = {2605.07024},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.07024v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.07024.svg)](https://codeofpaper.com/paper/2605.07024)

Discussion