# US 12,118,320 B2 · Controlling generative language models for artificial intelligence characters

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

- Number: US 12,118,320 B2
- Document ID: US12118320B2
- Status: Granted
- Kind: B2
- Application number: 18/140,136
- Filed: 2023-04-27
- Published: 2023-11-02
- Granted: 2024-10-15
- Earliest claimed: 2022-04-28
- Assignees: Theai, Inc.
- Applicants: Theai, Inc.
- Inventors: Ilya Gelfenbeyn; Mikhail Ermolenko; Kylan Gibbs
- Web page: https://patentgrep.com/patent/US12118320B2

## CPC

- G06F 40/30: Semantic analysis
- G06F 40/35: Discourse or dialogue representation
- G06F 40/20: Natural language analysis (semantic analysis of natural language G06F40/30)
- G06F 40/56: Natural language generation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods for conducting communications between a user and an Artificial Intelligence (AI) character model are provided. An example method includes determining a context of a dialog between the AI character model and the user, the context being determined based on a data stream received from a client-side computing device associated with the user; receiving a message of the user in the dialog; and generating, based on the context and the message, an input to a language model configured to predict a response to the message; providing the input to the language model to obtain the response; and transmitting the response to the client-side computing device, where the client-side computing device presents the response to the user. The input to the language model includes the message expanded by a keyword associated with the context. The context includes an intent of the user and an emotional state of the user.

## Claims

### Claim 1

A method for conducting communications between a user and an Artificial Intelligence (AI) character model, the method being implemented with a processor of a computing platform providing the AI character model, the method comprising:
determining, by the processor, based on a data stream received from a client-side computing device associated with the user, a context of a dialog between the AI character model and the user in a virtual environment, the AI character model and the virtual environment being displayed on the client-side computing device by an application running on the client-side computing device, the application communicating with the computing platform using a pre-determined communication protocol associated with the application;
receiving, by the processor, a message from the user in the dialog;
passing, by the processor, the context and the message through a plurality of heuristics machine learning models to produce intermediate outputs of the plurality of heuristics machine learning models;
upon the producing the intermediate outputs of the plurality of heuristics machine learning models, composing, by the processor and based on the intermediate outputs of the plurality of heuristics machine learning models and a predetermined templated format ingestible by a language model, dialogue prompts being an input to the language model configured to predict a response to the message, the context including parameters of an event occurring in the virtual environment independently of the dialog between the AI character model and the user;
upon the composing the dialogue prompts, providing, by the processor, the input to the language model to obtain the response, wherein the language model is configured to:
process the input to form a request for a large language model, the processing including at least one of classifying and adjusting the message based on the context;
provide the request to the large language model;
receive, from the large language model, a model response to the request; and
modify the model response from the large language model based on predetermined criteria to form the response, wherein the modification includes adding, to the model response, a specific word corresponding to a current emotional state of the AI character model; and
transmitting, by the processor, the response to the client-side computing device, wherein the client-side computing device presents the response to the user.

### Claim 2 (depends on 1)

The method of claim 1, wherein the language model includes a generative language model configured to predict, based on a sequence of words, at least one further word to follow the sequence of words.

### Claim 3 (depends on 1)

The method of claim 1, wherein the input to the language model includes the message expanded by at least one keyword associated with the context or structured data.

### Claim 4 (depends on 1)

The method of claim 1, wherein the input to the language model includes the message and a parameter associated with the language model, the parameter being determined based on the context.

### Claim 5 (depends on 1)

The method of claim 1, wherein the input includes third party data retrieved, based on the context, from one or more online web resources.

### Claim 6 (depends on 1)

The method of claim 1, wherein the context includes parameters of a scene associated with the AI character model in the virtual environment generated by the client-side computing device.

### Claim 7 (depends on 1)

The method of claim 1, wherein the context includes an intent of the user during the dialog.

### Claim 8 (depends on 1)

The method of claim 1, wherein the context includes an intent of the AI character model during the dialog.

### Claim 9 (depends on 1)

The method of claim 1, wherein the context includes an emotional state of the user.

### Claim 10 (depends on 1)

The method of claim 1, wherein the context includes the current emotional state of the AI character model.

