# US 2025/0378306 A1 · Layered multi-prompt engineering for pre-trained large language models

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0378306 A1
- Document ID: US20250378306A1
- Status: Published application
- Kind: A1
- Application number: 18/759,617
- Filed: 2024-06-28
- Published: 2025-12-11
- Earliest claimed: 2024-06-07
- Assignees: Citibank, N.A.
- Applicants: Citibank, N.A.
- Inventors: William Franklin CAMERON; Miriam SILVER; Manjit RAJARETNAM
- Web page: https://patentgrep.com/patent/US20250378306A1

## CPC

- G06N 3/04: Architecture, e.g. interconnection topology
- G06N 3/045: Combinations of networks
- G06F 40/40: Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30)
- G06N 3/0475: Generative networks
- G06N 3/08: Learning methods
- G06N 3/082: modifying the architecture, e.g. adding, deleting or silencing nodes or connections
- G06N 20/00: Machine learning
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods for constructing layered prompts to operate as input into a pre-trained large language model (LLM). The method involves obtaining a set of application domains in which the LLM will be used. Using these application domains, a set of guidelines is determined, defining operation boundaries for the LLM. A set of layers is determined, each associated with the guidelines and including variables representing attributes identified within those guidelines. Using these layers, a first layered prompt is constructed to test the initial operation boundaries of the guidelines and is supplied to the LLM to generate a set of responses. Based on the responses, a second layered prompt is dynamically constructed to test additional operation boundaries, ensuring iterative refinement and contextual relevance.

## Claims

### Claim 1

A method for constructing layered prompts to evaluate and assess performance of pre-trained large language models, the method comprising:
obtaining a set of application domains of a pre-trained large language model (LLM) in which the pre-trained LLM will be used,
wherein the pre-trained LLM is configured to generate, in response to a received input, a response;
using the set of application domains, determining a set of guidelines defining one or more operation boundaries of the pre-trained LLM by mapping each application domain of the set of application domains to one or more guidelines of the set of guidelines;
determining a set of layers for the pre-trained LLM associated with the one or more guidelines of the set of guidelines,
wherein each layer within the set of layers includes a set of variables associated with the one or more guidelines of each corresponding layer, and
wherein each variable in the set of variables represents an attribute identified within the one or more guidelines of each corresponding layer;
for a first set of one or more layers of the set of layers, constructing a first test case comprising (1) a first layered prompt and (2) a first expected response,
wherein the first test case maps to a first scenario derived from the first set of one or more layers of the set of layers,
wherein the first layered prompt is configured to measure one or more values of a corresponding set of variables of the first set of one or more layers, and
wherein the first test case is configured to test the one or more operation boundaries of corresponding guidelines of the first set of the one or more layers of the set of layers;
executing the first test case to evaluate the pre-trained LLM by:
supplying the first layered prompt into the pre-trained LLM, and
responsive to inputting the first layered prompt, receiving, from the pre-trained LLM, for the first layered prompt, a set of responses;
comparing the first expected response of the first test case to the set of responses received from the pre-trained LLM;
using the comparison of the first expected response of the first test case to the set of responses received from the pre-trained LLM, dynamically constructing a second test case testing a second set of one or more layers of the set of layers occurring subsequent to the first set of one of more layers of the set of layers,
wherein the second test case maps to a second scenario derived from the second set of one or more layers of the set of layers,
wherein the second test case comprises: (1) a second layered prompt and (2) a second expected response, and
wherein the second test case is configured to test the one or more operation boundaries of corresponding guidelines of the second set of the one or more layers of the set of layers;
executing the second test case to evaluate the pre-trained LLM;
generating for display at a graphical user interface (GUI), a graphical layout including a first graphical representation indicating satisfaction of the LLM with the one or more guidelines of the set of guidelines of a corresponding application domain and a second graphical representation indicating the evaluations of the pre-trained LLM by the first test case and the second test case;
responsive to a user input received via the GUI, automatically executing a set of actions to modify one or more parameters of the pre-trained LLM; and
validating satisfaction of the pre-trained LLM with the set of guidelines by executing the first test case to compare the first expected response of the first test case with a second set of responses received from the pre-trained LLM.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
receiving an indicator of a type of application associated with the pre-trained LLM;
identifying a relevant set of layers associated with the type of the application defining one or more operation boundaries of the pre-trained LLM; and
obtaining the relevant set of layers, via an Application Programming Interface (API).

