IP Library › Granted Patent US 12,487,819
Granted Patent B2
US 12,487,819 · App. 18/379,872 · Granted Dec 2, 2025

AI-driven pull request summarization

Inventors: Neelakantan Sundaresan (Bellevue, WA); Alexey Svyatkovskiy (Bellevue, WA); Michele Tufano (Bellevue, WA); Shuo Zhang (Issaquah, WA)
Assignee: Microsoft Technology Licensing, LLC
G06F8/77G06F16/24578G06N3/0455G06N3/0475
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,487,819
App. No.
18/379,872
Granted
Dec 2, 2025
Kind
B2
Abstract

An Artificial Intelligence (AI) driven pull request summarization system utilizes a large language model to classify the code changes of a pull request and to generate a summary of the changes contained in the pull request. The large language model predicts the pull request classification and summarization given a prompt that includes the top-k code changes in the pull request of a repository. The code changes are prioritized based on the most impact that a code change has on the files, methods and classes in the repository. Each of the top-k code changes is linked to a related open issue of the repository, if any. A suggested code reviewer for a code change is then selected from an author or commentator associated with the linked open issue.

Claims (61)

1 . A system comprising:

a processor; and

a memory that stores at least one program that is configured to be executed by the processor, the at least one program includes instructions to perform actions that:

obtain a plurality of code changes from a pull request of a repository, wherein a code change represents a change to a file, class or method of the repository;

prioritize the plurality of code changes based on a score that represents an impact of a code change on the file, class or method in the repository;

rank the plurality of code changes based on top-k highest scores;

generate a first prompt to a large language model comprising top-k code changes;

obtain from the large language model, given the first prompt, a summary of the top-k code changes; and

display the summary in a pull request description for the pull request in the repository.

2 . The system of claim 1 , wherein the at least one program includes instructions to perform actions that:

perform code review of a top code change;

receive input on outcome of the code review of the top code change; and

upon successful outcome of the code review of the top code change, merge the code change back to the repository.

3 . The system of claim 1 , wherein the at least one program includes instructions to perform actions that:

obtain from the large language model, given the first prompt, a classification of the top-k code changes.

4 . The system of claim 1 , wherein the at least one program includes instructions to perform actions that:

generate an open issue index comprising a plurality of open issues associated with the repository, wherein the open issue index is accessed through an embedding of an issue.

5 . The system of claim 4 , wherein the at least one program includes instructions to perform actions that:

search the open issue index for an issue related to the summary of the top-k code changes using an embedding of the summary of the top-k code changes.

6 . The system of claim 5 , wherein the at least one program includes instructions to perform actions that:

extract from the retrieved issue at least one code reviewer to review the pull request.

7 . The system of claim 6 , wherein the at least one program includes instructions to perform actions that:

output the summary of the top-k code changes, the classification of the top-k code changes, a related open issue, and the at least one code reviewer into the pull request description of the pull request.

8 . A computer-implemented method, comprising:

retrieving a plurality of code changes from a pull request of a repository;

scoring each code change based on an impact of a code change on files, classes and methods of the repository;

ranking the plurality of code changes based on a respective score;

selecting top-k code changes having highest scores;

generating a prompt to a large language model comprising the top-k code changes having highest scores; and

obtaining from the large language model, given the prompt, a summary of the pull request, wherein the summary of the pull request comprises a description of the top-k code changes.

9 . The computer-implemented method of claim 8 , comprising:

reviewing a top code change;

receiving input on outcome of a review of the top code change; and

upon successful outcome of the review of the top code change, merging the code change back to the repository.

10 . The computer-implemented method of claim 8 , comprising:

obtaining from the large language model, given the prompt, a classification of the top-k code changes.

11 . The computer-implemented method of claim 8 , comprising:

obtaining at least one open issue from the repository associated with the top-k code changes based on the at least one open issue matching the summary of the pull request.

12 . The computer-implemented method of claim 11 , comprising:

extracting from the at least one open issue at least one code reviewer to review the pull request.

13 . The computer-implemented method of claim 12 , comprising:

displaying in a pull request description field of the pull request, the summary of the top-k code changes, a classification of the top-k code changes, the at least one open issue, and the at least one code reviewer.

14 . The computer-implemented method of claim 8 , wherein the large language model is a conversational pre-trained generative neural transformer models with attention.

15 . 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:

generate a dependency graph for a repository, wherein the repository comprises source code files having methods and classes, wherein the dependency graph comprises a plurality of nodes representing the source code files, methods and classes within the repository, wherein an edge between two nodes represents a dependency between the two nodes;

obtaining a pull request comprising a plurality of code changes;

mapping each of the plurality of code changes to a respective node in the dependency graph;

generating a score for each of the plurality of code changes based on a size of connected components of the respective mapped node in the dependency graph and a page rank of the respective mapped node;

