paper-with-me

홈 › Papers

Generating Energy-efficient code with LLMs

2024-11-15 · Tom Cappendijk, Pepijn de Reus, Ana Oprescu

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.

📄 PDF Abstract BibTeX arXiv:2411.10599

Code (0)

등록된 구현이 없습니다.

Tasks

Sentence

Similar Papers 제목 키워드 기반

Leveraging LLMs to Automate Energy-Aware Refactoring of Parallel Scientific Codes

2025-05-04 · Matthew T. Dearing, Yiheng Tao, Xingfu Wu, Zhiling Lan 외

While large language models (LLMs) are increasingly used for generating parallel scientific code, most current efforts emphasize functional correctness, often overlooking performance and energy considerations. In this wo…

Generating Energy-Efficient Code via Large-Language Models -- Where are we now?

2025-09-12 · Radu Apsan, Vincenzo Stoico, Michel Albonico, Rudra Dhar 외 arxiv

Context. The rise of Large Language Models (LLMs) has led to their widespread adoption in development pipelines. Goal. We empirically assess the energy efficiency of Python code generated by LLMs against human-written co…

Code Generation

An Initial Exploration of Contrastive Prompt Tuning to Generate Energy-Efficient Code

2026-03-03 · Sophie Weidmann, Fernando Castor arxiv

Although LLMs are capable of generating functionally correct code, they also tend to produce less energy-efficient code in comparison to human-written solutions. As these inefficiencies lead to higher computational overh…

Contrastive Learning

Towards Privacy-Preserving Code Generation: Differentially Private Code Language Models

2025-12-12 · Melih Catal, Pooja Rani, Harald C. Gall arxiv

Large language models specialized for code (CodeLLMs) have demonstrated remarkable capabilities in generating code snippets, documentation, and test cases. However, despite their promising capabilities, CodeLLMs can inad…

Code Generation

Green My LLM: Studying the key factors affecting the energy consumption of code assistants

2024-11-07 · Tristan Coignion, Clément Quinton, Romain Rouvoy

In recent years,Large Language Models (LLMs) have significantly improved in generating high-quality code, enabling their integration into developers' Integrated Development Environments (IDEs) as code assistants. These a…

Quantization