arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.01183cs.AIcs.PL
收藏

QiMeng-NeuComBack:从IR到汇编代码的自演化翻译

QiMeng-NeuComBack: Self-Evolving Translation from IR to Assembly Code

State Key Lab of Processors, Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China(中国科学院计算技术研究所处理器重点实验室,北京,中国);University of Chinese Academy of Sciences, Beijing, China(中国科学院大学,北京,中国)

Hainan Fang, Yuanbo Wen, Jun Bi, Yihan Wang, Tonghui He, Yanlin Tang, Di Huang, Jiaming Guo, Rui Zhang, Qi Guo, Yunji Chen

AI总结:

本文提出了IR到汇编编译的基准数据集NeuComBack,并开发了一种自演化提示优化方法,显著提升了LLM生成汇编代码的功能正确率和性能。

摘要:

编译器虽然不可或缺,但众所周知是极其复杂的系统,需要极其昂贵的人类专业知识来开发和维护。大型语言模型(LLMs)的最新进展提供了一种引人注目的新范式:神经编译,它有可能简化针对新架构的编译器开发,并促进创新优化技术的发现。然而,几个关键障碍阻碍了其实际应用。首先,专用基准和稳健评估方法的严重缺乏,阻碍了对该领域进展的客观评估和跟踪。其次,系统性地提升LLM生成汇编的可靠性和性能仍然是一个关键挑战。针对这些挑战,本文介绍了NeuComBack,一个专门为IR到汇编编译设计的新型基准数据集。利用该数据集,我们首先定义了一个基础的神经编译工作流,并对近期前沿LLM在神经编译上的能力进行了全面评估,确立了新的性能基线。我们进一步提出了一种自演化提示优化方法,使LLM能够通过从先前的自调试轨迹中提取见解,迭代地演化其内部提示策略,从而增强其神经编译能力。实验表明,我们的方法显著提升了LLM生成汇编代码的功能正确性和性能。与基线提示相比,功能正确率在x86_64上从44%提升至64%,在aarch64上从36%提升至58%。更重要的是,在使用我们方法正确生成的16个x86_64程序中,有14个(87.5%)超越了clang-O3的性能。

英文摘要:

Compilers, while essential, are notoriously complex systems that demand prohibitively expensive human expertise to develop and maintain. The recent advancements in Large Language Models (LLMs) offer a compelling new paradigm: Neural Compilation, which could potentially simplify compiler development for new architectures and facilitate the discovery of innovative optimization techniques. However, several critical obstacles impede its practical adoption. Firstly, a significant lack of dedicated benchmarks and robust evaluation methodologies hinders objective assessment and tracking of progress in the field. Secondly, systematically enhancing the reliability and performance of LLM-generated assembly remains a critical challenge. Addressing these challenges, this paper introduces NeuComBack, a novel benchmark dataset specifically designed for IR-to-assembly compilation. Leveraging this dataset, we first define a foundational Neural Compilation workflow and conduct a comprehensive evaluation of the capabilities of recent frontier LLMs on Neural Compilation, establishing new performance baselines. We further propose a self-evolving prompt optimization method that enables LLMs to iteratively evolve their internal prompt strategies by extracting insights from prior self-debugging traces, thereby enhancing their neural compilation capabilities. Experiments demonstrate that our method significantly improves both the functional correctness and the performance of LLM-generated assembly code. Compared to baseline prompts, the functional correctness rates improved from 44% to 64% on x86_64 and from 36% to 58% on aarch64, respectively. More significantly, among the 16 correctly generated x86_64 programs using our method, 14 (87.5%) surpassed clang-O3 performance.

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

↑