US2023325154A1PendingUtilityA1

Constrained decoding and ranking of language models for code generation

Assignee: OUTSYSTEMS – SOFTWARE EM REDE S APriority: Nov 17, 2021Filed: Jun 15, 2023Published: Oct 12, 2023
Est. expiryNov 17, 2041(~15.3 yrs left)· nominal 20-yr term from priority
G06F 8/33G06F 40/284G06F 40/40G06F 8/427G06F 40/274G06F 40/216G06N 20/00
60
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

In various embodiments, a process for constrained decoding and ranking of language models for code generation includes receiving a natural language input specifying a desired computer task. The process includes using a machine learning trained converter to convert the natural language input to an output in a computer language, including by, based on a specified grammar for the computer language, limiting eligible options for a token to include in the output in the computer language. The process includes providing the output in the computer language for computer execution.

Claims

exact text as granted — not AI-modified
What is claimed is: 
     
         1 . A method, comprising:
 receiving a natural language input specifying a desired computer task;   generating a ranked list of computer language outputs;   using a machine learning trained converter to convert the natural language input to an output in a computer language based at least on the ranked list of computer language outputs, including by, based on a specified grammar for the computer language, limiting eligible options for a token to include in the output in the computer language; and   providing the output in the computer language for computer execution.   
     
     
         2 . The method of  claim 1 , wherein using the machine learning trained converter to transform the natural language input to the output in a computer language includes forming a candidate output in the computer language by:
 starting with a first token; and   iteratively concatenating a token from the eligible options.   
     
     
         3 . The method of  claim 2 , wherein generating the ranked list of computer language outputs includes performing beam search to generate a set of computer language outputs including the candidate output. 
     
     
         4 . The method of  claim 2 , wherein:
 the ranked list of computer language outputs is generated using a machine learning trained ranker; and   using the machine learning trained converter to transform the natural language input to the output in a computer language includes selecting at least one computer language output from the ranked list of computer language outputs.   
     
     
         5 . The method of  claim 4 , at least one computer language output is selected based at least on a score determined by the machine learning trained ranker and a score associated with generating the set of candidate computer language outputs. 
     
     
         6 . The method of  claim 4 , wherein performance of the machine learning trained ranker is evaluated including by:
 determining a first abstract syntax tree for a computer language statement generated by the machine learning trained ranker;   determining a second abstract syntax tree for a ground truth computer language statement;   calculating a tree edit distance on the first abstract syntax tree and the second abstract syntax tree;   determining a tree edit distance score based on the calculated tree edit distance; and   determining model performance based on the determined tree edit distance score.   
     
     
         7 . The method of  claim 1 , wherein the specified grammar is pre-defined. 
     
     
         8 . The method of  claim 1 , wherein the specified grammar includes at least one rule specifying a valid table and valid columns permitted to be added to the table. 
     
     
         9 . The method of  claim 1 , wherein using the machine learning trained converter to transform the natural language input to the output in a computer language includes ordering a “from” token to precede a “select” token. 
     
     
         10 . The method of  claim 1 , wherein the natural language input is created using a low-code platform. 
     
     
         11 . The method of  claim 1 , wherein the natural language input is created based at least in part on a suggestion or an auto-completion provided via a user interface. 
     
     
         12 . The method of  claim 11 , wherein the user interface includes a drop-down menu displaying the suggestion or the auto-completion. 
     
     
         13 . The method of  claim 11 , wherein the suggestion or the auto-completion is displayed in real-time in response to a user input of at least a portion of the natural language input. 
     
     
         14 . The method of  claim 11 , wherein the suggestion or the auto-completion is determined based at least in part on valid entities to be searched. 
     
     
         15 . The method of  claim 1 , wherein the natural language input is received via a user interface, and the user interface displays instructions for forming the natural language input. 
     
     
         16 . The method of  claim 1 , wherein the output in the computer language is executable to perform the desired computer task. 
     
     
         17 . The method of  claim 1 , wherein the computer task includes retrieving data from a relational database. 
     
     
         18 . The method of  claim 1 , wherein the output in the computer language includes a Structured Query Language (SQL) statement. 
     
     
         19 . A system, comprising:
 a processor configured to:
 receive a natural language input specifying a desired computer task; 
 generate a ranked list of computer language outputs; 
 use a machine learning trained converter to convert the natural language input to an output in a computer language based at least on the ranked list of computer language outputs, including by, based on a specified grammar for the computer language, limiting eligible options for a token to include in the output in the computer language; and 
 provide the output in the computer language for computer execution; and 
   a memory coupled to the processor and configured to provide the processor with instructions.   
     
     
         20 . A computer program product embodied in a non-transitory computer readable medium and comprising computer instructions for:
 receiving a natural language input specifying a desired computer task;   generating a ranked list of computer language outputs;   using a machine learning trained converter to convert the natural language input to an output in a computer language based at least on the ranked list of computer language outputs, including by, based on a specified grammar for the computer language, limiting eligible options for a token to include in the output in the computer language; and   providing the output in the computer language for computer execution.

Join the waitlist — get patent alerts

Track US2023325154A1 — get alerts on status changes and closely related new filings.

We store only your email — no account needed. See our privacy policy.