# US 2025/0211615 A1 · Logical Language Model Prompts for Fraud Detection

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

- Number: US 2025/0211615 A1
- Document ID: US20250211615A1
- Status: Published application
- Kind: A1
- Application number: 18/650,312
- Filed: 2024-04-30
- Published: 2025-06-26
- Earliest claimed: 2023-12-20
- Assignees: Bitdefender IPR Management Ltd.
- Applicants: Bitdefender IPR Management Ltd.
- Inventors: Constantin D. CERNAT; Ovidiu M. CRACIUN
- Web page: https://patentgrep.com/patent/US20250211615A1

## CPC

- H04L 63/1483: {service impersonation, e.g. phishing, pharming or web spoofing (detection of rogue wireless access points H04W12/12)}
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F 40/30: Semantic analysis
- G06F 40/40: Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30)
- H04L 63/1416: {Event detection, e.g. attack signature detection}
- H04L 63/1425: {Traffic logging, e.g. anomaly detection}
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In some embodiments, a security chatbot comprises a generative language module (GLM) and a prompt manager configured to dynamically update the GLM input prompt according to the output of the GLM. The input prompt instructs the GLM to carry out a task (e.g., determine whether a target message received by a user is indicative of online fraud) and in response, to output a specific flag token. In response to detecting the flag token within the output of the GLM, the prompt manager may selectively execute a code snippet identified according to the respective flag token. Executing the code snippet effectively updates the prompt, which is then fed back to the GLM for the next inference step. In contrast to conventional LLM prompting, updates to the prompt herein comprise modifications (e.g., insertion of other flag tokens, etc.) other than merely appending an inferred token to the previous prompt. Furthermore, the prompt modifications are performed inline, i.e., without submitting an entirely new prompt to the GLM.

## Claims

### Claim 1

A computer system comprising at least one hardware processor configured to analyze a target text formulated in a natural language, wherein analyzing the target text comprises executing a prompt manager communicatively coupled to a generative language module (GLM), wherein:
the GLM is configured to:
receive from the prompt manager a language model (LM) prompt formulated in the natural language, and
in response, output to the prompt manager a predicted token comprising a likely continuation of the received LM prompt; and
the prompt manager is configured to:
receive a logical prompt, the logical prompt including the target text and a code snippet comprising computer code for updating the LM prompt,
formulate the LM prompt according to the logical prompt, the LM prompt instructing the GLM to perform a text analysis task according to the target text and in response, to output a flag token,
in response to receiving the predicted token, initiate an execution of the code snippet to produce an updated LM prompt,
transmit the updated LM prompt to the GLM, and
formulate a reply message comprising a result of analyzing the target text, the reply message formulated according to an output of the GLM in response to the updated LM prompt.

### Claim 2 (depends on 1)

The computer system of claim 1, wherein the execution of the code snippet causes the prompt manager to:
determine whether the predicted token includes the flag token; and
in response, if the predicted token includes the flag token, insert an LM instruction into the LM prompt, the LM instruction instructing the GLM to perform another text analysis task according to the target text.

### Claim 3 (depends on 2)

The computer system of claim 2, wherein the LM instruction further instructs the GLM to output another flag token in response to performing the other text analysis task.

### Claim 4 (depends on 1)

The computer system of claim 1, wherein:
the prompt manager is configured to formulate the LM prompt to further include a placeholder token; and
the execution of the code snippet causes the prompt manager to insert a set of supplemental tokens into the LM prompt at a position of the placeholder token.

### Claim 5 (depends on 1)

The computer system of claim 1, wherein the execution of the code snippet causes the prompt manager to perform an action selected from a group consisting of inserting a plurality of supplemental tokens into the LM prompt and deleting a set of tokens from the LM prompt.

### Claim 6 (depends on 1)

The computer system of claim 1, wherein the execution of the code snippet causes the prompt manager to delete the flag token from the LM prompt.

### Claim 7 (depends on 1)

The computer system of claim 1, wherein:
the logical prompt comprises a plurality of code snippets for updating the LM prompt, the plurality of code snippets including the code snippet;
the prompt manager is configured to associate each code snippet of the plurality of code snippets with a distinct flag token of a plurality of flag tokens; and
producing the updated LM prompt comprises executing a selected code snippet of the plurality of code snippets according to whether the predicted token includes a selected flag token of the plurality of flag tokens.