### Claim 3 (depends on 1)

The method of claim 1,
wherein the variables of the second set of the one or more layers of the set of layers are more complex than the variables of the first set of the one or more layers of the set of layers.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
using the comparison of the first expected response of the first test case to the set of responses received from the pre-trained LLM, generating an indicator of the pre-trained LLM indicating compliance of the pre-trained LLM with the corresponding guidelines of the first set of the one or more layers of the set of layers.

### Claim 5 (depends on 4)

The method of claim 4, wherein the indicator indicates one or more of:
the first set of the one or more layers,
the corresponding sets of variables of the first set of the one or more layers, or
predetermined weights used for each layer of the first set of the one or more layers.

### Claim 6 (depends on 1)

The method of claim 1, wherein the graphical representation indicating the satisfaction of the LLM with the one or more guidelines of the set of guidelines of the corresponding application domain includes one or more of:
a binary indicator indicating the satisfaction,
a category indicating the satisfaction, or
a probability of the satisfaction.

### Claim 7 (depends on 1)

The method of claim 1, wherein the set of layers is an LLM-specific set of layers, further comprising:
receiving an input indicative of an overall set of layers and the set of variables for each layer of the overall set of layers;
using an ML model, comparing the application domains within the overall set of layers with the obtained application domains related to the pre-trained LLM; and
extracting the LLM-specific set of layers from the overall set of layers using the comparison.

### Claim 8

A non-transitory, computer-readable storage medium storing instructions for constructing layered prompts to operate as an input into a pre-trained large language model (LLM), wherein the instructions when executed by at least one data processor of a system, cause the system to:
obtain a set of application domains of the pre-trained large language model (LLM) in which the pre-trained LLM will be used,
wherein the pre-trained LLM is configured to generate, in response to a received input, a response;
using the set of application domains, determine a set of guidelines defining one or more operation boundaries of the pre-trained LLM by mapping each application domain of the set of application domains to one or more guidelines of the set of guidelines using a degree of similarity between a vector representation of the application domain and a vector representation of each guideline of the set of guidelines;
determine a set of layers for the pre-trained LLM associated with the one or more guidelines of the set of guidelines,
wherein each layer within the set of layers includes a set of variables associated with the one or more guidelines of a corresponding layer, and
wherein each variable represents an attribute identified within the one or more guidelines of the corresponding layer;
for a first set of one or more layers of the set of layers, construct a first test case comprising (1) a first layered prompt and (2) a first expected response,
wherein the first test case maps to a first scenario derived from the first set of one or more layers of the set of layers, and
wherein the first test case is configured to test the one or more operation boundaries of the corresponding guidelines of the first set of the one or more layers of the set of layers;
execute the first test case to evaluate the pre-trained LLM by:
supplying the first test case into the pre-trained LLM, and
responsive to inputting the first layered prompt, receiving, from the pre-trained LLM, for the first layered prompt, a set of responses;
using the set of responses, dynamically construct a second test case associated with a second set of one or more layers of the set of layers,
wherein the second test case maps to a second scenario derived from the second set of one or more layers of the set of layers, and
wherein the second test case is configured to test the one or more operation boundaries of corresponding guidelines of the second set of the one or more layers of the set of layers;
generating for display at a graphical user interface (GUI), a layout including a representation indicating the evaluations of the pre-trained LLM by the first test case and the second test case;
responsive to a user input received via the GUI, automatically execute a set of actions to modify one or more parameters of the pre-trained LLM; and
validate satisfaction of the pre-trained LLM with the set of guidelines by executing the first test case to compare the first expected response of the first test case with a second set of responses received from the pre-trained LLM.

### Claim 9 (depends on 8)

The non-transitory, computer-readable storage medium of claim 8, wherein the instructions further cause the system to:
identify one or more new layers within the set of responses, and
iteratively update the set of layers by adding the one or more new layers to the set of layers.

### Claim 10 (depends on 8)

The non-transitory, computer-readable storage medium of claim 8, wherein the instructions further cause the system to:
assign a weight to each layer within the set of layers of the pre-trained LLM; and
using the set of responses, generate an overall score indicating satisfaction with the one or more operation boundaries of the corresponding guidelines of the first set of the one or more layers of the set of layers in accordance with the assigned weight of the first set of the one or more layers.

