IP Library › Granted Patent US 12,475,318
Granted Patent B2
US 12,475,318 · App. 17/814,518 · Granted Nov 18, 2025

Deep parameter learning for code synthesis

Inventors: Mehdi Bahrami (San Jose, CA); Wei-Peng Chen (Fremont, CA)
Assignee: Fujitsu Limited
G06F40/30G06F8/30G06F8/36G06F8/42G06F8/436G06F8/65G06F8/73G06F11/3624G06F16/951G06F18/22G06F18/23213G06F18/285G06F40/166G06F40/211G06F40/216G06F40/242G06F40/40G06F40/44G06N3/04G06N3/08
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,475,318
App. No.
17/814,518
Granted
Nov 18, 2025
Kind
B2
Abstract

According to an aspect of an embodiment, operations for deep parameter learning for code synthesis are provided. The operations may include receiving a source code file and generating an abstract syntax tree (AST). The operations may further include determining a set of classes, and functions/procedures from the computer-executable code and extracting metadata associated to each component. The operations may further include selecting a subset of functions for which descriptions in the extracted metadata satisfy filtering criteria and updating the computer-executable code by filtering lines of code (LoCs) corresponding to the subset of functions/procedures. The operations may further include generating a dataset of code features and respective metadata features that includes a deep connection between parameters and its usage based on the updated computer-executable code and the metadata generation task. The operations may further include training a language model on a sequence-to-sequence generation task, based on the dataset.

Claims (77)

1 . A method, executed by a processor, comprising:

receiving a source code file associated with a software package;

generating an abstract syntax tree (AST) of at least a portion of a computer-executable code included in the source code file, the computer executable code including metadata describing functions of the computer executable code;

determining a set of functions from the computer-executable code, based on the AST;

extracting the metadata associated with the set of functions from the computer-executable code;

determining one or more parameters associated with each of the set of functions;

determining one or more return values associated with each of the set of functions;

detecting a presence of the one or more parameters and the one or more return values in a description of a corresponding function in the metadata;

selecting, from the set of functions based on the detecting, a subset of functions for which descriptions in the extracted metadata satisfy filtering criteria, the filtering criteria requires a description of the selected subset of functions be included in the extracted metadata;

updating the computer-executable code by filtering lines of code (LoCs) corresponding to the subset of functions from the computer-executable code;

generating a dataset of code features and respective metadata features based on the updated computer-executable code and the metadata; and

training a language model on a sequence-to-sequence generation task, based on the dataset.

2 . The method according to claim 1 , further comprising:

receiving a repository address of a package dataset as an input;

extracting a list of software packages from a data source by using the repository address;

selecting the software package from the extracted list of software packages; and

retrieving, from the data source, resource files associated with the selected software package, wherein the retrieved resource files include the source code file.

3 . The method according to claim 1 , further comprising identifying code components from the computer-executable code by using the AST,

wherein the code components include one or more of: classes, methods included in the classes, and functions different from the methods, and

wherein the set of functions corresponds to the methods and the functions included in the code components.

4 . The method according to claim 1 , wherein the metadata comprises at least one of a function name, a count of parameters associated with a function, a count of one or more default parameters associated with the function, a default value of the one or more default parameters, a type of each of the parameters, a description of the function, or one or more decorators associated with the function.

5 . The method according to claim 4 , wherein the description comprises at least one of a description of each of the parameters, a description of a return value associated with the function, a description of the one or more default parameters associated with the function, or a description of an objective of the function.

6 . The method according to claim 1 , wherein the filtering criteria specifies rules of selecting a function from the set of functions, and

the rules include a first rule to determine whether a description is present in the metadata and a second rule to determine whether the description in the metadata includes:

a description of one or more parameters associated with the function, and

a description of one or more return values associated with the function.

7 . The method according to claim 1 , further comprising:

determining nodes corresponding to the subset of functions in the AST;

selecting a node from the determined nodes;

marking the selected node for a pruning operation based on a determination that the selected node corresponds to a code component that is different from a function call with one or more parameters; and

obtaining a revised AST by executing the pruning operation to remove the marked node from the AST.

8 . The method according to claim 7 , wherein the computer-executable code is updated further by:

extracting, from the computer-executable code, a sequence of function calls corresponding to each function of the subset of functions by using the revised AST; and

