IP Library Granted Patent US 12670154
Granted Patent B1
US 12670154 · App. 18/529,221 · Granted Jun 30, 2026

Application selection for language models

Inventors: Vaibhav Kumar (Redmond, WA); Mohammad Kachuee (Bellevue, WA); Amin Fazeli (San Diego, CA); Yibo Yao (Bellevue, WA); Yu Chen (Manhasset, NY); Saurabh Gupta (Seattle, WA); Changmin Seo (Seattle, WA); Xiang Li (Bellevue, WA); Puyang Xu (Issaquah, WA); Tenghao Huang (Los Angeles, CA)
Assignee: AMAZON TECHNOLOGIES, INC.
G06F16/24522G06F16/248G06F16/285
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 12670154
App. No.
18/529,221
Granted
Jun 30, 2026
Kind
B1
Abstract

Devices and techniques are generally described for application shortlisting for language models. An LLM may determine a first goal of first query data. The LLM may generate first code data representing the first query data. First encoded data including a first encoded representation of the first goal and the first query data may be generated. A first application may be determined based at least in part on analysis of the first encoded data with respect to second encoded data representing the first application. A second application may be determined based at least in part on analysis of the first encoded data with respect to third encoded data representing the second application. First prompt data including the first query data, first data identifying the first application, and second data identifying the second application may be generated. The LLM may generate output data based at least in part on the first prompt data.

Claims (103)

1 . A computer-implemented method comprising:

receiving first query data comprising a first natural language input;

generating, using a first large language model (LLM), a first goal of the first query data, wherein the first LLM is fine-tuned to determine a goal of natural language input;

generating, using the first LLM, a second goal of the first query data;

determining a first domain of the first goal;

determining a second domain of the second goal;

generating, using the first LLM, first code data representing the first goal and the second goal;

generating, using an encoder, first encoded data comprising a first encoded representation of the first goal, the second goal, the first domain, the second domain, and the first code data, wherein the first encoded data generated by the encoder represents the first goal, the second goal, the first domain, the second domain, and the first code data;

determining, using a first similarity metric, a first application for performing one or more tasks in response to the first natural language input, wherein the first application is determined by analyzing the first encoded data with respect to second encoded data comprising a representation of a description of the first application, wherein the second encoded data represents the description of the first application;

determining, using the first similarity metric, a second application for performing the one or more tasks in response to the first natural language input, wherein the second application is determined by comparing the first encoded data to third encoded data comprising a representation of a description of the second application, wherein the third encoded data represents the description of the second application;

generating first prompt data comprising first data representing the first application, second data representing the second application, and third data representing the first query data; and

generating, by the first LLM using the first prompt data, first output data in response to the first natural language input.

2 . The computer-implemented method of claim 1 , further comprising:

generating second prompt data comprising the first query data, second query data comprising an example query, and first example code comprising a plurality of tasks associated with the example query;

generating, by the first LLM using the second prompt data, the first code data, wherein the first code data comprises a third application;

sending fourth data to the third application, the fourth data comprising a first parameter type, wherein the first parameter type is determined from the first query data;

determining that a response from the third application is invalid due to the first parameter type being invalid for the third application; and

generating third prompt data indicating that the third application is invalid for responding to the first query data.

3 . The computer-implemented method of claim 1 , further comprising:

generating, using the encoder, the second encoded data further comprising a representation of required input parameters and optional input parameters for the first application; and

determining that the first query data describes the required input parameters and optional input parameters by analyzing the second encoded data with respect to the first encoded data.

4 . A method comprising:

receiving first query data;

generating, using a first language model (LM), a first goal of the first query data;

generating, using the first LM, first code data representing the first query data;

generating, using an encoder, first encoded data comprising a first encoded representation of the first goal and the first query data in an embedding space;

determining a first application based at least in part on analysis of the first encoded data with respect to second encoded data representing the first application, wherein the second encoded data represents the first application in the embedding space;

determining a second application based at least in part on analysis of the first encoded data with respect to third encoded data representing the second application, wherein the third encoded data represents the second application in the embedding space;

generating first prompt data comprising the first query data, first data identifying the first application, and second data identifying the second application; and

generating output data based at least in part on the first prompt data.

5 . The method of claim 4 , further comprising:

determining exemplar data comprising second query data and a code representation of the second query data; and

generating, using the first LM, the first code data based at least in part on second prompt data comprising the first query data and the exemplar data.

6 . The method of claim 4 , further comprising:

determining a first text description of the first application;

