Pith. sign in

Evaluating the energy-efficiency of the code generated by LLMs

4 Pith papers cite this work. Polarity classification is still indexing.

4 Pith papers citing it
abstract

As the quality of code generated by Large Language Models (LLMs) improves, their adoption in the software industry for automated code generation continues to grow. Researchers primarily focus on enhancing the functional correctness of the generated code while commonly overlooking its energy efficiency and environmental impact. This paper investigates the energy efficiency of the code generated by 20 popular LLMs for 878 programming problems of varying difficulty levels and diverse algorithmic categories selected from the LeetCode platform by comparing them against canonical human-written solutions. Although LLMs can produce functionally correct results in most cases, our findings show that the performance and energy efficiency of LLM-produced solutions are often far below those of human-written solutions. Among the studied LLMs, DeepSeek-v3 and GPT-4o generate the most energy-efficient code, whereas Grok-2 and Gemini-1.5-Pro are among the least energy-efficient models. On average, human-generated canonical solutions are approximately 1.17 times more energy efficient than DeepSeek-v3, 1.21 times more energy efficient than GPT-4o, and over 2 times more energy efficient than Grok-2 and Gemini-1.5-Pro. For specific algorithmic groups such as dynamic programming, backtracking, and bit manipulation, LLM-generated code can consume up to 450 times more energy than human-generated canonical solutions.

citation-role summary

background 1

citation-polarity summary

fields

cs.SE 3 cs.HC 1

years

2026 3 2025 1

roles

background 1

polarities

background 1

representative citing papers

Rethinking Code Performance Benchmarks for LLMs

cs.SE · 2026-07-08 · conditional · novelty 6.0

Re-evaluating four LLM code-efficiency benchmarks with 30-run statistical testing shows 93.89% of 'performant' implementations are indistinguishable from baselines; a multi-agent test-generation framework reveals hidden significant improvements in ~24% of previously non-significant tasks.

SysLLMatic: Large Language Models are Software System Optimizers

cs.SE · 2025-06-02 · unverdicted · novelty 6.0

SysLLMatic integrates LLMs with performance diagnostics and a 43-pattern catalog to optimize complex software, reporting 1.54x latency and 1.24x energy gains over compilers on large Java systems where prior LLM methods did not scale.

citing papers explorer

Showing 4 of 4 citing papers.

  • Rethinking Code Performance Benchmarks for LLMs cs.SE · 2026-07-08 · conditional · none · ref 136 · internal anchor

    Re-evaluating four LLM code-efficiency benchmarks with 30-run statistical testing shows 93.89% of 'performant' implementations are indistinguishable from baselines; a multi-agent test-generation framework reveals hidden significant improvements in ~24% of previously non-significant tasks.

  • SysLLMatic: Large Language Models are Software System Optimizers cs.SE · 2025-06-02 · unverdicted · none · ref 20

    SysLLMatic integrates LLMs with performance diagnostics and a 43-pattern catalog to optimize complex software, reporting 1.54x latency and 1.24x energy gains over compilers on large Java systems where prior LLM methods did not scale.

  • EcoAssist: Embedding Sustainability into AI-Assisted Frontend Development cs.HC · 2026-04-06 · unverdicted · none · ref 46

    EcoAssist embeds energy estimation and optimization into AI-assisted frontend coding, reducing website energy use by 13-16% in benchmarks while preserving developer productivity.

  • Sustainable Code Generation Using Large Language Models: A Systematic Literature Review cs.SE · 2026-03-01 · unverdicted · none · ref 98

    A systematic review finds research on the sustainability of LLM-generated code to be limited, fragmented, and without accepted frameworks for measurement or benchmarking.