arXivDaily arXiv每日学术速递 周一至周五更新
​通知:联邦节假日调休:哥伦布日 / 原住民日(Columbus Day / Indigenous Peoples' Day),今日(13日)无更新。
arXiv 2508.01443cs.SEcs.AI

通过元提示调优基于大语言模型的代码优化:工业视角

Tuning LLM-based Code Optimization via Meta-Prompting: An Industrial Perspective

University of Leeds(利兹大学);University of Surrey(萨里大学);University of West London(西伦敦大学)

Jingzhi Gong, Rafail Giavrimis, Paul Brookes, Vardan Voskanyan, Fan Wu, Mari Ashiga, Matthew Truscott, Mike Basios, Leslie Kanthan, Jie Xu, Zheng Wang

AI总结:

针对多LLM工业部署中跨模型提示工程成本高的瓶颈,提出MPCO元提示代码优化框架,通过整合多类上下文动态生成适配不同LLM的优化提示,在真实代码库测试中实现最高19.06%的性能提升,为工业实践提供参考。

摘要:

当前利用多个大语言模型(LLM)实现自动化代码优化的研究热度日益增长。然而,部署了多个LLM的工业平台面临一项关键挑战:针对某一LLM优化的提示词往往在其他模型上失效,需要开展成本高昂的、针对特定模型的提示工程。这种跨模型提示工程瓶颈严重限制了多LLM系统在生产环境中的实际部署。我们提出元提示代码优化(MPCO)框架,该框架可在满足工业效率要求的前提下,跨不同LLM自动生成高质量的、针对特定任务的提示词。MPCO利用元提示技术,通过整合项目元数据、任务需求和LLM特定上下文,动态合成具备上下文感知能力的优化提示词,它是ARTEMIS代码优化平台中用于自动化验证和规模化扩展的核心组成部分。我们在5个真实代码库上开展了全面评估,累计运行时基准测试时长366小时,结果证明了MPCO的有效性:与基线方法相比,该框架实现了最高19.06%的整体性能提升,在所有对比系统中统计排名最优。分析显示,96%的性能最优优化结果均来自有实际意义的代码修改。通过系统的消融实验和元提示器敏感性分析,我们发现全面的上下文整合对实现有效的元提示至关重要,且主流LLM均可有效充当元提示器,为工业从业者提供了可落地的参考见解。

英文摘要:

There is a growing interest in leveraging multiple large language models (LLMs) for automated code optimization. However, industrial platforms deploying multiple LLMs face a critical challenge: prompts optimized for one LLM often fail with others, requiring expensive model-specific prompt engineering. This cross-model prompt engineering bottleneck severely limits the practical deployment of multi-LLM systems in production environments. We introduce Meta-Prompted Code Optimization (MPCO), a framework that automatically generates high-quality, task-specific prompts across diverse LLMs while maintaining industrial efficiency requirements. MPCO leverages metaprompting to dynamically synthesize context-aware optimization prompts by integrating project metadata, task requirements, and LLM-specific contexts. It is an essential part of the ARTEMIS code optimization platform for automated validation and scaling. Our comprehensive evaluation on five real-world codebases with 366 hours of runtime benchmarking demonstrates MPCO's effectiveness: it achieves overall performance improvements up to 19.06% with the best statistical rank across all systems compared to baseline methods. Analysis shows that 96% of the top-performing optimizations stem from meaningful edits. Through systematic ablation studies and meta-prompter sensitivity analysis, we identify that comprehensive context integration is essential for effective meta-prompting and that major LLMs can serve effectively as meta-prompters, providing actionable insights for industrial practitioners.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