IP Library › Granted Patent US 12,547,387
Granted Patent B2
US 12,547,387 · App. 18/099,061 · Granted Feb 10, 2026

Detecting code anomalies in source code using machine learning techniques

Inventors: David C. Sydow (Merrimack, NH); Anil Kumar Koluguri (Durham, NC); Shreyans Jasoriya (Brighton, MA); Songlin Hou (Worcester, MA); Gajanan S. Natu (Cary, NC)
Assignee: Dell Products L.P.
G06F8/43G06F8/42
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,547,387
App. No.
18/099,061
Granted
Feb 10, 2026
Kind
B2
Abstract

Methods, apparatus, and processor-readable storage media for detecting code anomalies using machine learning techniques are provided herein. An example computer-implemented method includes parsing source code from at least one code repository to create a plurality of tokens based on a syntax corresponding to a programming language of the source code; processing the plurality of tokens using a first machine learning model to create a corresponding plurality of input embeddings; processing the plurality of input embeddings using a second machine learning model, wherein the second machine learning model is configured to detect one or more code anomalies across a plurality of programming languages and trained based at least in part on a training dataset corresponding to the at least one code repository; and causing one or more automated actions to be performed in response to the second machine learning model detecting at least one anomaly in the source code.

Claims (43)

1 . A computer-implemented method comprising:

parsing source code from at least one code repository;

tokenizing the parsed source code to create a plurality of tokens based at least in part on a syntax corresponding to a programming language of the source code, wherein the tokenizing comprises replacing portions of the parsed source code corresponding to the syntax of the programming language with corresponding natural language tokens;

processing the plurality of tokens using a first machine learning model to create a corresponding plurality of input embeddings;

processing the plurality of input embeddings using a second machine learning model, wherein the second machine learning model is configured to detect one or more code anomalies across a plurality of programming languages and trained based at least in part on a training dataset corresponding to the at least one code repository; and

causing one or more automated actions to be performed in response to the second machine learning model detecting at least one anomaly in the source code;

wherein the method is performed by at least one processing device comprising a processor coupled to a memory.

2 . The computer-implemented method of claim 1 , wherein the first machine learning model comprises at least one of a skip-gram neural network model and a transformer-based model.

3 . The computer-implemented method of claim 1 , wherein the second machine learning model sequentially processes the plurality of input embeddings, wherein a given input embedding is processed to consider a context of the given input embedding with respect to one or more other input embeddings in the plurality of input embeddings.

4 . The computer-implemented method of claim 1 , wherein the second machine learning model comprises at least one of a sequential machine learning model, a long short-term memory model, and a transformer-based model.

5 . The computer-implemented method of claim 1 , wherein the source code corresponds to a first version of at least one application, and wherein the training dataset is generated based at least in part on source code corresponding to at least one other version of the at least one application.

6 . The computer-implemented method of claim 1 , wherein the training dataset is generated based at least in part on source code corresponding to one or more open source applications having one or more known anomalies.

7 . The computer-implemented method of claim 1 , wherein the one or more code anomalies correspond to at least one of a syntax anomaly and a logical anomaly.

8 . The computer-implemented method of claim 1 , wherein at least one of:

the parsing comprises removing one or more comments from the source code; and

the tokenizing comprises replacing at least one constant value in the source code with a generic token, wherein the generic token is based at least in part on a type of the at least one constant value.

9 . The computer-implemented method of claim 1 , wherein the one or more automated actions comprise at least one of:

modifying a portion of the source code to mitigate the detected at least one anomaly;

outputting information corresponding to the detected at least one anomaly to at least one integrated developer environment; and

automatically creating a ticket in a ticket tracking system comprising information corresponding to the detected at least one anomaly.

10 . The computer-implemented method of claim 1 , wherein the source code is retrieved from a source code repository and comprises a set of code changes for at least one application.

11 . The computer-implemented method of claim 1 , wherein a given one of the corresponding natural language tokens comprises a natural language description of the corresponding portion of the parsed source code.

12 . A non-transitory processor-readable storage medium having stored therein program code of one or more software programs, wherein the program code when executed by at least one processing device causes the at least one processing device:

to parse source code from at least one code repository;

