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