返回全部动态

通过有效提示提升LLM生成代码的能效

原标题:Improving the Energy-Efficiency of the Code Generated by LLMs through Effective Prompting

arXiv cs.SE一手来源研究质量 76

AI 摘要

该研究系统评估了21种提示策略对LLM生成代码能效的影响,并在10个开源与专有模型上测试了其中8种策略,覆盖Python和C++。结果显示,相比基线提示,这些策略可使Python代码能耗最多降低25%、C++最多降低17%;模型层面,Granite-4.0-H-Small的Python能耗降低达50%、C++达56%。研究强调应将能效纳入LLM代码生成的评估与优化,并指出提示策略效果因模型和编程语言而异。

以上摘要由 AI 生成,可能存在误差。事实请以原文为准。

正文节选

Improving the Energy-Efficiency of the Code Generated by LLMs through Effective Prompting Abstract As AI-assisted programming becomes increasingly mainstream, the environmental impact of AI-generated software has emerged as an important consideration. This motivates evaluating LLM-generated code beyond functional correctness by considering execution efficiency and energy consumption. However, despite substantial advances in code generation, frontier LLMs are rarely evaluated based on the energy


发布时间:2026-10-05 12:00
抓取时间:2026-10-05 18:05
来源机构:arXiv
阅读原文arxiv.org