paper-with-me

홈 › Papers

GREEN-CODE: Learning to Optimize Energy Efficiency in LLM-based Code Generation

2025-01-19 · Shashikant Ilager, Lukas Florian Briem, Ivona Brandic

Large Language Models (LLMs) are becoming integral to daily life, showcasing their vast potential across various Natural Language Processing (NLP) tasks. Beyond NLP, LLMs are increasingly used in software development tasks, such as code completion, modification, bug fixing, and code translation. Software engineers widely use tools like GitHub Copilot and Amazon Q, streamlining workflows and automating tasks with high accuracy. While the resource and energy intensity of LLM training is often highlighted, inference can be even more resource-intensive over time, as it's a continuous process with a high number of invocations. Therefore, developing resource-efficient alternatives for LLM inference is crucial for sustainability. This work proposes GREEN-CODE, a framework for energy-aware code generation in LLMs. GREEN-CODE performs dynamic early exit during LLM inference. We train a Reinforcement Learning (RL) agent that learns to balance the trade-offs between accuracy, latency, and energy consumption. Our approach is evaluated on two open-source LLMs, Llama 3.2 3B and OPT 2.7B, using the JavaCorpus and PY150 datasets. Results show that our method reduces the energy consumption between 23-50 % on average for code generation tasks without significantly affecting accuracy.

📄 PDF Abstract BibTeX arXiv:2501.11006

Code (1)

large-scale-sustainable-computing-lsc/green-code 공식 구현 pytorch

Tasks

Bug fixingCode CompletionCode GenerationCode TranslationReinforcement Learning (RL)

Methods 이 논문이 사용한 방법론

LLaMA LLaMA is a collection of foundation language models ranging from 7B to 65B parameters. It is based on the transformer architecture with various improvements that were…
OPT OPT is a suite of decoder-only pre-trained transformers ranging from 125M to 175B parameters. The model uses an AdamW optimizer and weight decay of 0.1. It follows a linear…

Similar Papers 제목 키워드 기반

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

Beyond the Need for Speed: Energy-Aware Code Generation via Simulation-Guided Reinforcement Learning

2026-07-06 · Saurabhsingh Rajput, Tushar Sharma arxiv

Code models strictly prioritize functional correctness, leaving software energy efficiency as an unoptimized byproduct. Training models to generate energy-efficient code requires reproducible feedback at scale, which phy…

Reinforcement LearningCode Generation

Energy Efficient Video Decoding for VVC Using a Greedy Strategy Based Design Space Exploration

2021-11-23 · Matthias Kränzler, Christian Herglotz, André Kaup

IP traffic has increased significantly in recent years, and it is expected that this progress will continue. Recent studies report that the viewing of online video content accounts for a share of 1% of the global greenho…

4kDecoder

Learn to Code Sustainably: An Empirical Study on LLM-based Green Code Generation

2024-03-05 · Tina Vartziotis, Ippolyti Dellatolas, George Dasoulas, Maximilian Schmidt 외

The increasing use of information technology has led to a significant share of energy consumption and carbon emissions from data centers. These contributions are expected to rise with the growing demand for big data anal…

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