IP Library Granted Patent US 12,475,378
Granted Patent B2
US 12,475,378 · App. 17/464,462 · Granted Nov 18, 2025

Neural transformer code completion for command line interface

Inventors: Yevhen Mohylevskyy (Redmond, WA); Alexey Svyatkovskiy (Bellevue, WA); Roshanak Zilouchian Moghaddam (Kirkland, WA)
G06N3/088G06F9/451G06N3/04
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,378
App. No.
17/464,462
Granted
Nov 18, 2025
Kind
B2
Abstract

A code completion system for a CLI utilizes neural transformer models with attention to generate candidates to complete a line of CLI code. The code completion system uses a first deep learning model to predict at most k candidate command names to follow n immediately preceding lines of CLI code which are presented to a developer. Upon the developer accepting one of the candidate command names, the code completion system uses a second deep learning model to predict at most k parameter strings to complete the line of CLI code.

Claims (43)

1 . A system comprising:

one or more processors; and

a memory that stores one or more programs that are configured to be executed by the one or more processors, the one or more programs including instructions to perform actions to:

track lines of command line interface (CLI) code entered into a user interface, wherein a line of CLI code comprises a command name and a parameter string, wherein the parameter string comprises including zero or one or more parameters, wherein a parameter comprises a parameter value;

acquire n consecutive lines of CLI code from the user interface immediately preceding a current position in the user interface;

cause a first deep learning model to generate k model-generated command names given the n consecutive lines of CLI code;

present the k model-generated command names in the user interface;

retrieve a user-selected one of the k model-generated command names;

cause a second deep learning model to generate a parameter string given the user-selected command name and the n consecutive lines of CLI code, wherein the parameter string completes the user-selected command name into a syntactically-correct line of CLI code, wherein the first deep learning model and the second deep learning model differ;

output the user-selected command name and the model-generated parameter string as a syntactically-correct line of CLI code; and

upon user selection of the syntactically-correct line of CLI code, input the syntactically-correct line of CLI code into the CLI.

2 . The system of claim 1 , wherein the syntactically-correct line of CLI code spans several physical lines in the CLI.

3 . The system of claim 1 , wherein the n consecutive lines of CLI code are based on a number of lines of CLI code used to train the first deep learning model and/or the second deep learning model.

4 . The system of claim 1 , wherein the first deep learning model is based on a pre-trained encoder model having been trained on an unsupervised training dataset of source code programs from different programming languages using a masked language objective and fine-tuned on a supervised training dataset of CLI code snippets.

5 . The system of claim 1 , wherein the second deep learning model is based on a pre-trained decoder model having been trained on an unsupervised training dataset of source code programs from different programming languages and fine-tuned on a supervised training dataset of CLI code snippets.

6 . The system of claim 1 , wherein the first deep learning model is an encoder-only neural transformer model with attention.

7 . The system of claim 1 , wherein the second deep learning model is a decoder-only neural transformer model with attention.

8 . A hardware storage device having stored thereon computer executable instructions that are structured to be executable by a processor of a computing device to thereby cause the computing device to perform actions that:

track lines of command line interface (CLI) code entered into a CLI, wherein a line of CLI code comprises a command name followed by zero or one or more parameter strings;

cause a first deep learning model to generate a model-generated command name to follow a set of previous lines of CLI code entered into the CLI given the set of previous lines of CLI code;

output the model-generated command name in a user interface;

upon user input selecting the model-generated command name, cause a second deep learning model to generate a model-generated parameter string to follow the model-generated command name given the model-generated command name and the set of previous lines of CLI code entered into the CLI;

output the predicted command name and predicted parameter string as a syntactically-correct line of CLI code; and

upon user input selecting the syntactically-correct line of CLI code, input the syntactically-correct line of CLI code into the CLI.

9 . The hardware storage device of claim 8 , wherein the first deep learning model is generated from a pre-trained encoder model trained on an unsupervised dataset of source code snippets from a plurality of programming languages using a span masking objective and fine-tuned as a classifier using a supervised dataset of CLI code snippets to predict the command name.

10 . The hardware storage device of claim 8 , wherein the second deep learning model is generated from a pre-trained decoder model trained on an unsupervised dataset of source code snippets from a plurality of programming language using a conditional probability objective and fine-tuned on a supervised dataset of CLI code snippets.

11 . The hardware storage device of claim 8 , wherein the first deep learning model is an encoder-only neural transformer model with attention.

