IP Library › Granted Patent US 12,481,484
Granted Patent B2
US 12,481,484 · App. 18/384,670 · Granted Nov 25, 2025

Fixing usages of deprecated APIs using large language models

Inventors: Max Schaefer (Kidlington, GB); Sarah Ezzeldin Mostafa Nadi (Edmonton, CA)
Assignee: Microsoft Technology Licensing, LLC
G06F8/36G06F8/35
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,481,484
App. No.
18/384,670
Filed
Oct 27, 2023
Granted
Nov 25, 2025
Kind
B2
Art Unit
2191
USPC
717/104
Abstract

Techniques for intelligently prompting an LLM to fix code are disclosed. A corpus of release notes for a set of libraries is accessed. The release notes include information describing deprecated or removed APIs associated with the libraries. The corpus is stored in a vector database. A code snippet is accessed. This snippet is identified as potentially using a deprecated API. The code snippet is used to identify a set of release notes from the vector database. These release notes are determined to satisfy a threshold level of similarity with the code snippet. An LLM prompt is built and is fed to the LLM. The LLM prompt instructs the LLM to update the code snippet based on the identified set of release notes. Output of the LLM is displayed. This output includes a proposed rewritten version of the code snippet.

Claims (38)

1 . A method for prompting a large language model (LLM) to generate modified code to fix code that uses a deprecated application programming interface (API), said method comprising:

accessing a corpus of release notes for a set of libraries, wherein the release notes include information describing deprecated or removed APIs associated with the set of libraries;

storing the corpus of release notes in a vector database;

accessing a code snippet, which is identified as using the deprecated API;

using the code snippet to identify a set of release notes from the vector database, wherein the identified set of release notes is determined to satisfy a threshold level of similarity with the code snippet;

building an LLM prompt that will be fed to the LLM, wherein the LLM prompt instructs the LLM to update the code snippet based on the identified set of release notes; and

displaying output of the LLM based on the LLM operating in response to the LLM prompt, wherein the output includes a proposed modified version of the code snippet.

2 . The method of claim 1 , wherein the vector database is indexed using embeddings.

3 . The method of claim 1 , wherein the vector database further includes information obtained from one or more external sources.

4 . The method of claim 3 , wherein the one or more external sources include an online forum comprising information describing the identified set of release notes.

5 . The method of claim 1 , wherein the threshold level of similarity is based on a comparison of embeddings.

6 . The method of claim 1 , wherein the LLM is a generative pre-trained transformer type of LLM.

7 . The method of claim 1 , wherein the identified set of release notes includes a code mapping detailing how to map an older version of code to a current, up-to-date version of code.

8 . The method of claim 1 , wherein the identified set of release notes includes natural language detailing how an older version of code is transformable to a current, up-to-date version of code.

9 . The method of claim 1 , wherein the identified set of release notes includes a combination of natural language and code.

10 . The method of claim 1 , wherein the identified set of release notes includes information on how to update an older version of code to a current, up-to-date version of code.

11 . A computer system comprising: a processor system; and

a storage system that includes instructions that are executable by the processor system to cause the computer system to:

access a corpus of release notes for a set of libraries, wherein the release notes include information describing deprecated or removed application programming interfaces (APIs) associated with the set of libraries; store the corpus of release notes in a vector database;

access a code snippet, which is identified as using a deprecated API;

use the code snippet to identify a set of release notes from the vector database, wherein the identified set of release notes is determined to satisfy a threshold level of similarity with the code snippet;

build a large language model (LLM) prompt that will be fed to the LLM, wherein the LLM prompt instructs the LLM to update the code snippet based on the identified set of release notes; and

display output of the LLM based on the LLM operating in response to the LLM prompt, wherein the output includes a proposed modified version of the code snippet.

12 . The computer system of claim 11 , wherein the output further includes a selectable option to accept or reject the output.

13 . The computer system of claim 11 , wherein the proposed modified version of the code snippet is automatically incorporated into a codebase such that the proposed modified version of the code snippet replaces the code snippet in the codebase.

14 . The computer system of claim 11 , wherein the output is displayed proximately to the code snippet.

15 . The computer system of claim 11 , wherein the LLM reads the identified set of release notes and translates the identified set of release notes into corresponding code changes.

16 . The computer system of claim 11 , wherein the vector database is further supplemented with information obtained from sources other than release notes.

17 . The computer system of claim 11 , wherein the output further includes a rationale associated with the proposed modified version of the code snippet.

18 . A method for prompting a large language model (LLM) to generate modified code to fix code that uses a deprecated application programming interface (API), said method comprising:

accessing a corpus of release notes for a set of libraries, wherein the release notes include information describing deprecated or removed APIs associated with the set of libraries;

storing the corpus of release notes in a vector database, which is indexed using embeddings;

accessing a code snippet, which is identified as using the deprecated API;

using the code snippet to identify a set of release notes from the vector database, wherein the identified set of release notes is determined to satisfy a threshold level of similarity with the code snippet;

building an LLM prompt that will be fed to the LLM, wherein the LLM prompt instructs the LLM to update the code snippet based on the identified set of release notes; and

displaying output of the LLM based on the LLM operating in response to the LLM prompt, wherein the output includes a proposed modified version of the code snippet, and wherein the output further includes a rationale associated with the proposed modified version of the code snippet.

19 . The method of claim 18 , wherein the output further includes a rationale associated with the proposed modified version of the code snippet.

20 . The method of claim 18 , wherein the LLM prompt includes at least one of an example code mapping, a release note comment, or an instruction for the LLM to provide a rationale regarding its output.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 27, 2023
From: SCHAEFER, MAX; NADI, SARAH EZZELDIN MOSTAFA
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 065375/0630 →
Continuity (1)
Related Publication 20250138791A1 · May 1, 2025
References Cited (11)
US 9519464B2 · Dang · 2016 [cited by examiner]
US 11163548B2 · Stylos · 2021 [cited by examiner]
US 20240403438A1 · Chan · 2024 [cited by examiner]
US 20240412720A1 · Vasylyev · 2024 [cited by examiner]
US 20250117195A1 · Rieken · 2025 [cited by examiner]
US 20250138816A1 · Hutchings · 2025 [cited by examiner]
Zan, “Private-Library-Oriented Code Generation with Large Language Models”, 2023, Wuhan University (Year: 2023). [cited by examiner]
International Search Report and Written Opinion received for PCT Application No. PCT/US2024/049683, (MS#413732-PCT01) Apr. 4, 2025, 16 pages. [cited by applicant]
Khushboo, et al., “From Bugs to 1-20 Fixes: HDL Bug Identification and Patching using LLMs and RAG”, 2024 IEEE LLM Aided Design Workshop (LAD), IEEE, Jun. 28, 2024, pp. 1-5. [cited by applicant]
Zan, et al., “Private-Library-Oriented Code Generation with Large Language Models”, arxiv.org, Cornell University Library, 201 Olin Library Cornell University Ithaca, NY 14853, Jul. 28, 2023, 19 pages. [cited by applicant]
Zexiong, et al., “Compositional API 1-20 Recommendation for Library-Oriented Code Generation”, Proceedings of The 2024 ACM Workshop on Wireless Security and Machine Learning, Acmpub27, New York, Ny, USA, Apr. 15, 2024, … [cited by applicant]