SYSTEMS AND METHODS FOR ITERATIVELY CONSTRUCTING DATA STRUCTURES FOR LANGUAGE MODEL CONTEXT GENERATION
Systems and methods for iteratively constructing data structures for language model context generation are disclosed. A system can receive, from a client device during a communication session, a first prompt for a language model. The system can determine that an intent of the first prompt does not satisfy one or more classification criteria. Responsive to determining that the intent does not satisfy the one or more classification criteria, the system can generate a message using the language model based on the first prompt, the message identifying at least one candidate intent. The system can receive, from the client device, a second prompt in response to the message. The system can generate a classification of the intent for the communication session based on the first prompt and the second prompt.
1 . A system, comprising:
one or more processors coupled to non-transitory memory and intermediary to a plurality of client devices and one or more language models, the one or more processors configured to:
receive, from a client device of the plurality of client devices during a communication session, a first prompt indicating a request for the one or more language models to generate an output message responsive to the request;
determine that an intent of the first prompt for the one or more language models does not satisfy one or more classification criteria;
responsive to determining that the intent does not satisfy the one or more classification criteria, provide the first prompt as input to the one or more language models to generate an intent message based on the first prompt, the intent message identifying at least one candidate intent;
receive, from the client device, a second prompt for the one or more language models in response to the intent message;
generate a classification of the intent for the communication session based on the first prompt and the second prompt;
responsive to generating the classification of the intent, generate an input context using the first prompt, the second prompt, and the classification of the intent;
provide the input context to the one or more language models to generate the output message;
receive, from the one or more language models, the output message responsive to the first prompt;
generate a response to the request based on the output message generated by the one or more language models; and
provide the response to the request to the client device.
2 . The system of claim 1 , wherein the one or more processors are further configured to:
generate the classification of the intent using the one or more language models.
3 . The system of claim 2 , wherein the one or more processors are further configured to:
identify a training dataset comprising a plurality of training examples, each example of the plurality of training examples comprising a respective input prompt having ambiguous intent and a corresponding ground truth output message identifying one or more candidate intents; and
train the one or more language models using the training dataset.
4 . The system of claim 1 , wherein the one or more processors are further configured to:
generate the classification of the intent using a machine-learning model different from the one or more language models.
5 . The system of claim 4 , wherein the one or more language models are large language models comprising generative pre-trained transformer (GPT) models.
6 . The system of claim 1 , wherein the one or more processors are further configured to:
determine a plurality of candidate intents based on the first prompt, the plurality of candidate intents including the at least one candidate intent, the intent message identifying the plurality of candidate intents; and
provide the intent message to the client device in response to the first prompt.
7 . The system of claim 1 , wherein the classification of the intent corresponds to one or more of a request for a wager recommendation, a request to modify a wager, a request for information relating to a live event, a request for information relating to at least one wager opportunity, a request to place a wager, or a request for information maintained by the one or more processors.
8 . The system of claim 1 , wherein the client device is associated with a player profile, and wherein the one or more processors are further configured to:
generate the classification of the intent for the communication session further based on data of the player profile associated with the client device.
9 . The system of claim 1 , wherein the one or more processors are further configured to:
establish the communication session in response to a request from an application executing on the client device; and
generate a second message for the communication session in response to the request.
10 . The system of claim 9 , wherein the one or more processors are further configured to:
determine the intent for the communication session further based on the second message.
11 . A method, comprising:
receiving, by one or more processors coupled to non-transitory memory and intermediary to a plurality of client devices and one or more language models, from a client device of the plurality of client devices during a communication session, a first prompt indicating a request for the one or more language models to generate an output message responsive to the request;
determining, by the one or more processors, that an intent of the first prompt for the one or more language models does not satisfy one or more classification criteria;
responsive to determining that the intent does not satisfy the one or more classification criteria, providing, by the one or more processors, the first prompt as input to the one or more language models to generate an intent message based on the first prompt, the intent message identifying at least one candidate intent;
receiving, by the one or more processors, from the client device, a second prompt for the one or more language models in response to the intent message;
generating, by the one or more processors, a classification of the intent for the communication session based on the first prompt and the second prompt;
responsive to generating the classification of the intent, generating, by the one or more processors, an input context using the first prompt, the second prompt, and the classification of the intent;
providing, by the one or more processors, the input context to the one or more language models to generate the output message;
receiving, by the one or more processors, from the one or more language models, the output message responsive to the first prompt;
generating, by the one or more processors, a response to the request based on the output message generated by the one or more language models; and
providing, by the one or more processors, the response to the request to the client device.
12 . The method of claim 11 , further comprising:
generating, by the one or more processors, the classification of the intent using the one or more language model models.
13 . The method of claim 12 , further comprising:
identifying, by the one or more processors, a training dataset comprising a plurality of training examples, each example of the plurality of training examples comprising a respective input prompt having ambiguous intent and a corresponding ground truth output message identifying one or more candidate intents; and
training, by the one or more processors, the one or more language models using the training dataset.
14 . The method of claim 11 , further comprising:
generating, by the one or more processors, the classification of the intent using a machine-learning model different from the one or more language models.
15 . The method of claim 14 , further comprising:
selecting, by the one or more processors, a language model comprising a generative pre-trained transformer (GPT) model.
16 . The method of claim 11 , further comprising:
determining, by the one or more processors, a plurality of candidate intents based on the first prompt, the plurality of candidate intents including the at least one candidate intent, the intent message identifying the plurality of candidate intents; and
providing, by the one or more processors, the intent message to the client device in response to the first prompt.
17 . The method of claim 11 , wherein the classification of the intent corresponds to one or more of a request for a wager recommendation, a request to modify a wager, a request for information relating to a live event, a request for information relating to at least one wager opportunity, a request to place a wager, or a request for information maintained by the one or more processors.
18 . The method of claim 11 , wherein the client device is associated with a player profile, and further comprising:
generating, by the one or more processors, the classification of the intent for the communication session further based on data of the player profile associated with the client device.
19 . The method of claim 11 , further comprising:
establishing, by the one or more processors, the communication session in response to a request from an application executing on the client device; and
generating, by the one or more processors, a second message for the communication session in response to the request.
20 . The method of claim 19 , further comprising:
determining, by the one or more processors, the intent for the communication session further based on the second message.