# US 2025/0094146 A1 · Dynamic evaluation and improvement of energy efficiency of computer code

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0094146 A1
- Document ID: US20250094146A1
- Status: Published application
- Kind: A1
- Application number: 18/470,855
- Filed: 2023-09-20
- Published: 2025-03-20
- Earliest claimed: 2023-09-20
- Assignees: Accenture Global Solutions Limited
- Applicants: Accenture Global Solutions Limited
- Inventors: Koushik M. Vijayaraghavan; Jeffson Felix Dsouza; Pradeep Kumar Senapati; Ilangovan Sivakumar; Dibyendu Chattopadhyay
- Web page: https://patentgrep.com/patent/US20250094146A1

## CPC

- G06F 8/4432: {Reducing the energy consumption}
- G06F 8/75: Structural analysis for program understanding
- G06F 8/77: Software metrics
- G06F 11/3604: Analysis of software for verifying properties of programs (testing of software G06F11/3668)
- G06N 3/044: Recurrent networks, e.g. Hopfield networks
- G06N 3/045: Combinations of networks
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Methods, computer systems, and apparatus, including computer programs encoded on computer storage media, for evaluating an energy efficiency of a computer code snippet. A computer-implemented system obtains code data characterizing a computer code snippet and rule data characterizing one or more energy efficiency rules, and processes the code data and rule data using machine-learning models to detect energy efficiency defects in the computer code snippet that negatively impact a dynamic energy efficiency of the computer code snippet upon execution by the computing device.

## Claims

### Claim 1

A computer-implemented method, comprising:
obtaining code data characterizing a computer code snippet to be executed by a computing device;
obtaining rule data characterizing one or more energy efficiency rules;
generating a first input from the code data and a second input from the rule data;
processing the first input using a first embedding machine-learning model to generate a first embedding feature vector for the computer code snippet;
processing the second input using a second embedding machine-learning model to generate a second embedding feature vector for the one or more energy efficiency rules;
processing (i) the first embedding feature vector and (ii) the second embedding feature vector using a code defect detection machine-learning model to generate a detection output comprising data representing one or more portions of the computer code snippet that negatively impact a dynamic energy efficiency of the computer code snippet upon execution by the computing device; and
performing an action based on the detection output.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
determining a dynamic energy efficiency score for the computer code snippet based on the detection output;
determining a comprehensive energy efficiency score based at least on (i) the predicted dynamic energy efficiency score and (ii) a static energy efficiency score computed for the computer code snippet; and
outputting the comprehensive energy efficiency score.

### Claim 3 (depends on 2)

The method of claim 2, wherein the dynamic energy efficiency score is determined based at least on (i) a number of defects characterized by the detection output and (ii) a respective priority of each of defects characterized by the detection output.

### Claim 4 (depends on 2)

The method of claim 2, wherein the method further comprises obtaining assessment data characterizing a user assessment on one or more of (i) software, (ii) environment, or (iii) data demographics of the computer code snippet, and the comprehensive energy efficiency score is determined further based on the assessment data.

### Claim 5 (depends on 1)

The method of claim 1, wherein performing the action comprises:
determining, using the detection output, a recommendation that specifies one or more updates to the computer code snippet for improving the energy efficiency of the computer code snippet.

### Claim 6 (depends on 1)

The method of claim 1, wherein the code data comprises data specifying (i) prefixes and postfixes of the computer code snippet and (ii) code commit of the computer code snippet.

### Claim 7 (depends on 1)

The method of claim 1, wherein each of the first embedding machine-learning model and the second embedding machine-learning model comprises a respective language model.

### Claim 8 (depends on 7)

The method of claim 7, wherein each of the first embedding machine-learning model and the second embedding machine-learning model comprises a respective bidirectional Long Short-Term Memory (LSTM) network.

### Claim 9 (depends on 7)

The method of claim 7, wherein the first embedding machine-learning model comprises a first LSTM network with a higher drop rate than a second LSTM network of the second embedding machine-learning model.

### Claim 10 (depends on 1)

The method of claim 1, wherein the code defect detection machine-learning model comprises a discriminator network that has been trained together with a generative network configured to generate energy defects for code snippets.

