paper-with-me

홈 › Papers

Bridging Functional Correctness and Runtime Efficiency Gaps in LLM-Based Code Translation

2026-06-16 · Longhui Zhang, Jiahao Wang, Chenhao Hu, Bingyu Liang, Jing Li, Min Zhang arxiv

While large language models (LLMs) have greatly advanced the functional correctness of automated code translation systems, the runtime efficiency of translated programs has received comparatively little attention. With the waning of Moore's law, runtime efficiency has become increasingly important for program quality, alongside functional correctness. Our preliminary study reveals that LLM-translated programs often run slower than human-written ones, and this issue cannot be remedied through prompt engineering alone. Therefore, our work proposes SwiftTrans, a code translation framework comprising two key stages: (1) Multi-Perspective Exploration, where MpTranslator leverages parallel in-context learning (ICL) to generate diverse translation candidates; and (2) Difference-Aware Selection, where DiffSelector identifies the optimal candidate by explicitly comparing differences between translations. We further introduce Hierarchical Guidance for MpTranslator and Ordinal Guidance for DiffSelector, enabling LLMs to better adapt to these two core components. To support the evaluation of runtime efficiency in translated programs, we extend existing benchmarks, CodeNet and F2SBench, and introduce a new benchmark, SwiftBench. Experimental results across all three benchmarks show that SwiftTrans achieves consistent improvements in both correctness and runtime efficiency.

📄 PDF Abstract BibTeX arXiv:2606.17683

Code (0)

등록된 구현이 없습니다.

Tasks

Prompt EngineeringCode Translation

Similar Papers 제목 키워드 기반

Mercury: A Code Efficiency Benchmark for Code Large Language Models

2024-02-12 · Mingzhe Du, Anh Tuan Luu, Bin Ji, Qian Liu 외

Amidst the recent strides in evaluating Large Language Models for Code (Code LLMs), existing benchmarks have mainly focused on the functional correctness of generated code, neglecting the importance of their computationa…

Code GenerationComputational Efficiency

EffiPair: Improving the Efficiency of LLM-generated Code with Relative Contrastive Feedback

2026-04-06 · Samira Hajizadeh, Suman Jana arxiv

Large language models (LLMs) often generate code that is functionally correct but inefficient in runtime and memory. Prior approaches to improving code efficiency typically rely on absolute execution feedback, such as pr…

Code-Optimise: Self-Generated Preference Data for Correctness and Efficiency

2024-06-18 · Leonidas Gee, Milan Gritta, Gerasimos Lampouras, Ignacio Iacobacci

Code Language Models have been trained to generate accurate solutions, typically with no regard for runtime. On the other hand, previous works that explored execution optimisation have observed corresponding drops in fun…

HumanEvalmbpp

Pluto: A Benchmark for Evaluating Efficiency of LLM-generated Hardware Code

2025-10-16 · Manar Abdelatty, Maryam Nouh, Jacob K. Rosenstein, Sherief Reda arxiv

Large Language Models (LLMs) are increasingly used to automate hardware design tasks, including the generation of Verilog code. While early benchmarks focus primarily on functional correctness, efficient hardware design …

Why Stop at One Error? Benchmarking LLMs as Data Science Code Debuggers for Multi-Hop and Multi-Bug Errors

2025-03-28 · Zhiyu Yang, Shuo Wang, Yukun Yan, Yang Deng

LLMs are transforming software development, yet current code generation and code repair benchmarks mainly assess syntactic and functional correctness in simple, single-error cases. LLMs' capabilities to autonomously find…

BenchmarkingCode GenerationCode Repair