### Claim 11

A computing platform for providing an Artificial Intelligence (AI) character model, the computing platform comprising:
a processor; and
a memory storing instructions that, when executed by the processor, configure the computing platform to:
determine, based on a data stream received from a client-side computing device associated with a user, a context of a dialog between the AI character model and the user in a virtual environment, the AI character model and the virtual environment being displayed on the client-side computing device by an application running on the client-side computing device, the application communicating with the computing platform using a pre-determined communication protocol associated with the application;
receive a message of the user in the dialog;
pass the context and the message through a plurality of heuristics machine learning models to produce intermediate outputs of the plurality of heuristics machine learning models;
upon the producing the intermediate outputs of the plurality of heuristics machine learning models, compose, based on the intermediate outputs of the plurality of heuristics machine learning models and a predetermined templated format ingestible by a language model, dialogue prompts being an input to the language model configured to predict a response to the message, the context including parameters of an event occurring in the virtual environment independently of the dialog between the AI character model and the user;
upon the composing the dialogue prompts, provide the input to the language model to obtain the response, wherein the language model is configured to:
process the input to form a request for a large language model, the processing including at least one of classifying and adjusting the message based on the context;
provide the request to the large language model;
receive, from the large language model, a model response to the request; and
modify the model response from the large language model based on predetermined criteria to form the response, wherein the modification includes adding, to the model response, a specific word corresponding to a current emotional state of the AI character model; and
transmit the response to the client-side computing device, wherein the client-side computing device presents the response to the user.

### Claim 12 (depends on 11)

The computing platform of claim 11, wherein the language model includes a generative language model configured to predict, based on a sequence of words, at least one further word to follow the sequence of words.

### Claim 13 (depends on 11)

The computing platform of claim 11, wherein the input to the language model includes the message expanded by at least one keyword associated with the context.

### Claim 14 (depends on 11)

The computing platform of claim 11, wherein the input to the language model includes the message and a parameter associated with the language model, the parameter being determined based on the context.

### Claim 15 (depends on 11)

The computing platform of claim 11, wherein the input includes third party data retrieved, based on the context, from one or more online web resources.

### Claim 16 (depends on 11)

The computing platform of claim 11, wherein the context includes parameters of a scene associated with the AI character model in the virtual environment generated by the client-side computing device.

### Claim 17 (depends on 11)

The computing platform of claim 11, wherein the context includes an intent of the user during the dialog.

### Claim 18 (depends on 11)

The computing platform of claim 11, wherein the context includes an intent of the AI character model during the dialog.

### Claim 19 (depends on 11)

The computing platform of claim 11, wherein the context includes an emotional state of the user.

### Claim 20

A non-transitory computer-readable storage medium, the computer-readable storage medium including instructions that, when executed by a processor of a computing platform providing an Artificial Intelligence (AI) character model, cause the computing platform to:
determine, based on a data stream received from a client-side computing device associated with a user, a context of a dialog between the AI character model and the user in a virtual environment, the AI character model and the virtual environment being displayed on the client-side computing device by an application running on the client-side computing device, the application communicating with the computing platform using a pre-determined communication protocol associated with the application;
receive a message of the user in the dialog;
pass the context and the message through a plurality of heuristics machine learning models to produce intermediate outputs of the plurality of heuristics machine learning models;
upon the producing the intermediate outputs of the plurality of heuristics machine learning models, compose, based on the intermediate outputs of the plurality of heuristics machine learning models and a predetermined templated format ingestible by a language model, dialogue prompts being an input to the language model configured to predict a response to the message, the context including parameters of an event occurring in the virtual environment independently of the dialog between the AI character model and the user;
upon the composing the dialogue prompts, provide the input to the language model to obtain the response, wherein the language model is configured to:
process the input to form a request for a large language model, the processing including at least one of classifying and adjusting the message based on the context;
provide the request to the large language model;
receive, from the large language model, a model response to the request; and
modify the model response from the large language model based on predetermined criteria to form the response, wherein the modification includes adding, to the model response, a specific word corresponding to a current emotional state of the AI character model; and
transmit the response to the client-side computing device, wherein the client-side computing device presents the response to the user.