### Claim 11 (depends on 10)

The method of claim 10, further comprising training the discriminator network with the generative network, comprising:
obtaining a plurality of training examples, each training example comprising (i) a respective training input comprising data characterizing a training code snippet and (ii) respective data characterizing commit comments for fixing energy defects of the training code snippet;
generating processed training data by processing each training example using the embedding machine-learning models; and
training the discriminator network with the generative network as a generative adversarial networks (GANs) model.

### Claim 12 (depends on 11)

The method of claim 11, wherein obtaining the plurality of training examples comprising:
searching a code repository for a set of code snippets that are similar to the input computer code snippet.

### Claim 13

A system comprising one or more computers and one or more storage devices storing instructions that when executed by the one or more computers, cause the one or more computers to perform operations comprising:
obtaining code data characterizing a computer code snippet to be executed by a computing device;
obtaining rule data characterizing one or more energy efficiency rules;
generating a first input from the code data and a second input from the rule data;
processing the first input using a first embedding machine-learning model to generate a first embedding feature vector for the computer code snippet;
processing the second input using a second embedding machine-learning model to generate a second embedding feature vector for the one or more energy efficiency rules;
processing (i) the first embedding feature vector and (ii) the second embedding feature vector using a code defect detection machine-learning model to generate a detection output comprising data representing one or more portions of the computer code snippet that negatively impact a dynamic energy efficiency of the computer code snippet upon execution by the computing device; and
performing an action based on the detection output.

### Claim 14 (depends on 13)

The system of claim 13, wherein the operations further comprise:
determining a dynamic energy efficiency score for the computer code snippet based on the detection output;
determining a comprehensive energy efficiency score based at least on (i) the predicted dynamic energy efficiency score and (ii) a static energy efficiency score computed for the computer code snippet; and
outputting the comprehensive energy efficiency score.

### Claim 15 (depends on 13)

The system of claim 13, wherein performing the action comprises:
determining, using the detection output, a recommendation that specifies one or more updates to the computer code snippet for improving the energy efficiency of the computer code snippet.

### Claim 16 (depends on 13)

The system of claim 13, wherein the code defect detection machine-learning model comprises a discriminator network that has been trained together with a generative network configured to generate energy defects for code snippets.

### Claim 17 (depends on 16)

The system of claim 16, wherein the operations further comprise training the discriminator network with the generative network, comprising:
obtaining a plurality of training examples, each training example comprising (i) a respective training input comprising data characterizing a training code snippet and (ii) respective data characterizing commit comments for fixing energy defects of the training code snippet;
generating processed training data by processing each training example using the embedding machine-learning models; and
training the discriminator network with the generative network as a generative adversarial networks (GANs) model.

### Claim 18

One or more computer-readable storage media storing instructions that, when executed by one or more computers, cause the one or more computers to perform operations comprising:
obtaining code data characterizing a computer code snippet to be executed by a computing device;
obtaining rule data characterizing one or more energy efficiency rules;
generating a first input from the code data and a second input from the rule data;
processing the first input using a first embedding machine-learning model to generate a first embedding feature vector for the computer code snippet;
processing the second input using a second embedding machine-learning model to generate a second embedding feature vector for the one or more energy efficiency rules;
processing (i) the first embedding feature vector and (ii) the second embedding feature vector using a code defect detection machine-learning model to generate a detection output comprising data representing one or more portions of the computer code snippet that negatively impact a dynamic energy efficiency of the computer code snippet upon execution by the computing device; and
performing an action based on the detection output.

### Claim 19 (depends on 18)

The one or more computer-readable storage media of claim 18, wherein the operations further comprise:
determining a dynamic energy efficiency score for the computer code snippet based on the detection output;
determining a comprehensive energy efficiency score based at least on (i) the predicted dynamic energy efficiency score and (ii) a static energy efficiency score computed for the computer code snippet; and
outputting the comprehensive energy efficiency score.

### Claim 20 (depends on 18)

The one or more computer-readable storage media of claim 18, wherein performing the action comprises:
determining, using the detection output, a recommendation that specifies one or more updates to the computer code snippet for improving the energy efficiency of the computer code snippet.
