Learning and using programming styles

US11748065B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-11748065-B2
Application numberUS-202117563881-A
CountryUS
Kind codeB2
Filing dateDec 28, 2021
Priority dateJul 1, 2019
Publication dateSep 5, 2023
Grant dateSep 5, 2023

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.

Techniques are described herein for using artificial intelligence to “learn,” statistically, a target programming style that is imposed in and/or evidenced by a code base. Once the target programming style is learned, it can be used for various purposes. In various implementations, one or more generative adversarial networks (“GANs”), each including a generator machine learning model and a discriminator machine learning model, may be trained to facilitate learning and application of target programming style(s). In some implementations, the discriminator(s) and/or generator(s) may operate on graphical input, and may take the form of graph neural networks (“GNNs”), graph attention neural networks (“GANNs”), graph convolutional networks (“GCNs”), etc., although this is not required.

First claim

Opening claim text (preview).

What is claimed is: 1. A method implemented using one or more processors, comprising: processing a first source code snippet based on a discriminator machine learning model of a generative adversarial network (GAN) to generate style output, wherein the style output indicates whether the first source code snippet conforms with a target programming style, and the discriminator machine learning model is trained based on training data that includes source code snippets in the target programming style, some of which are labeled as genuine and others that are labeled synthetic; causing one or more output devices to render first output that conveys the style output; processing the first source code snippet based on a generator machine learning model of the GAN to generate edit output, wherein the edit output corresponds to a transformation of the first source code snippet from another programming style to the target programming style via one or more candidate edits; and causing one or more of the output devices to render second output that conveys one or more of the candidate edits. 2. The method of claim 1 , wherein the processing of the first source code snippet based on the generator machine learning model is performed in response to the style output satisfying a criterion. 3. The method of claim 2 , wherein the criterion comprises the first source code snippet failing to conform to the target programming style. 4. The method of claim 1 , wherein the style output comprises a probability between zero and one. 5. The method of claim 1 , wherein one or both of the discriminator and generator machine learning models comprises a graph neural network (GNN). 6. The method of claim 5 , wherein processing the first source code snippet based on the generator machine learning model comprises processing an abstract syntax tree (AST) representing the first source code snippet. 7. The method of claim 1 , wherein the discriminator machine learning model is coupled with a prediction layer. 8. The method of claim 7 , wherein the prediction layer comprises a softmax layer or a sigmoid function layer. 9. The method of claim 1 , wherein the second output is presented as part of a graphical user interface (GUI) that presents one or more edit suggestions corresponding to the one or more candidate edits to be made to the first source code snippet. 10. The method of claim 1 , wherein one or both of the generator and discriminator machine learning models comprises a recurrent neural network (RNN). 11. The method of claim 1 , wherein processing the first source code snippet based on the generator machine learning model comprises processing bytecode generated using the first source code snippet. 12. The method of claim 1 , wherein one or both of the style and edit outputs comprises a latent space embedding. 13. A method implemented using one or more processors, comprising: processing a graph that represents a first source code snippet based on a generator machine learning model of a generative adversarial network (GAN) to generate a synthetic graph, wherein the synthetic graph corresponds to a transformation of the first source code snippet from another programming style to a target programming style via one or more candidate edits, and wherein the generator machine learning model comprises a first graph neural network (GNN) trained in conjunction with a discriminator graph neural network of the GAN, wherein the discriminator machine learning model comprises a second GNN; and causing one or more of the candidate edits to be implemented in the first source code snippet or presented at one or more output components. 14. The method of claim 13 , wherein the discriminator machine learning model is trained based on training data that includes source code snippets in the target programming style, some of which are labeled as genuine and others that are labeled synthetic. 15. The method of claim 13 , wherein the graph and the synthetic graph comprise abstract syntax trees (AST). 16. The method of claim 13 , wherein the causing includes presenting a list of selectable elements corresponding to the candidate edits, wherein each selectable element is selectable to implement the corresponding candidate edit. 17. The method of claim 13 , further comprising processing the graph that represents the first source code snippet based on the discriminator machine learning model generate style output, wherein the style output indicates whether the first source code snippet conforms with the target programming style. 18. The method of claim 17 , wherein the processing of the graph that represents the first source code snippet based on the generator machine learning model is performed in response to the style output satisfying a criterion. 19. A method implemented using one or more processors, comprising: processing a graph representing a first source code snippet based on a discriminator machine learning model of a generative adversarial network (GAN) to generate style output, wherein the style output indicates whether the first source code snippet conforms with a target programming style, and the discriminator machine learning model is trained based on training data that includes training graphs representing source code snippets in the target programming style, some of which are labeled as genuine and others, generated by a generator machine learning model of the GAN, that are labeled synthetic; and causing one or more output devices to render first output that conveys the style output. 20. The method of claim 19 , wherein one or both of the discriminator and generator machine learning models comprises a graph neural network, a graph convolutional network (GCN), or a graph attention neural network (GANN).

Assignees

Inventors

Classifications

  • Generative networks · CPC title

  • Adversarial learning · CPC title

  • Auto-encoder networks; Encoder-decoder networks · CPC title

  • G06F8/33Primary

    Intelligent editors · CPC title

  • Transformation of program code · 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 US11748065B2 cover?
Techniques are described herein for using artificial intelligence to “learn,” statistically, a target programming style that is imposed in and/or evidenced by a code base. Once the target programming style is learned, it can be used for various purposes. In various implementations, one or more generative adversarial networks (“GANs”), each including a generator machine learning model and a disc…
Who is the assignee on this patent?
Google 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 Tue Sep 05 2023 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 12 related publications on this page (citations in our corpus or others sharing the same primary CPC).