Tech Tip #9: An AI agent saved a quarter of the energy

An AI agent saved a quarter of the energy, on average.

Video created by explainapaper.com

The problem

Energy optimisation sounds like specialist work for a few hot loops. GreenCode's Constitution research applied one method across 45 algorithmic problems in six programming languages.

The fix you can use today

  • Give your team (or your AI agent) a ranked list of anti-patterns to look for.
  • Measure a baseline with hardware counters, fix, and re-measure.
  • Keep only the changes that save energy and pass every test.

GreenCode researchers found that an AI agent with energy rules saved 25.1% of the energy across 45 problems.

Tools that help

  • GreenCode Constitution skill (GreenCode researchers): open-source energy principles and a catalogue of 37 energy anti-patterns that an AI coding agent can follow to find and fix waste like this
  • GreenCode Constitution profiler (profile.sh) (GreenCode researchers): a script from the Constitution tooling that measures the energy of a command from processor counters, GPU sensors and an optional smart plug, and writes the result as JSON
  • green-languages (GreenCode researchers): a command-line tool that measures the energy of whole programs or marked sections of code, across languages

How GreenCode helps

GreenCode helps tackle this by publishing the method, the Constitution, for anyone to use. An AI agent profiles the code, fixes ranked energy anti-patterns, measures again and keeps only changes that save energy, leaving changes developers can review. More on this.

Tags

#llm#refactoring#measurement

Sources

Transcript

An AI agent saved a quarter of the energy, on average. That was across forty-five coding problems, in six programming languages. GreenCode researchers found this with an AI agent that follows energy rules. Saving energy in code sounds like work for rare experts. Something you only do for a few very busy loops. The researchers used one repeatable method on every problem instead. The agent measured the code, fixed the waste, then measured again. It kept only the changes that saved energy. No heroics. Just a method. Here is the fix you can use today. Give your team, or your AI agent, a ranked list of waste to look for. GreenCode's Constitution skill gives an agent that list: thirty-seven kinds of energy waste. Measure a starting point, using tools like its profiler or GreenCode's green-languages. Fix one thing, then measure again. Keep only changes that save energy and pass every test. GreenCode helps tackle this by publishing the method for anyone to use. Developers get changes they can review, not a black box. That was GreenCode Tech Tip number nine. Follow for the next tip, and find more on greencode.ai/tech-tips.

All GreenCode Tech Tips · All GreenCode videos

  • Tip #9
  • For CTOs and technical leads
  • Length 1:15
  • Category Code efficiency
GreenCode

Want this checked on your own system? Talk to the GreenCode team.

Get in touch