12 . The hardware storage device of claim 8 , wherein the second deep learning model is a decoder-only neural transformer model with attention.

13 . A computer-implemented method, comprising:

receiving last n lines of CLI code entered into the CLI;

causing a first deep learning model to generate k command names of CLI commands having a highest likelihood to follow the last n lines entered into the CLI as a syntactically-correct line of CLI code, wherein the deep learning model is given the last n lines of CLI code entered into the CLI;

outputting the k command names of the CLI commands to the CLI;

receiving a user selection of one of the k commands names of the CLI commands;

causing a second deep learning model to generate a parameter string to follow the user-selected one of the k command names given the user-selected one of the k command names;

presenting the user-selected command name and the parameter string as the syntactically-correct line of CLI code; and

upon user selection of the syntactically-correct line of CLI code, inputting the syntactically-correct line of CLI code into the CLI.

14 . The computer-implemented method of claim 13 , wherein the first deep learning model is pre-trained to generate the k command names to follow the last n lines of CLI code on an unsupervised dataset of source code snippets from a plurality of programming languages using a span masking objective.

15 . The computer-implemented method of claim 14 , wherein the pre-trained first deep learning model is fine-tuned on a supervised dataset of CLI code snippets to learn to generate a target command name.

16 . The computer-implemented method of claim 13 , wherein the n lines of CLI code are based on a number of lines of CLI code used to train the first deep learning model and/or the second deep learning model.

17 . The computer-implemented method of claim 13 , wherein the first deep learning model is an encoder-only neural transformer model with attention.

18 . The computer-implemented method of claim 13 , wherein the second deep learning model is based on a pre-trained decoder model having been trained on an unsupervised training dataset of source code programs from different programming languages.

19 . The computer-implemented method of claim 18 , wherein the second deep learning model is fine-tuned on a supervised training dataset of CLI code snippets.

20 . The computer-implemented method of claim 13 , wherein the second deep learning model is a decoder-only neural transformer model with attention.

Assignments (2)
CORRECTIVE ASSIGNMENT TO CORRECT THE SPELLING OF THE NAME OF ALEXEY SVYATKOVSKIY PREVIOUSLY RECORDED AT REEL: 057362 FRAME: 0669. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Sep 6, 2021
From: MOHYLEVSKYY, YEVHEN; SVYATKOVSKIY, ALEXEY; ZILOUCHIAN MOGHADDAM, ROSHANAK
To: MICROSOFT TECHNOLOGY LICENSING,LLC.
Reel/Frame 057423/0600 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 2, 2021
From: MOHYLEVSKYY, YEVHEN; SVYTAKOVSKIY, ALEXEY; ZILOUCHIAN MOGHADDAM, ROSHANAK
To: MICROSOFT TECHNOLOGY LICENSING, LLC.
Reel/Frame 057362/0669 →
Continuity (1)
Related Publication 20230073052A1 · Mar 9, 2023
References Cited (14)
US 11442702B2 · Smith · 2022 [cited by examiner]
US 20040117380A1 · Perrow · 2004 [cited by examiner]
US 20170109356A1 · Sawal · 2017 [cited by examiner]
US 20170270091A1 · Singh · 2017 [cited by examiner]
US 20200272426A1 · Fu · 2020 [cited by examiner]
US 20200311538A1 · Wu · 2020 [cited by examiner]
CN 109298993A · 2019 [cited by examiner]
WO 2020096820A1 · 2020 [cited by applicant]
Devlin, et al., “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding.” (Year: 2019). [cited by examiner]
Singh, et al., “Predictive Approaches for the UNIX Command Line: curating and exploiting domain knowledge in semantics deficit data.” (Year: 2020). [cited by examiner]
Joshi, et al., “SpanBERT: Improving Pre-training by Representing and Predicting Spans” (Year: 2020). [cited by examiner]
Svyatkovskiy, et al., “IntelliCode Compose: Code Generation using Transformer” (Year: 2020). [cited by examiner]
“International Search Report and Written Opinion Issued in PCT Application No. PCT/US22/036599”, Mailed Date: Oct. 25, 2022, 17 Pages. [cited by applicant]
Singh, et al., “Predictive Approaches for the UNIX Command Line: Curating and Exploiting Domain Knowledge in Semantics Deficit Data”, In Journal of Multimedia Tools and Applications, vol. 80, Issue 6, Nov. 9, 2020, pp. … [cited by applicant]