arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2604.05137cs.PLcs.AIcs.CLcs.LGcs.SE
收藏

EffiPair:通过相对对比反馈提升LLM生成代码的效率

EffiPair: Improving the Efficiency of LLM-generated Code with Differential Execution Feedback

Columbia University(哥伦比亚大学)

Samira Hajizadeh, Suman Jana

AI总结:

本文提出EffiPair框架,通过相对对比反馈机制在测试时迭代优化代码效率,减少性能反馈开销,实验证明其在代码效率提升方面优于传统方法。

摘要:

大型语言模型(LLM)生成的代码通常在功能上正确,但在运行时和内存使用上效率低下。以往提升代码效率的方法通常依赖绝对执行反馈,如单个程序的运行时或内存使用分析,这成本高且指导性差。本文提出相对对比反馈(RCF),一种无需模型微调或参数更新的推理时反馈机制。RCF通过比较结构相似但效率不同的程序,突出更高效差异。基于此,我们引入EffiPair,一种在测试时运行的迭代优化框架,通过生成多个候选方案、识别具有显著效率差距的程序对、总结执行差异为轻量反馈,并利用此信号生成更高效的解决方案。通过将孤立标量反馈替换为成对对比比较,EffiPair提供更直接的指导,同时减少性能分析和提示开销。在代码效率基准测试中,EffiPair在保持正确性的同时持续提升效率。例如,使用DeepSeek-Chat V3.2时,EffiPair在无性能反馈的情况下实现1.5倍速度提升,同时相比先前工作减少超过90%的token使用量。

英文摘要:

Large language models (LLMs) can generate functionally correct programs that differ substantially in execution efficiency. Existing inference-time optimization methods typically refine each candidate using pointwise runtime or profiling feedback, which identifies how costly an implementation is or where the cost arises, but offers limited guidance on how the computation should change. We introduce DIFFERENTIAL EXECUTION FEEDBACK (DEF), which compares implementations that are nearby in structural program space but separated in performance, turning their execution and implementation differences into directional optimization evidence. We demonstrate DEF in EffiPair, a training-free, test-time framework that pairs structurally similar programs with different efficiencies, distills their relative execution behavior into compact feedback, and iteratively refines a candidate pool. Across EvalPerf, Mercury, and ENAMEL, using GPT-4o mini, DeepSeek-V4.1 Flash, and GPT-5 mini, EffiPair achieves the highest value on each benchmark's official efficiency metric in all nine model-benchmark settings under matched evaluation conditions. Moreover, two contrastive refinement rounds improve efficiency over the selected initial draft in every setting while preserving or improving Pass@1. These results demonstrate the effectiveness of relational execution feedback as a lightweight signal for test-time code optimization.

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

↑