mlsanityData to 14 Oct 2026

Generating Energy-efficient code with LLMs

arXiv 2411.10599 ↗First posted 15 Nov 2024cs.SE cs.AIcited by 4

Not on the map. Why?

Abstract (arXiv)

The increasing electricity demands of personal computers, communication networks, and data centers contribute to higher atmospheric greenhouse gas emissions, which in turn lead to global warming and climate change. Therefore the energy consumption of code must be minimized. Code can be generated by large language models. We look at the influence of prompt modification on the energy consumption of the code generated. We use three different Python code problems of varying difficulty levels. Prompt modification is done by adding the sentence ``Give me an energy-optimized solution for this problem'' or by using two Python coding best practices. The large language models used are CodeLlama-70b, CodeLlama-70b-Instruct, CodeLlama-70b-Python, DeepSeek-Coder-33b-base, and DeepSeek-Coder-33b-instruct. We find a decrease in energy consumption for a specific combination of prompt optimization, LLM, and Python code problem. However, no single optimization prompt consistently decreases energy consumption for the same LLM across the different Python code problems.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 8 of its 31 references that are in the map. First posted on arXiv 15 Nov 2024.

Builds on

8 of 31 references.

References · 8

  1. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  2. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  3. 2021Carbon Emissions and Large Neural Network Trainingcited by 567
  4. 2023From Words to Watts: Benchmarking the Energy Costs of Large Language Model Inferencecited by 170
  5. 2024Is Temperature the Creativity Parameter of Large Language Models?cited by 93
  6. 2022Great Power, Great Responsibility: Recommendations for Reducing Energy for Training Language Modelscited by 21
  7. 2024On Evaluating the Efficiency of Source Code Generated by LLMscited by 21
  8. 2024A Controlled Experiment on the Energy Efficiency of the Source Code Generated by Code Llamacited by 8

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 3; 2026: 1.

4 papers.