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

要約

大規模な言語モデル(LLM)は、日常生活に不可欠になり、さまざまな自然言語処理(NLP)タスクにわたって大きな可能性を示しています。
NLPを超えて、LLMSは、コードの完了、変更、バグ修正、コード翻訳など、ソフトウェア開発タスクでますます使用されています。
ソフトウェアエンジニアは、Github CopilotやAmazon Q、ワークフローの合理化、高精度でタスクの自動化などのツールを広く使用しています。
LLMトレーニングのリソースとエネルギーの強度はしばしば強調されていますが、多くの呼び出しを伴う継続的なプロセスであるため、推論は時間とともにさらにリソース集約的になる可能性があります。
したがって、LLM推論のためのリソース効率の高い代替品の開発は、持続可能性に不可欠です。
この作業は、LLMSのエネルギー認識コード生成のフレームワークであるグリーンコードを提案しています。
グリーンコードは、LLM推論中に動的な早期出口を実行します。
私たちは、精度、遅延、エネルギー消費のトレードオフのバランスをとることを学ぶ補強学習(RL)エージェントを訓練します。
私たちのアプローチは、JavacorpusとPY150データセットを使用して、2つのオープンソースLLM、Llama 3.2 3bおよびOpt 2.7bで評価されます。
結果は、私たちの方法が、精度に大きな影響を与えることなく、コード生成タスクの平均で23〜50%のエネルギー消費を減らすことを示しています。

要約(オリジナル)

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.

arxiv情報

著者 Shashikant Ilager,Lukas Florian Briem,Ivona Brandic
発行日 2025-03-21 15:07:55+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: C.4, cs.AI, cs.DC, cs.PF, cs.SE パーマリンク