Decoupling memory and computation to enable privacy across multiple knowledge bases of user data
Systems and methods are provided herein for utilizing a knowledge base to improve online automated dialogue responses based on machine learning models. Contextual customer data stored in external memory may be used for retraining a machine learning model to incorporate new observations into the model and to reduce bias and/or improve fairness in associated automated responses without having to retrain an entire memory architecture. The disclosed technology may improve the accuracy of machine learning models by using potentially private contextual customer data to inform the model while eliminating the ability of an intruder to access such data when the model is utilized in cloud-based services.
1 . A system for adapting a response of a trained neural network using customer contextual data while controlling bias, the system comprising:
one or more processors;
a trained neural network comprising a long-short term memory (LSTM) encoder and a LSTM decoder;
one or more knowledge bases external to the trained neural network and configured to store sensitive customer data;
a contextual trainer in communication with the trained neural network and the one or more knowledge bases; and
memory in communication with the one or more processors and storing instructions that, when executed by the one or more processors, cause the one or more processors to:
translate, by the contextual trainer, the sensitive customer data from the one or more knowledge bases into keys;
receive, by the trained neural network, an input observation x comprising a customer query;
continuously listen for, by the trained neural network, one or more commands issued by the contextual trainer, wherein the one or more commands are configured to program the trained neural network to formulate and revise responses to the customer query based on one or more rules;
generate, by the trained neural network, a latent activation representation h based on the input observation x by:
receiving, by the LSTM encoder, the input observation x;
outputting, by the LSTM encoder, a context-sensitive hidden representation of the input observation x;
receiving, by the LSTM decoder, the context-sensitive hidden representation of the input observation x; and
predicting, by the LSTM decoder, a sequence of words associated with the input observation x based on the context-sensitive hidden representation of the input observation x;
modify, by the contextual trainer, the latent activation representation h from the trained neural network based on one or more of the keys to generate a modified latent activation representation h fair ,
wherein the one or more keys provide a uniform distribution over the sensitive customer data to eliminate bias in a first response to the customer query;
generate, by the contextual trainer, a normalized version of the modified latent activation representation h fair ;
store the normalized version of the modified latent activation representation h fair in the memory thereby increasing the capacity of the trained neural network; and
output, by the contextual trainer, a predicted sequence v based at least in part on the normalized version of the modified latent activation representation h fair ,
wherein the predicted sequence ŷ comprises the first response to the customer query, the first response based on the sensitive customer data and free of the sensitive customer data.
2 . The system of claim 1 , wherein the trained neural network comprises the LSTM encoder in communication with the LSTM decoder, wherein the LSTM encoder is configured to receive the input observation x and provide an encoded latent activation output h enco , wherein the LSTM decoder is configured to receive the encoded latent activation output h enco and a target response input y to produce a decoded latent activation representation h deco for input to the contextual trainer.
3 . The system of claim 2 , further comprising a Natural Language Processing (NLP) device in communication with the contextual trainer, wherein the input observation x comprises dialogue received from a customer, and the target response input y comprises an intermediate response generated by the Natural Language Processing (NLP) device.
4 . The system of claim 1 , wherein the predicted sequence ŷ is a word-by-word concatenation based on the sensitive customer data.
5 . The system of claim 1 , wherein the predicted sequence v is output for review by a customer in response to the input observation x.
6 . The system of claim 1 , wherein the contextual trainer is configured to compute an Attention score, wherein logits of the Attention score comprise unnormalized probabilities for predicting an i th token of the predicted sequence ŷ.
7 . The system of claim 1 , wherein the trained neural network comprises one or more Seq2seq models.
8 . The system of claim 1 , wherein the contextual trainer occupies memory external to the trained neural network.
9 . The system of claim 1 , wherein the trained neural network is trained offline and is configured to receive textual data and memorize sequential patterns.
10 . The system of claim 1 , wherein the sensitive customer data comprises information associated with one or more of age, gender, or combinations thereof.
11 . The system of claim 1 , wherein the uniform distribution comprises a uniform gender distribution comprising a sequence of tokens annotated with first gender information.
12 . A contextual trainer comprising:
one or more processors; and
memory in communication with the one or more processors and storing instructions that, when executed by the one or more processors, cause the one or more processors to:
receive sensitive customer data;
translate the sensitive customer data into keys, wherein the keys provide a uniform distribution over the sensitive customer data to eliminate bias in a first response to a customer query;
issue one or more commands to a trained neural network thereby programming the trained neural network to formulate and revise responses to the customer query based on one or more rules;
receive, from the trained neural network, a latent activation representation h based on an input observation x received by the trained neural network, the input observation x comprising the customer query;
store a normalized version of the latent activation representation h in the memory thereby increasing the capacity of the trained neural network;
input the latent activation representation h and the keys into an Attention mechanism configured to determine unnormalized probabilities for predicting an i th token of a predicted sequence ŷ;
generate an Attention mechanism output responsive to inputting the latent activation representation h and the keys into the Attention mechanism;
apply a Softmax function to the Attention mechanism output to generate a Softmax output; and
output the predicted sequence ŷ based at least in part on the Softmax output,
wherein the predicted sequence ŷ comprises the first response to the customer query, the first response based on the sensitive customer data and free of the sensitive customer data.
13 . The contextual trainer of claim 12 , wherein the predicted sequence v comprises a revised trained neural network response adapted using the sensitive customer data.
14 . A method for adapting a trained neural network response using customer contextual data while controlling bias, the method comprising:
translating, by a contextual trainer, sensitive customer data from one or more knowledge bases into keys using a contextual trainer;
receiving, by a trained neural network, an input observation x, wherein the trained neural network comprises a long-short term memory (LSTM) encoder and a LSTM decoder, and wherein the input observation x comprises a customer query;
continuously listening for, by the trained neural network, one or more commands issued by the contextual trainer, wherein the one or more commands are configured to program the trained neural network to formulate and revise responses to the customer query based on one or more rules;
generating, by the trained neural network, a latent activation representation h based on the input observation x by:
receiving, by the LSTM encoder, the input observation x;
outputting, by the LSTM encoder, a context-sensitive hidden representation of the input observation x;
receiving, by the LSTM decoder, the context-sensitive hidden representation of the input observation x; and
predicting, by the LSTM decoder, a sequence of words associated with the input observation x based on the context-sensitive hidden representation of the input observation x;
modifying, by the contextual trainer, the latent activation representation h from the trained neural network based on one or more of the keys to generate a modified latent activation representation h fair ,
wherein the one or more keys provide a uniform distribution over the sensitive customer data to eliminate bias in a response to the customer query;
generating, by the contextual trainer, a normalized version of the modified latent activation representation h fair ,
storing the normalized version of the modified latent activation representation h fair in a memory thereby increasing the capacity of the trained neural network; and
outputting, by the contextual trainer, a predicted sequence ŷ based at least in part on the normalized version of the modified latent activation representation h fair ,
wherein the predicted sequence v comprises the response to the customer query, the response based on the sensitive customer data and free of the sensitive customer data.
15 . The method of claim 14 , wherein the trained neural network comprises the LSTM encoder in communication with the LSTM decoder, wherein the LSTM encoder is configured to receive the input observation x and provide an encoded latent activation output h enco , wherein the LSTM decoder is configured to receive the encoded latent activation output h enco and a target response input y to produce a decoded latent activation representation h deco for input to the contextual trainer.
16 . The method of claim 15 , wherein the input observation x comprises dialogue received from a customer, and the target response input y comprises an intermediate response generated by a Natural Language Processing (NLP) device.
17 . The method of claim 14 , wherein the predicted sequence ŷ is a word-by-word concatenation based on the sensitive customer data received from the one or more knowledge bases.
18 . The method of claim 14 , wherein the customer query is received from a customer and the predicted sequence ŷ is output for review by the customer.
19 . The method of claim 14 , wherein the contextual trainer occupies memory external to the trained neural network.