to tokenize the parsed source code to create a plurality of tokens based at least in part on a syntax corresponding to a programming language of the source code, wherein the tokenizing comprises replacing portions of the parsed source code corresponding to the syntax of the programming language with corresponding natural language tokens;

to process the plurality of tokens using a first machine learning model to create a corresponding plurality of input embeddings;

to process the plurality of input embeddings using a second machine learning model, wherein the second machine learning model is configured to detect one or more code anomalies across a plurality of programming languages and trained based at least in part on a training dataset corresponding to the at least one code repository; and

to cause one or more automated actions to be performed in response to the second machine learning model detecting at least one anomaly in the source code.

13 . The non-transitory processor-readable storage medium of claim 12 , wherein the first machine learning model comprises at least one of a skip-gram neural network model and a transformer-based model.

14 . The non-transitory processor-readable storage medium of claim 12 , wherein the second machine learning model sequentially processes the plurality of input embeddings, wherein a given input embedding is processed to consider a context of the given input embedding with respect to one or more other input embeddings in the plurality of input embeddings.

15 . The non-transitory processor-readable storage medium of claim 12 , wherein the second machine learning model comprises at least one of a sequential machine learning model, a long short-term memory model, and a transformer-based model.

16 . The non-transitory processor-readable storage medium of claim 12 , wherein the source code corresponds to a first version of at least one application, and wherein the training dataset is generated based at least in part on source code corresponding to at least one other version of the at least one application.

17 . An apparatus comprising:

at least one processing device comprising a processor coupled to a memory;

the at least one processing device being configured:

to parse source code from at least one code repository;

to tokenize the parsed source code to create a plurality of tokens based at least in part on a syntax corresponding to a programming language of the source code, wherein the tokenizing comprises replacing portions of the parsed source code corresponding to the syntax of the programming language with corresponding natural language tokens;

to process the plurality of tokens using a first machine learning model to create a corresponding plurality of input embeddings;

to process the plurality of input embeddings using a second machine learning model, wherein the second machine learning model is configured to detect one or more code anomalies across a plurality of programming languages and trained based at least in part on a training dataset corresponding to the at least one code repository; and

to cause one or more automated actions to be performed in response to the second machine learning model detecting at least one anomaly in the source code.

18 . The apparatus of claim 17 , wherein the first machine learning model comprises at least one of a skip-gram neural network model and a transformer-based model.

19 . The apparatus of claim 17 , wherein the second machine learning model sequentially processes the plurality of input embeddings, wherein a given input embedding is processed to consider a context of the given input embedding with respect to one or more other input embeddings in the plurality of input embeddings.

20 . The apparatus of claim 17 , wherein the second machine learning model comprises at least one of a sequential machine learning model, a long short-term memory model, and a transformer-based model.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 19, 2023
From: SYDOW, DAVID C.; KOLUGURI, ANIL KUMAR; JASORIYA, SHREYANS; HOU, SONGLIN; NATU, GAJANAN S.
To: DELL PRODUCTS L.P.
Reel/Frame 062426/0570 →
Continuity (1)
Related Publication 20240265101A1 · Aug 8, 2024
References Cited (9)
US 20190228319A1 · Gupta · 2019 [cited by examiner]
US 20210240453A1 · Badlani · 2021 [cited by examiner]
US 20210271587A1 · Miller · 2021 [cited by examiner]
US 20240028740A1 · Chan · 2024 [cited by examiner]
Sonnekabl “Machine-Learning Supported Vulnerability Detection in Source Code” (Year: 2019). [cited by examiner]
Sharma et al., “A Survey on Machine Learning Techniques for Source Code Analysis” (Year: 2022). [cited by examiner]
Li, Zhiyu, et al. “Automating Code Review Activities by Large-Scale Pre-Training”, available at: https://arxiv.org/pdf/2203.09095.pdf (last accessed Jan. 19, 2023), Oct. 11, 2022. [cited by applicant]
Feng, Zhangyin, et al. “CodeBERT: A Pre-Trained Model for Programming and Natural Languages” available at: https://arxiv.org/pdf/2002.08155.pdf (last accessed Jan. 19, 2023), Sep. 18, 2020. [cited by applicant]
Transformer (machine learning model), https://en.wikipedia.org/w/index.php?title=Transformer_(machine_learning_model)&oldid=1134553101 (last visited Jan. 19, 2023). [cited by applicant]