arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.00989cs.SE
收藏

利用大语言模型实现可持续代码生成:系统文献综述

Energy-Efficient Code Generation Using Large Language Models: A Systematic Literature Review

Algoma University(阿尔戈马大学);Brandon University(布兰登大学)

Sabiya Banu Masthan Ali, Syed Muhammad Danish, Aroosa Hameed, Oussema Kirmani, Gautam Srivastava

AI总结:

本文系统回顾了大语言模型生成代码的可持续性研究,分析了代码效率对环境影响,指出现有研究存在方法分散、缺乏统一评估框架的问题。

摘要:

大型语言模型(LLMs)被广泛用于软件工程中生成、完善、翻译和修复代码,提升开发者生产力。尽管大多数研究关注模型训练和推理的能耗和碳排放,但对LLMs生成代码的可持续性关注较少。生成代码的效率影响软件系统的长期环境影响。低效代码会增加部署和运行时的CPU使用、内存消耗、执行时间和总体能耗。随着LLMs生成的代码在现实项目中越来越普遍,即使小的低效也可能导致长期的高环境成本。本文审查了现有关于LLMs生成代码可持续性的研究。我们进行系统文献综述,分析选定的原始研究,并调查LLMs生成可持续代码的能力。此外,我们还探讨了在此背景下可持续性的定义和测量,包括用于评估能效和资源使用的指标和评估策略。我们还探讨了微调和提示工程等技术是否影响生成代码的可持续性。通过结构化分析选定的研究,我们根据方法论方法、评估实践和实验设置对研究努力进行分类。研究结果表明,该领域的研究仍然相对有限和碎片化,没有广泛接受的框架用于测量或基准测试LLMs生成代码的可持续性。这些观察强调了需要更清晰的定义、标准化的评估方法和系统性的研究来支持环保的AI辅助软件工程。

英文摘要:

Large Language Models (LLMs) are increasingly used in software engineering for code generation, completion, translation, and repair. While substantial research has examined the energy consumption and environmental impact of LLM training and inference, considerably less attention has been given to the energy efficiency of the code produced by these models. Existing studies are fragmented across different models, programming tasks, benchmarks, hardware platforms, and measurement methods, making it difficult to draw consistent conclusions about the energy efficiency of LLM-generated code. No systematic synthesis currently consolidates these findings or identifies common trends, gaps, and methodological inconsistencies. To address this gap, we conduct a systematic literature review of existing empirical studies on the energy efficiency of LLM-generated code. We examine the extent to which LLMs generate energy-efficient code, the metrics used for evaluation, the benchmarks, datasets, and measurement tools employed, and the influence of prompting and fine-tuning strategies. Our findings show that the current evidence remains limited and highly heterogeneous. Most studies rely on conventional software-efficiency metrics and existing programming or code-generation benchmarks rather than evaluation methods specifically designed for LLM-generated code. The reported energy-efficiency outcomes are strongly dependent on the evaluated model, task, benchmark, and experimental configuration, and no single prompting strategy consistently improves energy efficiency across settings. We further find limited investigation of small language models, energy-aware fine-tuning, diverse programming languages, real-world software domains, and direct hardware-based energy measurement. Overall, the review highlights the lack of standardized evaluation practices and dedicated energy-efficiency benchmarks.

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

↑