### Claim 8 (depends on 1)

The computer system of claim 1, wherein the flag token comprises an attribute-value pair.

### Claim 9 (depends on 1)

The computer system of claim 1, wherein the text analysis task comprises an item selected from a group consisting of determining whether the target text is indicative of online fraud, determining whether the target text comprises fake news, and determining whether the target text is indicative of hate speech.

### Claim 10

A computer-implemented method of analyzing a target text formulated in a natural language, the method comprising employing at least one hardware processor of a computer system to execute a prompt manager communicatively coupled to a generative language module (GLM), wherein:
the GLM is configured to:
receive from the prompt manager a language model (LM) prompt formulated in the natural language, and
in response, output to the prompt manager a predicted token comprising a likely continuation of the received LM prompt; and
executing the prompt manager comprises:
receiving a logical prompt, the logical prompt including the target text and a code snippet comprising computer code for updating the LM prompt,
formulating the LM prompt according to the logical prompt, the LM prompt instructing the GLM to perform a text analysis task according to the target text and in response, to output a flag token,
in response to receiving the predicted token, initiating an execution of the code snippet to produce an updated LM prompt,
transmitting the updated LM prompt to the GLM, and
formulating a reply message comprising a result of analyzing the target text, the reply message formulated according to an output of the GLM in response to the updated LM prompt.

### Claim 11 (depends on 10)

The method of claim 10, wherein the execution of the code snippet causes the prompt manager to:
determine whether the predicted token includes the flag token; and
in response, if the predicted token includes the flag token, insert an LM instruction into the LM prompt, the LM instruction instructing the GLM to perform another text analysis task according to the target text.

### Claim 12 (depends on 11)

The method of claim 11, wherein the LM instruction further instructs the GLM to output another flag token in response to performing the other text analysis task.

### Claim 13 (depends on 10)

The method of claim 10, wherein:
the prompt manager is configured to formulate the LM prompt to further include a placeholder token; and
the execution of the code snippet causes the prompt manager to insert a set of supplemental tokens into the LM prompt at a position of the placeholder token.

### Claim 14 (depends on 10)

The method of claim 10, wherein the execution of the code snippet causes the prompt manager to perform an action selected from a group consisting of inserting a plurality of supplemental tokens into the LM prompt and deleting a set of tokens from the LM prompt.

### Claim 15 (depends on 10)

The method of claim 10, wherein the execution of the code snippet causes the prompt manager to delete the flag token from the LM prompt.

### Claim 16 (depends on 10)

The method of claim 10, wherein:
the logical prompt comprises a plurality of code snippets including the code snippet;
the prompt manager is configured to associate each code snippet of the plurality of code snippets with a distinct flag token of a plurality of flag tokens; and
producing the updated LM prompt comprises executing a selected code snippet of the plurality of code snippets according to whether the predicted token includes a selected flag token of the plurality of flag tokens.

### Claim 17 (depends on 10)

The method of claim 10, wherein the flag token comprises an attribute-value pair.

### Claim 18 (depends on 10)

The method of claim 10, wherein the text analysis task comprises an item selected from a group consisting of determining whether the target text is indicative of online fraud, determining whether the target text comprises fake news, and determining whether the target text is indicative of hate speech.

### Claim 19

A non-transitory computer-readable medium storing instructions which, when executed by at least one hardware processor of a computer system, cause the computer system to analyze a target text formulated in a natural language, wherein analyzing the target text comprises executing a prompt manager communicatively coupled to a generative language module (GLM), wherein:
the GLM is configured to:
receive from the prompt manager a language model (LM) prompt formulated in a natural language, and
in response, output to the prompt manager a predicted token comprising a likely continuation of the received LM prompt; and
the prompt manager is configured to:
receive a logical prompt, the logical prompt including the target text and a code snippet comprising computer code for updating the LM prompt,
formulate the LM prompt according to the logical prompt, the LM prompt instructing the GLM to perform a text analysis task according to the target text and in response, to output a flag token,
in response to receiving the predicted token, initiate an execution of the code snippet to produce an updated LM prompt,
transmit the updated LM prompt to the GLM, and
formulate a reply message comprising a result of analyzing the target text, the reply message formulated according to an output of the GLM in response to the updated LM prompt.
