IP Library Granted Patent US 12,147,513
Granted Patent B1
US 12,147,513 · App. 18/633,293 · Granted Nov 19, 2024

Dynamic evaluation of language model prompts for model selection and output validation and methods and systems of the same

Inventors: Payal Jain (London, GB); Tariq Husayn Maonah (London, GB); Mariusz Saternus (Cracow, PL); Daniel Lewandowski (Cracow, PL); Biraj Krushna Rath (London, GB); Stuart Murray (London, GB); Philip Davies (London, GB)
Assignee: Citibank, N.A.
G06F21/31G06F21/6218G06F40/20
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,147,513
App. No.
18/633,293
Granted
Nov 19, 2024
Kind
B1
Abstract

The systems and methods disclosed herein relate to a model validation platform that enables dynamic validation of a user's prompt for a large language model (LLM) in order to evaluate the validity of the prompt and the suitability of a large language model for processing the prompt. For example, the platform enables an estimation of the resource allocation associated with processing the prompt with a given LLM, as well as a modification of the prompt, prior to the processing the prompt with the selected LLM. The platform can further validate the output prior to transmitting the output to a server system for display to the user. By doing so, the platform enables dynamic evaluation of a request to execute an LLM, as well as evaluation of resulting outputs, for accuracy and efficiency improvements in data processing or software development pipelines.

Claims (112)

1. A non-transitory computer-readable storage medium comprising instructions thereon, wherein the instructions when executed by at least one data processor of a system, cause the system to:

receive an output generation request from a user device,

wherein the user device is associated with an authentication token, and

wherein the output generation request includes a prompt for generation of a text-based output using a first large-language model (LLM);

authenticate the user device based on the authentication token;

determine a performance metric value associated with the output generation request,

wherein the performance metric value indicates an estimated resource requirement for the output generation request;

identify, based on an attribute of the output generation request, a first prompt validation model of a plurality of prompt validation models;

provide the output generation request to the first prompt validation model to modify the prompt,

wherein modifying the prompt comprises:

determining that the prompt includes a forbidden token; and

generating the modified prompt by omitting the forbidden token;

compare the performance metric value of the output generation request with a first performance criterion associated with the first LLM of a plurality of LLMs;

in response to determining that the performance metric value satisfies the first performance criterion, provide the prompt to the first LLM to generate an output;

provide the output to an output validation model to generate a validation indicator associated with the output; and

in response to generating the validation indicator, transmit the output to a server system enabling access to the output by the user device.

2. The non-transitory computer-readable storage medium of claim 1 , wherein the instructions for authenticating the user device based on the authentication token cause the system to:

determine a user identifier associated with the user device;

determine, from a token database, a stored token associated with the user identifier;

compare the stored token and the authentication token associated with the output generation request; and

in response to determining that the stored token and the authentication token associated with the output generation request match, authenticate the user device.

3. The non-transitory computer-readable storage medium of claim 1 , wherein the instructions further cause the system to:

generate, based on the output generation request, an event record including (1) the performance metric value, (2) a user identifier associated with the user device, and (3) the prompt; and

transmit, to the server system, the event record for storage in an event database.

4. The non-transitory computer-readable storage medium of claim 1 , wherein the instructions for modifying the prompt cause the system to:

determine that the prompt includes a first alphanumeric token;

determine that one or more records in a sensitive token database include a representation of the first alphanumeric token; and

modify the prompt to include a second alphanumeric token in lieu of the first alphanumeric token,

wherein the sensitive token database does not include a record representing the second alphanumeric token.

5. The non-transitory computer-readable storage medium of claim 1 , wherein the instructions for modifying the prompt cause the system to:

generate a trace token comprising a traceable alphanumeric token; and

generate the modified prompt to include the trace token.

6. The non-transitory computer-readable storage medium of claim 1 , wherein the instructions for comparing the performance metric value with the first performance criterion cause the system to:

generate a cost metric value associated with the estimated resource requirement for the output generation request;

determine a threshold cost associated with the first LLM; and

determine that the cost metric value satisfies the threshold cost.

7. The non-transitory computer-readable storage medium of claim 1 , wherein the instructions for generating the validation indicator cause the system to:

extract a code sample from the output, wherein the code sample includes code for a software routine;

compile, within a virtual machine of the system, the code sample to generate an executable program associated with the software routine;

execute, within the virtual machine, the software routine using the executable program;

detect an anomaly in the execution of the software routine; and

in response to detecting the anomaly in the execution of the software routine, generate the validation indicator to include an indication of the anomaly.

8. A system comprising:

at least one hardware processor; and

at least one non-transitory memory storing instructions, which, when executed by the at least one hardware processor, cause the system to:

receive an output generation request from a user device,

wherein the user device is associated with an authentication token, and

wherein the output generation request includes a prompt for generation of a text-based output using a first large-language model (LLM);