generating second prompt data comprising the first text description and instructions to rewrite the first text description; and

generating, by the first LM or a second LM, a second text description of the first application.

7 . The method of claim 6 , further comprising:

generating, by the first LM or a second LM, data representing input parameters of the first application; and

generating the second encoded data representing the first application, wherein the second encoded data comprises representations of the second text description and the data representing input parameters of the first application.

8 . The method of claim 7 , further comprising:

determining similarity data representing a similarity between the first encoded data and the second encoded data using a first vector similarity metric; and

determining that the first application corresponds to the first query data based at least in part on the similarity data.

9 . The method of claim 4 , further comprising:

determining a first input parameter of the first application;

determining a first data type of the first input parameter;

determining a second input parameter of the first application, wherein the second input parameter is classified as an optional input parameter;

determining a second data type of the second input parameter;

generating the second encoded data comprising a representation of the first input parameter, the first data type, the second input parameter and the second data type; and

determining the first application based at least in part on a correspondence between information specified in the first query data and the second encoded data.

10 . The method of claim 4 , further comprising:

determining a first list of applications for the first query data based at least in part on a comparison of the first query data to a respective embedding for each application in the first list of applications; and

determining a subset of the first list of applications based at least in part on analysis of the first encoded data with respect to the second encoded data and analysis of the first encoded data with respect to the third encoded data, the subset comprising the first application and the second application.

11 . The method of claim 4 , further comprising:

sending a first request to the first application;

receiving first result data based at least in part on the first request;

determining that the first result data is invalid; and

generating second query data indicating that the first result data from the first request sent to the first application is invalid.

12 . The method of claim 4 , further comprising:

generating, using the first LM, a second goal of the first query data;

generating, using the first LM or a first classifier, a first domain classification of the first goal;

generating, using the first LM or the first classifier, a second domain classification of the second goal;

generating third data representing the first domain classification of the first goal; and

generating fourth data representing the first domain classification of the first goal, wherein the first encoded data further comprises the third data and the fourth data.

13 . A system comprising:

at least one processor; and

non-transitory computer-readable memory storing instructions that, when executed by the at least one processor, are effective to:

receive first query data;

generate, using a first language model (LM), a first goal of the first query data;

generate, using the first LM, first code data representing the first query data;

generate, using an encoder, first encoded data comprising a first encoded representation of the first goal and the first query data in an embedding space;

determine a first application based at least in part on analysis of the first encoded data with respect to second encoded data representing the first application, wherein the second encoded data represents the first application in the embedding space;

determine a second application based at least in part on analysis of the first encoded data with respect to third encoded data representing the second application, wherein the third encoded data represents the second application in the embedding space;

generate first prompt data comprising the first query data, first data identifying the first application, and second data identifying the second application; and

generate output data based at least in part on the first prompt data.

14 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

determine exemplar data comprising second query data and a code representation of the second query data; and

generate, using the first LM, the first code data based at least in part on second prompt data comprising the first query data and the exemplar data.

15 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

determine a first text description of the first application;

generate second prompt data comprising the first text description and instructions to rewrite the first text description; and

generate, by the first LM or a second LM, a second text description of the first application.

16 . The system of claim 15 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

generate, by the first LM or a second LM, data representing input parameters of the first application; and

generate the second encoded data representing the first application, wherein the second encoded data comprises representations of the second text description and the data representing input parameters of the first application.

17 . The system of claim 16 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

determine similarity data representing a similarity between the first encoded data and the second encoded data using a first vector similarity metric; and

determine that the first application corresponds to the first query data based at least in part on the similarity data.

18 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

determine a first input parameter of the first application;

determine a first data type of the first input parameter;

determine a second input parameter of the first application, wherein the second input parameter is classified as an optional input parameter;

determine a second data type of the second input parameter;

generate the second encoded data comprising a representation of the first input parameter, the first data type, the second input parameter and the second data type; and

determine the first application based at least in part on a correspondence between information specified in the first query data and the second encoded data.

19 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

determine a first list of applications for the first query data based at least in part on a comparison of the first query data to a respective embedding for each application in the first list of applications; and

determine a subset of the first list of applications based at least in part on analysis of the first encoded data with respect to the second encoded data and analysis of the first encoded data with respect to the third encoded data, the subset comprising the first application and the second application.

20 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

send a first request to the first application;

receive first result data based at least in part on the first request;

determine that the first result data is invalid; and

generate second query data indicating that the first result data from the first request sent to the first application is invalid.