ResearchResearch paperLarge Language Models1 source · Oct 20, 2026

Hallucinations of Large Language Models in Cross-Language Code Translation: Phenomena and Mitigation

Although Large Language Models (LLMs) have improved code translation, their outputs still contain hallucinations: generated code that conflicts with the source program, violates target-language facts, or introduces contextually inconsistent dependencies.

Key points

  • Code translation converts source code from one programming language to another while preserving its functionality.
  • This paper presents a systematic empirical study of LLM hallucinations in code translation.
  • Guided by the taxonomy, we further propose HaluCodeTran, a mitigation framework that combines BM25-based retrieval of relevant translation examples with taxonomy-aware reflective refinement.
  • The study provides an execution-tested characterization of code-translation hallucinations and a practical baseline for building more reliable LLM-based code migration tools.

Sources (1)

  • [1]Hallucinations of Large Language Models in Cross-Language Code Translation: Phenomena and Mitigation
    arXiv (AI, ML, NLP, CV, robotics, multi-agent) · Oct 20, 08:50 AM
    Although Large Language Models (LLMs) have improved code translation, their outputs still contain hallucinations: generated code that conflicts with the source program, violates target-language facts, or introduces contextually inconsistent dependencies.
    Code translation converts source code from one programming language to another while preserving its functionality.

Extractive summary: sentences quoted from the sources.

Before this

  1. Oct 20, 2026Tracing Recurrent and Emergent Hallucination Patterns in Decomposed Text-to-SQL Generation
  2. Oct 20, 2026CovNav: Conformal Prediction-Guided Adaptive Inference for Object Goal Navigation
  3. Oct 19, 2026Introducing Clairic, a new System One class of extraction models
  4. Oct 19, 2026Push-based KV transfer to improve TTFT and TPOT for disaggregated inference in vLLM
  5. Oct 19, 2026From Black Box to Controller: Inference-Time Steering of LLM via Feature Amplification
  6. Oct 18, 2026TIRE: Top-Down Formula Instantiation with Reliable Execution for Physics Problem Synthesis

Related