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

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

arXiv - AI 3 min read

About this article

Abstract page for arXiv paper 2604.02352: An Initial Exploration of Contrastive Prompt Tuning to Generate Energy-Efficient Code

Computer Science > Machine Learning arXiv:2604.02352 (cs) [Submitted on 3 Mar 2026] Title:An Initial Exploration of Contrastive Prompt Tuning to Generate Energy-Efficient Code Authors:Sophie Weidmann, Fernando Castor View a PDF of the paper titled An Initial Exploration of Contrastive Prompt Tuning to Generate Energy-Efficient Code, by Sophie Weidmann and Fernando Castor View PDF Abstract: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 overhead, they are in direct conflict with Green Software Development (GSD) efforts, which aim to reduce the energy consumption of code. To support these efforts, this study aims to investigate whether and how LLMs can be optimized to promote the generation of energy-efficient code. To this end, we employ Contrastive Prompt Tuning (CPT). CPT combines Contrastive Learning techniques, which help the model to distinguish between efficient and inefficient code, and Prompt Tuning, a Parameter-Efficient Fine Tuning (PEFT) approach that requires only a fraction of the cost of traditional fine tuning. This study evaluates CPT on Python, Java and C++ coding problems across three different models to provide a comprehensive evaluation. The method achieves consistent improvements in code accuracy for two models but efficiency gains vary by model, language and task complexity, indicating th...

Originally published on April 06, 2026. Curated by AI News.

Related Articles

Llms

Started a video series on building an orchestration layer for LLM post-training [P]

Hi everyone! Context, motivation, a lot of yapping, feel free to skip to TL;DR. A while back I posted here asking [D] What framework do y...

Reddit - Machine Learning · 1 min ·
ChatGPT finally offers $100/month Pro plan
Llms

ChatGPT finally offers $100/month Pro plan

OpenAI announced on Thursday something that power users have been asking for: a $100/month plan. Previously, subscriptions jumped from $2...

TechCrunch - AI · 4 min ·
Anthropic says new Claude Mythos AI is too risky for public use
Llms

Anthropic says new Claude Mythos AI is too risky for public use

Dubbed Claude Mythos, the software is part of the Claude AI family, an artificial intelligence model that can act like a chatbot and AI a...

AI Tools & Products · 10 min ·
ChatGPT has a new $100 per month Pro subscription
Llms

ChatGPT has a new $100 per month Pro subscription

OpenAI has announced a new version of its ChatGPT Pro subscription that costs $100 per month. The new Pro tier offers "5x more" usage of ...

The Verge - AI · 4 min ·
More in Llms: This Week Guide Trending

No comments

No comments yet. Be the first to comment!

Stay updated with AI News

Get the latest news, tools, and insights delivered to your inbox.

Daily or weekly digest • Unsubscribe anytime