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

All GreenCode Tech Tips

  • Tip #9
  • For CTOs and technical leads
  • Category Code efficiency
  • Format short video
GreenCode

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

Get in touch