### Claim 11 (depends on 8)

The non-transitory, computer-readable storage medium of claim 8,
wherein the set of layers is dynamically determined by an ML model, and
wherein the ML model is configured to identify the set of application domains associated with the pre-trained LLM.

### Claim 12 (depends on 8)

The non-transitory, computer-readable storage medium of claim 8,
wherein the set of layers is determined by a received input, and
wherein the received input indicates the set of application domains associated with the pre-trained LLM.

### Claim 13 (depends on 8)

The non-transitory, computer-readable storage medium of claim 8,
wherein one or more of the layers within the set of layers relates to attempts to access data, and
wherein a corresponding set of variables of one or more of the layers relate to one or more of:
an author associated with the attempt,
a timestamp associated with the attempt,
a location associated with the attempt,
a presence of an authorization related to the attempt,
previous unsuccessful attempts to access the data, or
frequency of the attempts.

### Claim 14 (depends on 8)

The non-transitory, computer-readable storage medium of claim 8,
wherein one or more of the layers within the set of layers relates to quality of input data, and
wherein a corresponding set of variables of one or more of the layers relate to one or more of:
an author associated with the input data,
a timestamp associated with the input data,
a location associated with the input data,
a presence of structured metadata,
an absence of the structured metadata, or
outliers in the input data.

### Claim 15

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:
obtain a set of application domains of a large language model (LLM) in which the LLM will be used,
wherein the LLM is configured to generate, in response to a received input, a response;
using the set of application domains, determine a set of guidelines defining one or more operation boundaries of the LLM by mapping each application domain of the set of application domains to one or more guidelines of the set of guidelines using a degree of similarity between a vector representation of the application domain and a vector representation of each guideline of the set of guidelines;
determine a set of layers for the LLM associated with the one or more guidelines of the set of guidelines,
wherein each layer within the set of layers includes a set of variables associated with the one or more guidelines of a corresponding layer, and
wherein each variable represents an attribute identified within the one or more guidelines of the corresponding layer;
for a first set of one or more layers of the set of layers, construct a first test case comprising (1) a first layered prompt and (2) a first expected response,
wherein the first layered prompt is configured to measure one or more values of corresponding set of variables of the first set of one or more layers, and
wherein the first test case is configured to test a first set of the one or more operation boundaries of the set of guidelines;
execute the first test case to evaluate the LLM by:
supplying the first layered prompt into the LLM, and
responsive to inputting the first layered prompt, receiving, from the LLM, for the first test case, a set of responses;
using the received set of responses of the first layered prompt, dynamically construct a second layered prompt configured to operate as a second input into the LLM,
wherein the second layered prompt is configured to test a second set of the one or more operation boundaries of the set of guidelines;
generate for display at a graphical user interface (GUI), a layout including a representation indicating the evaluations of the LLM by the first test case and the second test case,
wherein the layout is rendered in accordance with a display attribute set,
wherein the display attribute set is associated with one or more of: a color, a graph, a numerical value, a chart, or a graphical overlay of the graphical user interface component, and
wherein the display attribute set is dynamically determined using the evaluations of the LLM by the first test case and the second test case.

### Claim 16 (depends on 15)

The system of claim 15, wherein the second set of the one or more operation boundaries of the set of guidelines is different from the first set of the one or more operation boundaries of the set of guidelines.

### Claim 17 (depends on 15)

The system of claim 15, wherein the set of guidelines include one or more of: governmental regulations of a specific jurisdiction, organization-specific regulations, or generative AI applications.

### Claim 18 (depends on 15)

The system of claim 15, wherein the second set of the one or more operation boundaries of the set of guidelines is the same as the first set of the one or more operation boundaries of the set of guidelines.

### Claim 19 (depends on 15)

The system of claim 15, wherein the instructions further cause the system to:
determine the set of guidelines, via a ML model, using one or more of:
a location of the LLM,
a use case of the LLM, or
data sources used in the LLM.

### Claim 20 (depends on 15)

The system of claim 15,
wherein
the representation is a first representation, and
wherein the layout includes a second representation of an indicator indicating satisfaction of the LLM with the one or more guidelines of the set of guidelines of a corresponding application domain.