selecting top-k code diff hunks based on highest scores;

generate a prompt to a large language model, wherein the prompt comprises top-k code changes;

obtain from the large language model a natural language summarization of the top-k code changes of the pull request; and

output the natural language summarization of the top-k code changes in the pull request.

16 . The hardware device of claim 15 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:

obtain from the large language model a classification of the top-k code changes in the pull request.

17 . The hardware device of claim 16 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:

search for a related open issue of the repository based on a similarity of an embedding of the related open issue to an embedding of the natural language summarization of the pull request.

18 . The hardware device of claim 17 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:

extract at least one code reviewer from the related open issue of the repository.

19 . The hardware device of claim 18 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:

output the classification, related open issue and the at least one code reviewer in the pull request.

20 . The hardware device of claim 15 , wherein the large language model is a conversational pre-trained generative neural transformer models with attention.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 17, 2023
From: SUNDARESAN, NEELAKANTAN; SVYATKOVSKIY, ALEXEY; TUFANO, MICHELE; ZHANG, SHUO
To: MICROSOFT TECHNOLOGY LICENSING, LLC.
Reel/Frame 065256/0494 →
Continuity (2)
Provisional Application 63530055 · Jul 31, 2023
Related Publication 20250045049A1 · Feb 6, 2025
References Cited (22)
US 11150877B2 · Ivankovic et al. · 2021 [cited by applicant]
US 11714629B2 · Shaastry · 2023 [cited by examiner]
US 20190026106A1 · Burton · 2019 [cited by examiner]
US 20200097387A1 · Loyola · 2020 [cited by examiner]
US 20200379879A1 · Plotnik · 2020 [cited by examiner]
US 20240427564A1 · Petrov · 2024 [cited by examiner]
Allamanis, et al., “Self-Supervised Bug Detection and Repair”, In Proceedings of 35th Conference on Neural Information Processing Systems, Dec. 6, 2021, 12 Pages. [cited by applicant]
Bacchelli, et al., “Expectations, Outcomes, and Challenges of Modern Code Review”, In Proceedings of 35th International Conference on Software Engineering, May 18, 2013, pp. 712-721. [cited by applicant]
Chen, et al., “SEQUENCER: Sequence-to-Sequence Learning for End-to-End Program Repair”, In Journal of IEEE Transactions on Software Engineering, Sep. 9, 2021, pp. 1943-1959. [cited by applicant]
Dinella, et al., “DeepMerge: Learning to Merge Programs”, In Proceedings of IEEE Transactions on Software Engineering, vol. 49, Issue 4, Apr. 1, 2023, pp. 1599-1614. [cited by applicant]
Fagan, Michaele. , “A History of Software Inspections”, In the Book Software Pioneers, 2002, pp. 562-573. [cited by applicant]
Hong, et al., “CommentFinder: A Simpler, Faster, More Accurate Code Review Comments Recommendation”, In Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Soft… [cited by applicant]
Jin, et al., “InferFix: End-to-End Program Repair with LLMs”, In Repository of arXiv:2303.07263v1, Mar. 13, 2023, 11 Pages. [cited by applicant]
Li, et al., “Automating code review activities by large-scale pretraining”, In Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, Nov. 9,… [cited by applicant]
Zhang, et al., “BERTScore: Evaluating text generation with BERT”, In Proceedings of Eighth International Conference on Learning Representations, Apr. 26, 2020, pp. 1-43. [cited by applicant]
Raffel, et al., “Exploring the limits of transfer learning with a unified text-to-text transformer”, In Journal of Machine Learning Research, vol. 21, Issue 1, Jan. 1, 2020, 67 Pages. [cited by applicant]
Svyatkovskiy, et al., “Program merge conflict resolution via neural transformers”, In Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, … [cited by applicant]
Tufano, et al., “An empirical study on learning bug-fixing patches in the wild via neural machine translation”, In Proceedings of ACM Transactions on Software Engineering and Methodology, vol. 28, Issue 4, Sep. 2, 2019,… [cited by applicant]
Tufano, et al., “Towards Automating Code Review Activities”, In Proceedings of IEEE/ACM 43rd International Conference on Software Engineering, May 22, 2021, pp. 163-174. [cited by applicant]
Tufano, et al., “Using Pre-Trained Models to Boost Code Review Automation”, In Repository of arXiv:2201.06850v1, Jan. 18, 2022, pp. 1-12. [cited by applicant]
Vaswani, et al., “Attention is All You Need”, In Proceedings of 31st International Conference on Neural Information Processing Systems, Dec. 4, 2017, 11 Pages. [cited by applicant]
Wang, et al., “Codet5: Identifier-Aware Unified Pre-Trained Encoder-Decoder Models for Code Understanding and Generation”, In Repository of arXiv:2109.00859v1, Sep. 2, 2021, 13 Pages. [cited by applicant]