authenticate the user device based on the authentication token;

determine a performance metric value associated with the output generation request,

wherein the performance metric value indicates an estimated resource requirement for the output generation request;

provide the output generation request to a first prompt validation model to modify the prompt,

wherein modifying the prompt comprises:

generating a trace token comprising a traceable alphanumeric token; and

generating the modified prompt to include the trace token;

compare the performance metric value of the output generation request with a first performance criterion associated with the first LLM of a plurality of LLMs;

in response to determining that the performance metric value satisfies the first performance criterion, provide the prompt to the first LLM to generate an output;

provide the output to an output validation model to generate a validation indicator associated with the output; and

in response to generating the validation indicator, transmit the output to a server system enabling access to the output by the user device.

9. The system of claim 8 , wherein the instructions for authenticating the user device based on the authentication token cause the system to:

determine a user identifier associated with the user device;

determine, from a token database, a stored token associated with the user identifier;

compare the stored token and the authentication token associated with the output generation request; and

in response to determining that the stored token and the authentication token associated with the output generation request match, authenticate the user device.

10. The system of claim 8 , wherein the instructions further cause the system to:

generate, based on the output generation request, an event record including (1) the performance metric value, (2) a user identifier associated with the user device, and (3) the prompt; and

transmit, to the server system, the event record for storage in an event database.

11. The system of claim 8 , wherein the instructions for modifying the prompt cause the system to:

determine that the prompt includes a first alphanumeric token;

determine that one or more records in a sensitive token database include a representation of the first alphanumeric token; and

modify the prompt to include a second alphanumeric token in lieu of the first alphanumeric token,

wherein the sensitive token database does not include a record representing the second alphanumeric token.

12. The system of claim 8 , wherein the instructions for modifying the prompt cause the system to:

determine that the prompt includes a forbidden token; and

generate the modified prompt by omitting the forbidden token.

13. The system of claim 8 , wherein the instructions for comparing the performance metric value with the first performance criterion cause the system to:

generate a cost metric value associated with the estimated resource requirement for the output generation request;

determine a threshold cost associated with the first LLM; and

determine that the cost metric value satisfies the threshold cost.

14. The system of claim 8 , wherein the instructions for providing the output generation request to the first prompt validation model cause the system to:

identify an attribute of the output generation request;

determine, based on the attribute, the first prompt validation model of a plurality of prompt validation models; and

provide the output generation request to the first prompt validation model.

15. A method comprising:

receiving an output generation request from a user device,

wherein the output generation request is associated with an authentication token, and

wherein the output generation request includes a prompt for generation of a text-based output using a first large-language model (LLM);

authenticating the user device based on the authentication token;

determining a performance metric value associated with the output generation request,

wherein the performance metric value indicates an estimated resource requirement for the output generation request;

identifying a first prompt validation model of a plurality of prompt validation models;

providing the output generation request to the first prompt validation model to modify the prompt,

wherein modifying the prompt comprises:

determining that the prompt includes a forbidden token; and

generating the modified prompt by omitting the forbidden token;

comparing the performance metric value of the output generation request with a first performance criterion associated with the first LLM of a plurality of LLMs;

in response to determining that the performance metric value satisfies the first performance criterion, providing the prompt to the first LLM to generate an output;

providing the output to an output validation model to generate a validation indicator associated with the output; and

in response to generating the validation indicator, transmitting the output to a server system enabling access to the output by the user device.

16. The method of claim 15 , wherein authenticating the user device based on the authentication token comprises:

determining a user identifier associated with the user device;

determining, from a token database, a stored token associated with the user identifier;

comparing the stored token and the authentication token associated with the output generation request; and

in response to determining that the stored token and the authentication token associated with the output generation request match, authenticating the user device.

17. The method of claim 15 , comprising:

generating, based on the output generation request, an event record including (1) the performance metric value, (2) a user identifier associated with the user device, and (3) the prompt; and

transmitting, to the server system, the event record for storage in an event database.

18. The method of claim 15 , comprising:

determining that the prompt includes a first alphanumeric token;

determining that one or more records in a sensitive token database include a representation of the first alphanumeric token; and

modifying the prompt to include a second alphanumeric token in lieu of the first alphanumeric token,

wherein the sensitive token database does not include a record representing the second alphanumeric token.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 19, 2024
From: JAIN, PAYAL; MAONAH, TARIQ HUSAYN; SATERNUS, MARIUSZ; LEWANDOWSKI, DANIEL; RATH, BIRAJ KRUSHNA; MURRAY, STUART; DAVIES, PHILIP
To: CITIBANK, N.A.
Reel/Frame 068035/0186 →
Cited By (11)
US 12,505,291 US 12,517,724 US 12,572,856 US 12,596,738 US 12,596,813 US 12,602,418 US 12,602,624 US 12,634,269 US 12,634,309 US 12,681,830 US 12,694,343