mlsanityData to 14 Oct 2026

Output Format Biases in the Evaluation of Large Language Models for Code Translation

arXiv 2403.17214 ↗First posted 25 Mar 2024cs.SE cs.AIcited by 9

Not on the map. Why?

Abstract (arXiv)

Code translation between programming languages (PLs) is a critical task in software engineering, facilitating the modernization of legacy systems, ensuring cross-platform compatibility, and enhancing software performance. Most existing studies instruct LLMs to perform code translation and evaluate their performance by either running the generated outputs through test suites or comparing them to reference outputs (ground truth). These outputs, however, may contain not only executable source code but also additional non-code elements, such as natural language explanations or formatting tokens. We refer to the combination of source code and non-code elements as the output format. It is crucial to understand and address variations in output format, as non-code elements can interfere with evaluation metrics, resulting in biased assessments of model performance and comparisons. We conduct an empirical analysis of the outputs from eleven instruct-tuned open-source LLMs, across five PLs: C, C++, Go, Java, and Python. The results show that between 26.4% and 73.7% of outputs produced by our evaluated LLMs necessitate post-processing. To mitigate output format bias, we propose a strategic combination of prompt engineering and regular expressions that effectively extracts source code from mixed-format outputs, enabling the eleven open-source models to achieve an average Code Extraction Success Rate (CSR) of 92.73%. Our empirical study confirms that output format bias affects widely used execution-based metrics, i.e., Computational Accuracy (CA), and text-based metrics, i.e., BLEU, CodeBLEU and CrystalBLEU. Additionally, we test five closed-source LLMs and observe that they also generate varying distributions of output formats, which could lead to output format biases. Our results highlight the need to mitigate the output format bias to enable reliable evaluations in LLMs for code translation.

Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). Builds on 25 of its 62 references that are in the map. First posted on arXiv 25 Mar 2024.

Builds on

25 of 62 references.

References · 25

  1. 2023GPT-4 Technical Reportcited by 18,396
  2. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
  3. 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,218
  4. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  5. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  6. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  7. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
  8. 2023StarCoder: may the source be with you!cited by 799
  9. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
  10. 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 733
  11. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
  12. 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 300
13 more
  1. 2020Unsupervised Translation of Programming Languagescited by 263
  2. 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 200
  3. 2023Large Language Models for Software Engineering: Survey and Open Problemscited by 181
  4. 2023CodeBERTScore: Evaluating Code Generation with Pretrained Models of Codecited by 102
  5. 2018Tree-to-tree Neural Networks for Program Translationcited by 93
  6. 2021Leveraging Automated Unit Tests for Unsupervised Code Translationcited by 82
  7. 2023Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context Learningcited by 72
  8. 2021DOBF: A Deobfuscation Pre-Training Objective for Programming Languagescited by 68
  9. 2022XLCoST: A Benchmark Dataset for Cross-lingual Code Intelligencecited by 56
  10. 2021Perfection Not Required? Human-AI Partnerships in Code Translationcited by 42
  11. 2023Prompting Is All You Need: Automated Android Bug Replay with Large Language Modelscited by 40
  12. 2023Nuances are the Key: Unlocking ChatGPT to Find Failure-Inducing Tests with Differential Promptingcited by 23
  13. 2023On the Evaluation of Neural Code Translation: Taxonomy and Benchmarkcited by 23

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 2; 2025: 6; 2026: 1.

9 papers.