IP Library › Granted Patent US 12,602,214
Granted Patent B2
US 12,602,214 · App. 18/470,855 · Granted Apr 14, 2026

Dynamic evaluation and improvement of energy efficiency of computer code

Inventors: Koushik M. Vijayaraghavan (Chennai, IN); Jeffson Felix Dsouza (Bangalore, IN); Pradeep Kumar Senapati (Bangalore, IN); Ilangovan Sivakumar (Chennai, IN); Dibyendu Chattopadhyay (North Twenty Four Pargana, IN)
Assignee: ACCENTURE GLOBAL SOLUTIONS LIMITED
G06F8/4432G06F8/75G06F8/77G06F11/3604G06N3/044G06N3/045
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,602,214
App. No.
18/470,855
Granted
Apr 14, 2026
Kind
B2
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 (66)

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,

wherein each of the first embedding machine-learning model and the second embedding machine-learning model comprises a respective language model, and

wherein the first embedding machine-learning model comprises a first Long Short-Term Memory (LSTM) network with a higher drop rate than a second LSTM network of the second embedding machine-learning model.

2 . 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.

3 . 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.

4 . 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.

5 . 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.

6 . 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.

7 . The method of claim 1 , 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.

8 . 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.

9 . The method of claim 8 , 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.

10 . The method of claim 9 , wherein obtaining the plurality of training examples comprises:

searching a code repository for a set of code snippets that are similar to an input computer code snippet.

11 . A system comprising:

one or more memories, and

one or more computers, coupled to the one or more memories, configured to:

obtain code data characterizing a computer code snippet to be executed by a computing device;

obtain rule data characterizing one or more energy efficiency rules;

generate a first input from the code data and a second input from the rule data;

process the first input using a first embedding machine-learning model to generate a first embedding feature vector for the computer code snippet;

process 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;

process (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

perform an action based on the detection output,

wherein each of the first embedding machine-learning model and the second embedding machine-learning model comprises a respective language model, and

wherein the first embedding machine-learning model comprises a first Long Short-Term Memory (LSTM) network with a higher drop rate than a second LSTM network of the second embedding machine-learning model.

12 . The system of claim 11 , 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 dynamic energy efficiency score and (ii) a static energy efficiency score computed for the computer code snippet; and

outputting the comprehensive energy efficiency score.

13 . The system of claim 11 , 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.

14 . The system of claim 11 , 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.

15 . The system of claim 14 , 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.

16 . A non-transitory 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,

wherein each of the first embedding machine-learning model and the second embedding machine-learning model comprises a respective language model, and

wherein the first embedding machine-learning model comprises a first Long Short-Term Memory (LSTM) network with a higher drop rate than a second LSTM network of the second embedding machine-learning model.

17 . The non-transitory computer-readable storage media of claim 16 , 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 dynamic energy efficiency score and (ii) a static energy efficiency score computed for the computer code snippet; and

outputting the comprehensive energy efficiency score.

18 . The non-transitory computer-readable storage media of claim 16 , 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.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 14, 2024
From: VIJAYARAGHAVAN, KOUSHIK M.; DSOUZA, JEFFSON FELIX; SENAPATI, PRADEEP KUMAR; SIVAKUMAR, ILANGOVAN; CHATTOPADHYAY, DIBYENDU
To: ACCENTURE GLOBAL SOLUTIONS LIMITED
Reel/Frame 068282/0185 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 20, 2023
From: VIJAYARAGHAVAN, KOUSHIK M.; DSOUZA, JEFFSON FELIX; SENAPATI, PRADEEP KUMAR; SIVAKUMAR, ILANGOVAN; CHATTOPADHYAY, DIBYENDU
To: ACCENTURE GLOBAL SOLUTIONS LIMITED
Reel/Frame 064973/0534 →
Continuity (1)
Related Publication 20250094146A1 · Mar 20, 2025
References Cited (11)
US 20210208855A1 · Zhang et al. · 2021 [cited by applicant]
US 20210357307A1 · Deng et al. · 2021 [cited by applicant]
US 20240319993A1 · Penrose · 2024 [cited by examiner]
CN 115952076A · 2023 [cited by applicant]
EP 4513327A1 · 2025 [cited by examiner]
WO WO2021119601A1 · 2021 [cited by examiner]
Bourdon et al., “PowerAPI: A Software Library to Monitor the Energy Consumed at the Process-Level,” ERCIM News, Jan. 2013, 92:43-44. [cited by applicant]
Brown et al., “Language Models are Few-Shot Learners,” CoRR, submitted on Jul. 20, 2020, arXiv:2005.14165v4, 75 pages. [cited by applicant]
Businesswire.com [online], “CAST Launches ‘Green IT Index’ to Measure Inefficient Software,” Aug. 4, 2014, retrieved on Jan. 23, 2024, retrieved from URL<https://www.businesswire.com/news/home/20140804005132/en/CAST-Lau… [cited by applicant]
Truong Giang Nguyen et al. “Multi-Granularity Detector For Vulnerability Fixes”, IEEE Transactions On Software Engineering, vol. 49, No. 8, Aug. 1, 2023, pp. 4035-4057. [cited by applicant]
Yan Xiao et al. “Improving bug localization with word embedding and enhanced convolutional neural networks”, Information and Software Technology, Elsevier, Amsterdam,NL, vol. 105, Aug. 15, 2018, pp. 17-29. [cited by applicant]