arXiv:2602.00087cs.LGcs.AI2026-02被引 2

用可解释因果推理提升编译器优化,让AI懂代码逻辑而非盲目试错。

ECCO: Evidence-Driven Causal Reasoning for Compiler Optimization

  • 构建思维链数据集,让模型学习优化背后的因果逻辑。
  • 在7个数据集上平均减少24.44%执行周期,优于LLVM默认优化。
  • 适合研究编译器自动调优与可解释AI的开发者参考。

编译器自动调优面临黑箱搜索方法缺乏语义指导,以及大语言模型方法常因表面模式匹配和因果不透明的问题。本文提出ECCO框架,将可解释推理与组合搜索结合。我们首先提出逆向工程方法,构建思维链数据集,明确映射静态代码特征到可验证性能证据,使模型学习优化决策背后的因果逻辑,而非仅模仿序列。基于此可解释先验,设计协同推理机制:大语言模型作为策略制定者,定义优化意图,动态引导遗传算法的变异操作。在七个数据集上的实验表明,ECCO显著优于LLVM opt -O3基线,平均实现24.44%的循环数减少。

原文摘要 · Abstract (English)

Compiler auto-tuning faces a dichotomy between traditional black-box search methods, which lack semantic guidance, and recent Large Language Model (LLM) approaches, which often suffer from superficial pattern matching and causal opacity. In this paper, we introduce ECCO, a framework that bridges interpretable reasoning with combinatorial search. We first propose a reverse engineering methodology to construct a Chain-of-Thought dataset, explicitly mapping static code features to verifiable performance evidence. This enables the model to learn the causal logic governing optimization decisions rather than merely imitating sequences. Leveraging this interpretable prior, we design a collaborative inference mechanism where the LLM functions as a strategist, defining optimization intents that dynamically guide the mutation operations of a genetic algorithm. Experimental results on seven datasets demonstrate that ECCO significantly outperforms the LLVM opt -O3 baseline, achieving an average 24.44% reduction in cycles.

编译器优化因果推理LLM应用

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