arXiv:2511.01183cs.AIcs.PL2025-11NeurIPS

用自进化提示提升大模型生成汇编代码的正确率与性能

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

  • 通过自反思机制优化提示词,让模型自我迭代改进编译策略
  • x86_64正确率从44%提升至64%,aarch64从36%升至58%
  • 87.5%的正确生成代码超越clang-O3优化水平,适合编译器研究者

编译器虽关键,但开发维护成本高昂。大语言模型(LLMs)为神经编译提供了新范式,但缺乏专用基准和可靠评估方法,且生成的汇编代码可靠性不足。本文提出NeuComBack,一个针对IR到汇编编译的新型基准数据集。基于此,我们定义了基础神经编译流程,并全面评估前沿LLMs在该任务上的表现,建立新基线。进一步提出自进化提示优化方法,使模型通过分析历史自调试痕迹,迭代优化内部提示策略。实验表明,该方法显著提升生成代码的功能正确性与性能:x86_64正确率由44%升至64%,aarch64由36%升至58%;在16个正确生成的x86_64程序中,14个(87.5%)超过clang-O3性能。

原文摘要 · Abstract (English)

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.

神经编译大模型代码生成自进化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。