mlsanityData to 14 Oct 2026

Synthetic Hallucinations, Real Gains: Hard Negatives from Frontier Models for FIM Hallucination Mitigation

arXiv 2606.03130 ↗First posted 2 Jun 2026cs.LGcited by 0

Not on the map. Why?

Abstract (arXiv)

Small open-source code models that power IDE autocomplete still emit hallucinated Fill-in-the-Middle (FIM) completions: syntactically natural calls to methods, parameters, variables, and imports that do not exist in the surrounding project. Existing mitigations either require per-language execution sandboxes that do not apply at mid-keystroke or preference-optimisation pipelines that need large human-labelled corpora. We propose an execution-free alternative: use frontier code models to synthesise plausible-but-wrong completions as hard negatives, then leverage the contrast between these synthetic hallucinations and the ground-truth developer edit as a supervised fine-tuning signal. Our pipeline scrapes multilingual FIM contexts from public GitHub across eight languages and asks a panel of three frontier generators to produce one hard negative per context for each of four hallucination types drawn from the Delulu taxonomy, a Docker-verified multilingual FIM hallucination benchmark, yielding a paired chosen/rejected dataset. Fine-tuning Qwen2.5-Coder-7B-Instruct on a 100K-row curated subset lifts Delulu exact match by +18.8 points and edit similarity by +0.22 on every language and every type, while also improving every HumanEval-Infilling split and every SAFIM subset. The same recipe at 3B lifts Delulu by +12.8 EM with a small, characterised general-FIM trade-off. Five-axis ablations (size, type mix, language coverage, base-model family, and a difficulty-aware fool rate) plus a head-to-head SFT vs. DPO/ORPO comparison map which design choices drive the gain. We release the full pipeline source code -- generation, fool-rate LLM judging, curation, and the FIM fine-tuning recipe -- so that the experiments in this paper can be reproduced end-to end on any permissively licensed corpus.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 15 of its 28 references that are in the map. First posted on arXiv 2 Jun 2026.

Builds on

15 of 28 references.

References · 15

  1. 2022Self-Instruct: Aligning Language Models with Self-Generated Instructionscited by 2,724
  2. 2024LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Modelscited by 1,464
  3. 2024A Survey on LLM-as-a-Judgecited by 1,423
  4. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  5. 2024ORPO: Monolithic Preference Optimization without Reference Modelcited by 562
  6. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
  7. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
  8. 2024Replacing Judges with Juries: Evaluating LLM Generations with a Panel of Diverse Modelscited by 326
  9. 2022Efficient Training of Language Models to Fill in the Middlecited by 255
  10. 2023Self-Edit: Fault-Aware Code Editor for Code Generationcited by 111
  11. 2023Execution-based Code Generation using Deep Reinforcement Learningcited by 99
  12. 2024The RealHumanEval: Evaluating Large Language Models' Abilities to Support Programmerscited by 30
3 more
  1. 2024Evaluation of LLMs on Syntax-Aware Code Fill-in-the-Middle Taskscited by 25
  2. 2025Structure-Aware Fill-in-the-Middle Pretraining for Codecited by 4
  3. 2026Delulu: A Verified Multi-Lingual Benchmark for Code Hallucination Detection in Fill-in-the-Middle Taskscited by 3

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026Refusing the Impossible: A Taxonomy and Benchmark for Code Hallucination in Large Language Models ↗
  2. 2025From "Hallucination" to "Suture": Insights from Language Philosophy to Enhance Large Language Models
  3. 2026HalluWorld: A Controlled Benchmark for Hallucination via Reference World Models
  4. 2025OnionEval: An Unified Evaluation of Fact-conflicting Hallucination for Small-Large Language Models
  5. 2026Unified Hallucination Fuzzing for Multimodal Large Language Models
  6. 2024THaMES: An End-to-End Tool for Hallucination Mitigation and Evaluation in Large Language Models
  7. 2025Monitoring Decoding: Mitigating Hallucination via Evaluating the Factuality of Partial Response during Generation
  8. 2025Theoretical Foundations and Mitigation of Hallucination in Large Language Models