Pith. sign in

REVIEW 5 cited by

LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigation

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2409.20550 v2 pith:ZZKHSLO4 submitted 2024-09-30 cs.SE cs.AIcs.CL

classification cs.SEcs.AIcs.CL
keywords codegenerationhallucinationsllmsdevelopmentmitigationpracticalresults
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

Code generation aims to automatically generate code from input requirements, significantly enhancing development efficiency. Recent large language models (LLMs) based approaches have shown promising results and revolutionized code generation task. Despite the promising performance, LLMs often generate contents with hallucinations, especially for the code generation scenario requiring the handling of complex contextual dependencies in practical development process. Although previous study has analyzed hallucinations in LLM-powered code generation, the study is limited to standalone function generation. In this paper, we conduct an empirical study to study the phenomena, mechanism, and mitigation of LLM hallucinations within more practical and complex development contexts in repository-level generation scenario. First, we manually examine the code generation results from six mainstream LLMs to establish a hallucination taxonomy of LLM-generated code. Next, we elaborate on the phenomenon of hallucinations, analyze their distribution across different models. We then analyze causes of hallucinations and identify four potential factors contributing to hallucinations. Finally, we propose an RAG-based mitigation method, which demonstrates consistent effectiveness in all studied LLMs. The replication package including code, data, and experimental results is available at https://github.com/DeepSoftwareAnalytics/LLMCodingHallucination

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 5 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. Bridging the Gap on AI-Assisted Scientific Software Development Through Transparency and Traceability

    cs.SE 2026-05 conditional novelty 6.0 of 10

    Proposes guidance for responsible AI use in scientific software development under NQA-1 standards, illustrated with TMAP8 V&V cases to ensure accountability and auditability.

  2. Securing LLM-Generated Embedded Firmware through AI Agent-Driven Validation and Patching

    cs.CR 2025-09 reject novelty 5.0 of 10

    An iterative fuzz-test, static-analysis, and LLM-patch loop with three AI agents is claimed to raise firmware vulnerability remediation from 67.3% to 92.4% in QEMU-run FreeRTOS tasks.

  3. HCRMP: A LLM-Hinted Contextual Reinforcement Learning Framework for Autonomous Driving

    cs.RO 2025-05 conditional novelty 5.0 of 10

    The HCRMP planner feeds LLM semantic hints into state representation and critic weighting instead of letting the LLM decide actions, reporting better CARLA driving metrics.

  4. Curiosity by Design: An LLM-based Coding Assistant Asking Clarification Questions

    cs.AI 2025-07 conditional novelty 4.0 of 10

    A fine-tuned classifier and question generator let a small coding assistant detect under-specified prompts and ask for clarification, which users rated better than a baseline in a small study.

  5. OpenFActScore: Open-Source Atomic Evaluation of Factuality in Text Generation

    cs.CL 2025-07 conditional novelty 4.0 of 10

    Using Olmo to extract atomic facts and Gemma to verify them against Wikipedia, OpenFActScore reproduces the original FActScore ranking of 10 LLMs with a Pearson correlation above 0.99.

Pith tools