generating abstracted code data by abstracting the sequence of function calls.

9 . The method according to claim 8 , further comprising determining return values corresponding to each function of the subset of functions from the updated computer-executable code.

10 . The method according to claim 9 , wherein the generated dataset is a dictionary in a key-value format and the dataset includes:

the code features that include the return values and the abstracted code data, and

the metadata features which include respective natural language (NL) text portions of the descriptions corresponding to the subset of functions, class names corresponding to the subset of functions, function names corresponding to the subset of functions, and a path of the source code file.

11 . The method according to claim 1 , wherein the sequence-to-sequence generation task is a code synthesis task, a code retrieval task, or a software package analysis task.

12 . The method according to claim 1 , further comprising:

receiving an input associated with a natural language query; and

generating lines of computer-executable code based on application of the trained language model on the received input.

13 . A non-transitory computer-readable storage medium configured to store instructions that, in response to being executed, causes a system to perform operations, the operations comprising:

receiving a source code file associated with a software package;

generating an abstract syntax tree (AST) of at least a portion of a computer-executable code included in the source code file, the computer executable code including metadata describing functions of the computer executable code;

determining a set of functions from the computer-executable code, based on the AST;

extracting metadata associated with the set of functions from the computer-executable code;

determining one or more parameters associated with each of the set of functions;

determining one or more return values associated with each of the set of functions;

detecting a presence of the one or more parameters and the one or more return values in a description of a corresponding function in the metadata;

selecting, from the set of functions based on the detecting, a subset of functions for which descriptions in the extracted metadata satisfy filtering criteria, the filtering criteria requires a description of the selected subset of functions be included in the extracted metadata;

updating the computer-executable code by filtering lines of code (LoCs) corresponding to the subset of functions from the computer-executable code;

generating a dataset of code features and respective metadata features based on the updated computer-executable code and the metadata; and

training a language model on a sequence-to-sequence generation task, based on the dataset.

14 . The non-transitory computer-readable storage medium according to claim 13 , wherein the operations further comprise:

receiving a repository address of a package dataset as an input;

extracting a list of software packages from a data source by using the repository address;

selecting the software package from the extracted list of software packages; and

retrieving, from the data source, resource files associated with the selected software package, wherein the retrieved resource files include the source code file.

15 . The non-transitory computer-readable storage medium according to claim 13 , wherein the operations further comprise identifying code components from the computer-executable code by using the AST,

wherein the code components include one or more of classes, methods included in the classes, and functions different from the methods, and

wherein the set of functions corresponds to the methods and the functions included in the code components.

16 . The non-transitory computer-readable storage medium according to claim 13 , wherein the metadata comprises at least one of a function name, a count of parameters associated with a function, a count of one or more default parameters associated with the function, a default value of the one or more default parameters, a type of each of the parameters, a description of the function, or one or more decorators associated with the function.

17 . The non-transitory computer-readable storage medium according to claim 16 , wherein the description comprises at least one of a description of each of the parameters, a description of a return value associated with the function, a description of the one or more default parameters associated with the function, or a description of an objective of the function.

18 . A system, comprising:

a processor configured to:

receive a source code file associated with a software package;

generate an abstract syntax tree (AST) of at least a portion of a computer-executable code included in the source code file, the computer executable code including metadata describing functions of the computer executable code;

determine a set of functions from the computer-executable code, based on the AST;

extract metadata associated with the set of functions from the computer-executable code;

determine one or more parameters associated with each of the set of functions;

determine one or more return values associated with each of the set of functions;

detect a presence of the one or more parameters and the one or more return values in a description of a corresponding function in the metadata;

select, from the set of functions based on the detection, a subset of functions for which descriptions in the extracted metadata satisfy filtering criteria, the filtering criteria requires a description of the selected subset of functions be included in the extracted metadata;

update the computer-executable code by filtering lines of code (LoCs) corresponding to the subset of functions from the computer-executable code;

generate a dataset of code features and respective metadata features based on the updated computer-executable code and the metadata; and

