Methods and systems for indicating resource usage parameter for prompting a large language model (LLM)
Methods and systems for indicating a resource usage parameter for prompting a large language model (LLM) are described. A user input is received, from an electronic device, for generating a prompt to a LLM. A prompt resource usage parameter is computed based on the user input. A trained resource prediction model is used to generate a predicted response resource usage parameter for a response from the LLM, based on the user input. A total resource usage parameter is computed, based on the prompt resource usage parameter and the predicted response resource usage parameter. A representation of the total resource usage parameter is communicated to the electronic device, to cause the electronic device to provide an output of the representation of the total resource usage parameter.
1 . A computer system comprising:
a processing unit configured to execute computer-readable instructions to cause the system to:
receive, from an electronic device, a user input for generating a prompt to a large language model (LLM);
compute a prompt resource usage parameter based on the user input;
generate, by a trained resource prediction model, a predicted response resource usage parameter for a response from the LLM, based on the user input;
compute a total resource usage parameter, based on the prompt resource usage parameter and the predicted response resource usage parameter; and
communicate, to the electronic device, a representation of the total resource usage parameter, to cause the electronic device to provide an output of the representation of the total resource usage parameter.
2 . The system of claim 1 , wherein the electronic device is caused to display a prompt user interface (UI) enabling input of the user input and output of the representation of the total resource usage parameter.
3 . The system of claim 2 , wherein the prompt UI includes one or more input fields for receiving a respective one or more portions of the user input, and the prompt resource usage parameter is determined based on each of the one or more portions of the user input received in each of the one or more input fields.
4 . The system of claim 1 , wherein the representation of the total resource usage parameter is a representation of the total resource usage parameter with respect to a maximum resource capacity for the LLM.
5 . The system of claim 4 , wherein the processing unit is configured to execute computer-readable instructions to further cause the system to:
compare the total resource usage parameter to a resource usage threshold based on the maximum resource capacity for the LLM; and
in response to determining that the total resource usage parameter exceeds the resource usage threshold:
communicate a warning to the electronic device, to cause the electronic device to provide an output of the warning.
6 . The system of claim 5 , wherein the processing unit is configured to execute computer-readable instructions to further cause the system to:
further in response to determining that the total resource usage parameter exceeds the resource usage threshold:
generate a recommendation for reducing the total resource usage parameter; and
communicate the recommendation to the electronic device, to cause the electronic device to provide an output of the recommendation.
7 . The system of claim 1 , wherein the processing unit is configured to execute computer-readable instructions to further cause the system to:
generate, by a trained complexity resource prediction model, a predicted complexity resource usage parameter for the prompt, based on the user input;
wherein the total resource usage parameter is further computed based on the complexity resource usage parameter.
8 . A method comprising:
receiving, from an electronic device, a user input for generating a prompt to a large language model (LLM);
computing a prompt resource usage parameter based on the user input;
generating, by a trained resource prediction model, a predicted response resource usage parameter for a response from the LLM, based on the user input;
computing a total resource usage parameter, based on the prompt resource usage parameter and the predicted response resource usage parameter; and
communicating, to the electronic device, a representation of the total resource usage parameter, to cause the electronic device to provide an output of the representation of the total resource usage parameter.
9 . The method of claim 8 , wherein the electronic device is caused to display a prompt user interface (UI) enabling input of the user input and output of the representation of the total resource usage parameter.
10 . The method of claim 9 , wherein the prompt UI includes one or more input fields for receiving a respective one or more portions of the user input, and the prompt resource usage parameter is determined based on each of the one or more portions of the user input received in each of the one or more input fields.
11 . The method of claim 8 , wherein the representation of the total resource usage parameter is a representation of the total resource usage parameter with respect to a maximum resource capacity for the LLM.
12 . The method of claim 11 , further comprising:
comparing the total resource usage parameter to a resource usage threshold based on the maximum resource capacity for the LLM; and
in response to determining that the total resource usage parameter exceeds the resource usage threshold:
communicating a warning to the electronic device, to cause the electronic device to provide an output of the warning.
13 . The method of claim 12 , further comprising:
further in response to determining that the total resource usage parameter exceeds the resource usage threshold:
generating a recommendation for reducing the total resource usage parameter; and
communicating the recommendation to the electronic device, to cause the electronic device to provide an output of the recommendation.
14 . The method of claim 8 , further comprising:
generating, by a trained complexity resource prediction model, a predicted complexity resource usage parameter for the prompt, based on the user input;
wherein the total resource usage parameter is further computed based on the complexity resource usage parameter.
15 . A non-transitory computer-readable medium storing instructions that, when executed by a processor of a computing system, cause the computing system to:
receive, from an electronic device, a user input for generating a prompt to a large language model (LLM);
compute a prompt resource usage parameter based on the user input;
generate, by a trained resource prediction model, a predicted response resource usage parameter for a response from the LLM, based on the user input;
compute a total resource usage parameter, based on the prompt resource usage parameter and the predicted response resource usage parameter; and
communicate, to the electronic device, a representation of the total resource usage parameter, to cause the electronic device to provide an output of the representation of the total resource usage parameter.
16 . The non-transitory computer readable medium of claim 15 , wherein the electronic device is caused to display a prompt user interface (UI) enabling input of the user input and output of the representation of the total resource usage parameter.
17 . The non-transitory computer readable medium of claim 16 , wherein the prompt UI includes one or more input fields for receiving a respective one or more portions of the user input, and the prompt resource usage parameter is determined based on each of the one or more portions of the user input received in each of the one or more input fields.
18 . The non-transitory computer readable medium of claim 15 , wherein the representation of the total resource usage parameter is a representation of the total resource usage parameter with respect to a maximum resource capacity for the LLM.
19 . The non-transitory computer readable medium of claim 18 , wherein the instructions, when executed, further cause the system to:
compare the total resource usage parameter to a resource usage threshold based on the maximum resource capacity for the LLM; and
in response to determining that the total resource usage parameter exceeds the resource usage threshold:
communicate a warning to the electronic device, to cause the electronic device to provide an output of the warning.
20 . The non-transitory computer readable medium of claim 15 , wherein the instructions, when executed, further cause the system to:
generate, by a trained complexity resource prediction model, a predicted complexity resource usage parameter for the prompt, based on the user input;
wherein the total resource usage parameter is further computed based on the complexity resource usage parameter.