Multi-lingual line-of-code completion system

US2024028306A1 · US · A1

Patent metadata
FieldValue
Publication numberUS-2024028306-A1
Application numberUS-202318232326-A
CountryUS
Kind codeA1
Filing dateAug 9, 2023
Priority dateAug 1, 2019
Publication dateJan 25, 2024
Grant date

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

A code completion tool uses a neural transformer model to generate candidate sequences to complete a line of source code. The neural transformer model is trained using a conditional language modeling objective on a large unsupervised dataset that includes source code programs written in several different programming languages. The neural transformer model is used within a beam search that predicts the most likely candidate sequences for a code snippet under development.

First claim

Opening claim text (preview).

1 . (canceled) 2 . A system comprising: a processor; and a memory that stores a program that is configured to be executed by the processor, wherein the program comprises instructions to perform actions that: continuously track characters entered into a source code program during an editing process; and at a position in a line of the source code program, detect a partially-formed line of source code; search for at least one candidate sequence to complete the line of source code, wherein the at least one candidate sequence comprises a sequence of source code tokens, wherein the search generates the at least one candidate sequence to complete the line of source code based on a conditional probability generated by a neural transformer model with attention at each time step of the search, wherein the conditional probability indicates a likelihood of a next source code token to follow preceding source code tokens in a candidate sequence, wherein the neural transformer model with attention is given a context of the line of source code, wherein the neural transformer model with attention is trained to learn the syntax and relationships between code elements of different programming languages; and output the at least one candidate sequence for user selection in a user interface of the editing process. 3 . The system of claim 2 , wherein the program includes further instructions that when executed by the processor perform actions that: detect the partially-formed line of source code based on a current cursor position. 4 . The system of claim 3 , wherein the search performs a beam search to generate the at least one candidate sequence. 5 . The system of claim 2 , wherein the program includes further instructions that when executed by the processor performs actions that: transform the context of the line of source code into a sequence of token embeddings; and input the sequence of token embeddings to the neural transformer model with attention. 6 . The system of claim 5 , wherein the program includes further instructions that when executed by the processor performs actions that: output by the neural transformer model with attention at each time step a plurality of hidden state vectors; and generate predicted embedding vectors as a product of the plurality of hidden state vectors with a linear projection layer. 7 . The system of claim 6 , wherein the program includes further instructions that when executed by the processor performs actions that: generate a plurality of logits as a product of the predicted embedding vectors and the token embeddings. 8 . The system of claim 7 , wherein the program includes further instructions that when executed by the processor performs actions that: normalize the plurality of logits into a probability distribution. 9 . The system of claim 2 , wherein the search is a beam search and wherein the at least one candidate sequence comprises top-k candidate sequences. 10 . A computer-implemented method, comprising: monitoring each token input into a source code program in a source code development session; iteratively executing a beam search to generate at least one candidate to complete a partially-formed line of source code in the source code program, wherein the at least one candidate comprises a plurality of tokens, wherein the beam search generates a token, at each time step, to include a new token in the at least one candidate using token probabilities generated from a neural transformer model with attention, wherein the neural transformer model with attention is given a context of the partially-formed line of source code, wherein the neural transformer model with attention is trained on a plurality of multi-lingual source code programs; and outputting the at least one candidate upon an end-of-line token predicted as having a highest probability to input into the at least one candidate. 11 . The computer-implemented method of claim 10 , comprising: detecting the partially-formed line of source code based on a position of a cursor in the source code development session. 12 . The computer-implemented method of claim 11 , wherein the context comprises a sequence of token embeddings and a sequence of positional embeddings. 13 . The computer-implemented method of claim 12 , comprising: outputting by the neural transformer model with attention at each time step a hidden state vector; and generating predicted embedding vectors as a product of the hidden state vector and a linear projection layer. 14 . The computer-implemented method of claim 13 , comprising: generating unnormalized logits as a product of the predicted embedding vectors and the sequence of token embeddings. 15 . The computer-implemented method of claim 14 , comprising: normalizing the logits using a softmax function to generate the token probabilities.

Assignees

Inventors

Classifications

  • Convolutional networks [CNN, ConvNet] · CPC title

  • G06F8/33Primary

    Intelligent editors · CPC title

  • Trees · CPC title

  • Matrix or vector computation {, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization (matrix transposition G06F7/78)} · CPC title

  • for evaluating statistical data {, e.g. average values, frequency distributions, probability functions, regression analysis (forecasting specially adapted for a specific administrative, business or logistic context G06Q10/04)} · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US2024028306A1 cover?
A code completion tool uses a neural transformer model to generate candidate sequences to complete a line of source code. The neural transformer model is trained using a conditional language modeling objective on a large unsupervised dataset that includes source code programs written in several different programming languages. The neural transformer model is used within a beam search that predi…
Who is the assignee on this patent?
Microsoft Technology Licensing Llc
What technology area does this patent fall under?
Primary CPC classification G06F8/33. Mapped technology areas include Physics.
When was this patent published?
Publication date Thu Jan 25 2024 00:00:00 GMT+0000 (Coordinated Universal Time) (A1). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 5 related publications on this page (citations in our corpus or others sharing the same primary CPC).