train a language model on a sequence-to-sequence generation task, based on the dataset.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 3, 2022
From: BAHRAMI, MEHDI; CHEN, WEI-PENG
To: FUJITSU LIMITED
Reel/Frame 060711/0535 →
Continuity (2)
Provisional Application 63261602 · Sep 24, 2021
Related Publication 20230096325A1 · Mar 30, 2023
References Cited (28)
US 11144725B2 · Luo · 2021 [cited by applicant]
US 11327722B1 · Bahrami et al. · 2022 [cited by applicant]
US 11545134B1 · Federico et al. · 2023 [cited by applicant]
US 20170214701A1 · Hasan · 2017 [cited by examiner]
US 20180024911A1 · Kruszewski · 2018 [cited by examiner]
US 20180373507A1 · Mizrahi · 2018 [cited by examiner]
US 20200349468A1 · Arya et al. · 2020 [cited by applicant]
US 20210191696A1 · Ibarra Von Borstel · 2021 [cited by examiner]
US 20220066747A1 · Drain · 2022 [cited by examiner]
US 20220198294A1 · Schneuwly · 2022 [cited by applicant]
US 20220215167A1 · Rajpathak · 2022 [cited by applicant]
Tuarob, Suppawong et al., “Automatic Tag Recommendation for Metadata Annotation Using Probabilistic Topic Modeling.” Proceedings of the 13th ACM/IEEE-CS Joint Conference on Digital Libraries. 2013, pp. 239-248. (Year: 2… [cited by applicant]
Bernasconi, Anna, et al. “Meta-Base: A Novel Architecture for Large-Scale Genomic Metadata Integration”, IEEE/ACM Transactions on Computational Biology and Bioinformatics, vol. 19, No. 1, pp. 543-557, (Year: 2020). [cited by applicant]
Jones, Matthew B., et al., “Managing Scientific Metadata”, IEEE Internet Computing 5.5, pp. 59-68. (Year: 2001). [cited by applicant]
Yan, Cong et al., “Synthesizing Type-Detection Logic for Rich Semantic Data Types Using Open-Source Code”, SIGMOD'18, Proceedings of the 2018 International Conference on Management of Data, 2018, pp. 35-50, (Year: 2018). [cited by applicant]
U.S. Office Action mailed Dec. 22, 2023 for copending U.S. Appl. No. 17/814,516, 23 pages. [cited by applicant]
Feng, Zhangyin, et al. “Codebert: A pre-trained model for programming and natural languages.” arXiv preprint arXiv:2002.08155 (2020). [cited by applicant]
“CodeXGLUE” retrieved from the Internet: <URL:https://github.com/microsoft/CodeXGLUE>. [cited by applicant]
Yin, Pengcheng, and Graham Neubig. “TRANX: A transition-based neural abstract syntax parser for semantic parsing and code generation.” arXiv preprint arXiv:1810.02720 (2018). [cited by applicant]
Yin, Pengcheng, et al. “Learning to mine aligned code and natural language pairs from stack overflow.” Proceedings of the 15th International Conference on Mining Software Repositories. 2018. arXiv:1805.08949v1 [cs.CL] M… [cited by applicant]
Oda, Yusuke, et al. “Learning to generate pseudo-code from source code using statistical machine translation.” 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 2015. [cited by applicant]
Yin, Pengcheng, and Graham Neubig. “A syntactic neural model for general-purpose code generation.” arXiv preprint arXiv:1704.01696 (2017). [cited by applicant]
CodeXGLUE—Text2Code Generation, retrieved from the Internet: <URL: https://github.com/microsoft/CodeXGLUE/tree/main/Text-Code/text-to-code>. [cited by applicant]
Fudaba, Hiroyuki, et al. “Pseudogen: A tool to automatically generate pseudo-code from source code.” 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 2015. [cited by applicant]
McKay, Cory, and Ichiro Fujinaga. “Improving Automatic Music Classification Performance by Extracting Features from Different Types of Data”, Proceedings of the International Conference on Multimedia Information Retriev… [cited by applicant]
Schober, Daniel, et al. “nmrML: A Community Supported Open Data Standard for the Description, Storage, and Exchange of NMR Data”, Analytical Chemistry 90.1 (2018): pp. 649-656, ACS publications. [cited by applicant]
Albrecht, Felipe, et al. “Deep Blue epigenomic data server: programmatic data retrieval and analysis of epigenome region sets”, Nucleic acids research 44.W1 (2016), pp. W581-W586. [cited by applicant]
USPTO—Notice of Allowance mailed on Jun. 6, 2024 for related U.S. Appl. No. 17/814,516 (allowed). [cited by applicant]