Vibeleaderboard
← All Intel
Intel / article

Improving the Energy-Efficiency of the Code Generated by LLMs through Effective Prompting

Source
arxiv.org
Author
Ritika Rekhi, Bing Zhang, Md Arman Islam, Jaya Krishna Pasham, Yeswanth Chitturi, Akshay Paramesha, Isha Valiveti, Asif Imran, Bekir Turkkan, Tevfik Kosar
Date
Why it matters

Prompt wording alone cut energy use of generated code by up to 25% in Python and 17% in C++ across 10 models. You can apply these strategies to coding agents without changing models.

Key takeaways · AI-distilled
  • The authors screened 21 prompting strategies for energy-efficient code, then tested 8 of them across 10 and proprietary LLMs on Python and C++ against a baseline prompt.
  • Across models, the selected prompts cut energy use of the generated code by up to 25% for Python and up to 17% for C++, measured relative to the baseline prompt.
  • Effects vary sharply by model and language: Python reductions reached 50% for Granite-4.0-H-Small and 39% for Claude 4.5 Haiku, while the best C++ result for Qwen3-Coder-480B was only 7%, so no single prompt is a universal fix.
Terms in this piece · Glossary
  • LLM — A large language model — the neural network behind tools like Claude and ChatGPT, trained on huge amounts of text to predict what comes next.
  • open weights — A model whose trained parameters are published for anyone to download and run — unlike API-only models you can access but never possess.
Recommended reads
Comments

Checking sign-in…

Loading comments…