[论文解读] ECCO: Evidence-Driven Causal Reasoning for Compiler Optimization
ECCO 引入一个证据驱动的因果推理框架,将 LLM 策略师与 GA 战术家耦合,用以优化 LLVM 阶段排序,在七个基准上显著减少循环次数,相对于 LLVM -O3。
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提示。
- 提出一个证据驱动的流水线,从优化轨迹构建因果数据集,并使用推理蒸馏来训练模型。
- 设计一个协同推理框架,让LLM定义优化意图并引导遗传算法。
- 证明该方法在七个基准套件上相对于强基线能获得更优的循环减少。
提出的方法
- 通过迭代剪枝(算法1)将高性能序列反向工程为核心通过来构建因果数据集。
- 在每一步优化后提取结构、特征和性能证据并识别通过的协同效应。
- 从特权证据中蒸馏模拟预测推理成训练数据,使模型从静态特征学习到结果的因果关系。
- 两阶段策略优化:有监督微调(SFT)后再进行带GRPO的强化学习,以在格式与性能奖励之间取得平衡。
- 协同策略师–战术家推理:LLM发布高级优化意图(策略师),而GA执行精确的基于变异的搜索(战术家)。
- 从训练数据中计算全局通过效能先验(星级通过)并使用以意图引导的概率变异(方程4)来偏向GA探索,同时保持遍历性。

实验结果
研究问题
- RQ1ECCO 与传统自动调优启发式方法和直接提示LLMs相比的表现如何?
- RQ2证据驱动的训练和模型扩展对优化效果的贡献是什么?
- RQ3协同的策略师–战术家框架在性能和可解释性方面是否优于纯生成型LLM方法?
- RQ4ECCO 的优化推理与实际编译器行为的忠实度有多高?
主要发现
| Method | blas | cbench | chstone | mibench | npb | opencv | tensorflow | Average |
|---|---|---|---|---|---|---|---|---|
| TPE | 13.45 | 28.60 | 26.07 | 20.70 | 27.85 | 13.40 | 9.07 | 19.88 |
| RIO | 16.55 | 30.56 | 27.07 | 22.74 | 31.59 | 15.44 | 9.88 | 21.98 |
| OpenTuner | 15.72 | 31.68 | 27.03 | 22.93 | 32.41 | 15.50 | 9.71 | 22.14 |
| GA | 16.48 | 30.30 | 27.07 | 22.80 | 32.77 | 16.00 | 9.58 | 22.14 |
| PDCAT | 17.19 | 31.75 | 27.84 | 23.44 | 32.78 | 16.19 | 10.33 | 22.79 |
| CompTuner | 17.26 | 31.57 | 27.87 | 23.03 | 31.43 | 18.15 | 10.83 | 22.88 |
| GRACE | 13.72 | 34.08 | 32.95 | 24.69 | 29.31 | 14.98 | 12.25 | 23.14 |
| CFAST | 16.44 | 31.08 | 28.87 | 24.98 | 34.65 | 17.36 | 12.50 | 23.70 |
| Direct LLM Prompting(Best-of-32) | 8.46 | 27.11 | 27.88 | 20.41 | 15.54 | 9.93 | 4.39 | 16.25 |
| Kimi-K2 | 10.79 | 24.90 | 28.85 | 20.04 | 18.35 | 10.04 | 3.31 | 16.61 |
| DeepSeek-V3.2 | 6.41 | 28.16 | 29.70 | 20.04 | 16.68 | 8.42 | 3.01 | 16.06 |
| GPT5-chat | 10.62 | 26.30 | 27.61 | 19.24 | 18.02 | 10.63 | 3.51 | 16.56 |
| ECCO (Best-of-32) | 12.99 | 35.19 | 35.50 | 27.12 | 32.97 | 15.58 | 11.72 | 24.44 |
- ECCO 在七个基准上相对于 LLVM -O3 实现平均 24.44% 的循环减少。
- ECCO 优于传统搜索启发式方法和直接提示LLM,在 cbench、chstone、mibench 上有显著提升。
- 证据驱动的训练(链式推理和法证特征)是关键;移除证据或链式推理会降低性能。
- 独立的LLM策略还原在 Best-of-32 采样下收敛,但相比完整的策略师–战术家系统平均性能仍落后约 5 个百分点。
- 可解释性评估显示ECCO的推理具有高保真度,评审者的平均一致性约为 91%。
- 在没有证据 grounding 的训练下,增大模型规模回报递减;最佳平衡点大约在 3B–7B,且需要协作。

更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。