# Patent

## Title
Adversarial bootstrapping for multi-turn dialogue model training

## Abstract

Systems described herein may use machine classifiers to perform a variety of natural language understanding tasks including, but not limited to multi-turn dialogue generation. Machine classifiers in accordance with aspects of the disclosure may model multi-turn dialogue as a one-to-many prediction task. The machine classifier may be trained using adversarial bootstrapping between a generator and a discriminator with multi-turn capabilities. The machine classifiers may be trained in both auto-regressive and traditional teacher-forcing modes, with the maximum likelihood loss of the auto-regressive outputs being weighted by the score from a metric-based discriminator model. The discriminators input may include a mixture of ground truth labels, the teacher-forcing outputs of the generator, and/or negative examples from the dataset. This mixture of input may allow for richer feedback on the autoregressive outputs of the generator. Additionally, dual sampling may improve response relevance and coherence by overcoming the problem of exposure bias.

## Background
CROSS-REFERENCE TO RELATED APPLICATIONS
The instant application claims priority to U.S. Provisional Patent Application No. 62/851,956, titled “Adversarial Bootstrapping for Multi-Turn Dialog Model Training” and filed May 23, 2019, the disclosure of which is hereby incorporated by reference in its entirety.


TECHNICAL FIELD
The present disclosure is generally related to the generation of automated responses to user input.
BACKGROUND
Computer generated responses to user input such as dialogue, images, and the like, are often limited in diversity and/or not particularly relevant to the user input. For example, computer generated responses to user input such as dialogue in conventional systems may include phrases such as “I don't know,” “I'm sorry,” and “I don't know what you are talking about,” that are safe, limited in diversity, and not particularly relevant to the topic of the conversation.
While advances in machine learning, especially within deep neural networks, have enabled new capacity for machines to learn behavior from repository human behavioral data, existing neural network architecture and/or methodology continue to produce computer generated responses to user input that are limited in diversity and/or not particularly relevant to the topic of the input data. Aspects described herein may address these and other problems, and generally improve the quality and capabilities of machine classifiers trained to perform classification tasks.
SUMMARY
The following presents a simplified summary of various aspects described herein. This summary is not an extensive overview, and is not intended to identify key or critical elements or to delineate the scope of the claims. The following summary merely presents some concepts in a simplified form as an introductory prelude to the more detailed description provided below. Corresponding apparatus, systems, and computer-readable media are also within the scope of the disclosure.
Systems described herein may use machine classifiers to perform a variety of natural language understanding tasks including, but not limited to multi-turn dialogue generation. Existing open domain neural dialogue models are known to produce responses that lack relevance, diversity, and in many cases coherence. These shortcomings stem from the limited ability of common training objectives to directly express these properties as well as their interplay with training datasets and model architectures. In a variety of embodiments, machine classifiers may model multi-turn dialogue as a one-to-many prediction task. The machine classifier may be trained using adversarial bootstrapping between a generator and a discriminator with multi-turn capabilities. The machine classifiers may be trained in both auto-regressive and traditional teacher-forcing modes, with the maximum likelihood loss of the auto-regressive outputs being weighted by the score from a metric-based discriminator model. The discriminator input may include a mixture of ground truth labels, the teacher-forcing outputs of the generator, and/or negative examples from the dataset. This mixture of input data may allow for richer feedback on the autoregressive outputs of the generator. Additionally, dual sampling may improve response relevance and coherence by overcoming the problem of exposure bias such as, but not limited to, behavioral differences between teacher-forcing training and autoregressive inference. Several strategies may be used for sampling the generator's autoregressive outputs during training to encourage diversity without sacrificing relevance.
These features, along with many others, are discussed in greater detail below.



BRIEF DESCRIPTION OF THE DRAWINGS
The present disclosure is described by way of example and not limited in the accompanying figures in which like reference numerals indicate similar elements and in which:
FIG. 1 shows an example of an operating environment in which one or more aspects described herein may be implemented;
FIG. 2 shows an example computing device in accordance with one or more aspects described herein;
FIGS. 3A-B show an example of a machine classifier in accordance with one or more aspects described herein;
FIG. 4 shows a flow chart of a process for training a machine classifier according to one or more aspects of the disclosure; and
FIG. 5 shows a flow chart of a process for classifying data according to one or more aspects of the disclosure.



DETAILED DESCRIPTION
In the following description of the various embodiments, reference is made to the accompanying drawings, which form a part hereof, and in which is shown by way of illustration various embodiments in which aspects of the disclosure may be practiced. It is to be understood that other embodiments may be utilized and structural and functional modifications may be made without departing from the scope of the present disclosure. Aspects of the disclosure are capable of other embodiments and of being practiced or being carried out in various ways. In addition, it is to be understood that the phraseology and terminology used herein are for the purpose of description and should not be regarded as limiting. Rather, the phrases and terms used herein are to be given their broadest interpretation and meaning.
By way of introduction, aspects discussed herein may relate to methods and techniques for training machine classifiers using adversarial bootstrapping techniques. These machine classifiers may be used to generate data based on a variety of input data, such as multi-turn dialogue responses. Conventional systems for generating responses in multi-turn dialogues often produce irrelevant or non-useful responses to user input due in part to the criterion for the training and application stages being different and generated responses tend to be either generic, out-of-context, or disproportionately short. For example, conventional dialogue generation models may be trained with teacher forcing methods where during training, the generator generates the next word in the response by taking the past word from an actual human response (e.g. past input) rather than the past output of the generator. However, during the application stage, the generator may produce irrelevant responses to the user input because it is only able to use its own past input. This discrepancy between training and inference is known as exposure bias and significantly limits the informativeness of the responses as the decoding error compounds rapidly during inference. To address exposure bias, conventional systems typically use a scheduled sampling technique where the machine learning module is encouraged to use its own past output word as the basis to generate new responses. However, this may easily lead to instabilities. Additionally, conventional systems may also produce responses to user input that are limited in diversity because diversity is often not encouraged during the training stage but expected during the application stage. To address diversity, conventional systems may apply heuristic techniques to the output of a machine learning module. However, this typically does not provide the same quality and quantity of diversity as introducing diversity during the training stage. Additionally, some conventional systems address diversity by using maximum mutual information criteria; however, this still provides limited diversity in generated outputs.
Human conversations contain a large number of generic, uninformative responses, giving rise to word-level syntactic and utterance-level semantic redundancy. The syntactic redundancy is evident from a nonuniform sequence entropy profile, that is concave with respect to token position, with the tokens at the beginning and end of a sequence having lower entropy than those in the middle. This initial positive energy gradient may create learning barriers leading to a poor calibration of the model's output distribution, and is a major contributing factor to the short, generic outputs in existing dialogue models. Earlier conversation models including single-turn sequence-to-sequence architectures typically fail to capture long-term temporal dependencies across conversation turns. Such models tend to fail in multi-turn scenarios, generating repetitive responses that are dull and generic. Existing dialogue models typically learn the conditional distribution of the response given the context (either single- or multi-turn), from the maximum likelihood estimation. Due to the redundant nature of dialogue data and the greedy nature of maximum likelihood estimation, the model usually learns just a simple mapping between the context and response, which yields generic responses. Further, the use of maximum likelihood estimate exacerbates one-to-many and class-imbalance problems in generating responses in multi-turn dialogue tasks, leading to uninteresting and generic responses.
Systems and methods described herein may use machine classifiers to perform a variety of natural language understanding tasks including, but not limited to multi-turn dialogue generation. Machine classifiers in accordance with aspects of the disclosure may model multi-turn dialogue as a one-to-many prediction task. The machine classifier may be trained using adversarial bootstrapping between a generator and a discriminator with multi-turn capabilities. The machine classifiers may be trained in both auto-regressive and traditional teacher-forcing modes, with the maximum likelihood loss of the auto-regressive outputs being weighted by the score from a metric-based discriminator model. The discriminators input may include a mixture of ground truth labels, the teacher-forcing outputs of the generator, and/or negative examples from the dataset. This mixture of input may allow for richer feedback on the autoregressive outputs of the generator. Additionally, dual sampling may improve response relevance and coherence by overcoming the problem of exposure bias.
Operating Environments and Computing Devices
FIG. 1 shows an operating environment 100. The operating environment 100 may include at least one client device 110, at least one task server system 130, and/or at least one classification server system 120 in communication via a network 140. It will be appreciated that the network connections shown are illustrative and any means of establishing a communications link between the computers may be used. The existence of any of various network protocols such as TCP/IP, Ethernet, FTP, HTTP and the like, and of various wireless communication technologies such as GSM, CDMA, WiFi, and LTE, is presumed, and the various computing devices described herein may be configured to communicate using any of these network protocols or technologies. Any of the devices and systems described herein may be implemented, in whole or in part, using one or more computing systems described with respect to FIG. 2.
Client devices 110 may provide data and/or interact with a variety of machine classifiers as described herein. Classification server systems 120 may store, train, and/or provide a variety of machine classifiers as described herein. Task server systems 130 may exchange data with client devices 110, provide training data to the classification server systems 120, provide input data to the classification server systems 120 for classification, and/or obtain classified data from the classification server systems 120 as described herein. However, it should be noted that any computing device in the operating environment 100 may perform any of the processes and/or store any data as described herein. The task server systems 130 and/or classification server systems 120 may be publicly accessible and/or have restricted access. Access to a particular server system may be limited to particular client devices 110. Some or all of the data described herein may be stored using one or more databases. Databases may include, but are not limited to relational databases, hierarchical databases, distributed databases, in-memory databases, flat file databases, XML databases, NoSQL databases, graph databases, and/or a combination thereof. The network 140 may include a local area network (LAN), a wide area network (WAN), a wireless telecommunications network, and/or any other communication network or combination thereof.
The data transferred to and from various computing devices in operating environment 100 may include secure and sensitive data, such as confidential documents, customer personally identifiable information, and account data. Therefore, it may be desirable to protect transmissions of such data using secure network protocols and encryption, and/or to protect the integrity of the data when stored on the various computing devices. A file-based integration scheme or a service-based integration scheme may be utilized for transmitting data between the various computing devices. Data may be transmitted using various network communication protocols. Secure data transmission protocols and/or encryption may be used in file transfers to protect the integrity of the data such as, but not limited to, File Transfer Protocol (FTP), Secure File Transfer Protocol (SFTP), and/or Pretty Good Privacy (PGP) encryption. In many embodiments, one or more web services may be implemented within the various computing devices. Web services may be accessed by authorized external devices and users to support input, extraction, and manipulation of data between the various computing devices in the operating environment 100. Web services built to support a personalized display system may be cross-domain and/or cross-platform, and may be built for enterprise use. Data may be transmitted using the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocol to provide secure connections between the computing devices. Web services may be implemented using the WS-Security standard, providing for secure SOAP messages using XML encryption. Specialized hardware may be used to provide secure web services. Secure network appliances may include built-in features such as hardware-accelerated SSL and HTTPS, WS-Security, and/or firewalls. Such specialized hardware may be installed and configured in the operating environment 100 in front of one or more computing devices such that any external devices may communicate directly with the specialized hardware.
Turning now to FIG. 2, a conceptual illustration of a computing device 200 that may be used to perform any of the techniques as described herein is shown. The computing device 200 may include a processor 203 for controlling overall operation of the computing device 200 and its associated components, including RAM 205, ROM 207, input/output device 209, communication interface 211, and/or memory 215. A data bus may interconnect processor(s) 203, RAM 205, ROM 207, memory 215, I/O device 209, and/or communication interface 211. In some embodiments, computing device 200 may represent, be incorporated in, and/or include various devices such as a desktop computer, a computer server, a mobile device, such as a laptop computer, a tablet computer, a smart phone, any other types of mobile computing devices, and the like, and/or any other type of data processing device.
Input/output (I/O) device 209 may include a microphone, keypad, touch screen, and/or stylus through which a user of the computing device 200 may provide input, and may also include one or more of a speaker for providing audio output and a video display device for providing textual, audiovisual, and/or graphical output. Software may be stored within memory 215 to provide instructions to processor 203 allowing computing device 200 to perform various actions. Memory 215 may store software used by the computing device 200, such as an operating system 217, application programs 219, and/or an associated internal database 221. The various hardware memory units in memory 215 may include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules, or other data. Memory 215 may include one or more physical persistent memory devices and/or one or more non-persistent memory devices. Memory 215 may include, but is not limited to, random access memory (RAM) 205, read only memory (ROM) 207, electronically erasable programmable read only memory (EEPROM), flash memory or other memory technology, optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that may be used to store the desired information and that may be accessed by processor 203.
Communication interface 211 may include one or more transceivers, digital signal processors, and/or additional circuitry and software for communicating via any network, wired or wireless, using any protocol as described herein. It will be appreciated that the network connections shown are illustrative and any means of establishing a communications link between the computers may be used. The existence of any of various network protocols such as TCP/IP, Ethernet, FTP, HTTP and the like, and of various wireless communication technologies such as GSM, CDMA, WiFi, and LTE, is presumed, and the various computing devices described herein may be configured to communicate using any of these network protocols or technologies.
Processor 203 may include a single central processing unit (CPU), which may be a single-core or multi-core processor, or may include multiple CPUs. Processor(s) 203 and associated components may allow the computing device 200 to execute a series of computer-readable instructions to perform some or all of the processes described herein. Although not shown in FIG. 2, various elements within memory 215 or other components in computing device 200, may include one or more caches including, but not limited to, CPU caches used by the processor 203, page caches used by the operating system 217, disk caches of a hard drive, and/or database caches used to cache content from database 221. For embodiments including a CPU cache, the CPU cache may be used by one or more processors 203 to reduce memory latency and access time. A processor 203 may retrieve data from or write data to the CPU cache rather than reading/writing to memory 215, which may improve the speed of these operations. In some examples, a database cache may be created in which certain data from a database 221 is cached in a separate smaller database in a memory separate from the database, such as in RAM 205 or on a separate computing device. For instance, in a multi-tiered application, a database cache on an application server may reduce data retrieval and data manipulation time by not needing to communicate over a network with a back-end database server. These types of caches and others may be included in various embodiments, and may provide potential advantages in certain implementations of devices, systems, and methods described herein, such as faster response times and less dependence on network conditions when transmitting and receiving data.
Although various components of computing device 200 are described separately, functionality of the various components may be combined and/or performed by a single component and/or multiple computing devices in communication without departing from the invention.
Any data described and/or transmitted herein may include secure and sensitive data, such as confidential documents, customer personally identifiable information, and account data. Therefore, it may be desirable to protect transmissions of such data using secure network protocols and encryption, and/or to protect the integrity of the data when stored on the various computing devices. For example, a file-based integration scheme or a service-based integration scheme may be utilized for transmitting data between the various computing devices. Data may be transmitted using various network communication protocols. Secure data transmission protocols and/or encryption may be used in file transfers to protect the integrity of the data, for example, File Transfer Protocol (FTP), Secure File Transfer Protocol (SFTP), and/or Pretty Good Privacy (PGP) encryption. In many embodiments, one or more web services may be implemented within the various computing devices. Web services may be accessed by authorized external devices and users to support input, extraction, and manipulation of data between the various computing devices in the system 200. Web services built to support a personalized display system may be cross-domain and/or cross-platform, and may be built for enterprise use. Data may be transmitted using the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocol to provide secure connections between the computing devices. Web services may be implemented using the WS-Security standard, providing for secure SOAP messages using XML encryption. Specialized hardware may be used to provide secure web services. For example, secure network appliances may include built-in features such as hardware-accelerated SSL and HTTPS, WS-Security, and/or firewalls. Such specialized hardware may be installed and configured in the system 200 in front of one or more computing devices such that any external devices may communicate directly with the specialized hardware.
Machine Classifiers and Processes
Machine classifiers in accordance with aspects of the invention employ adversarial bootstrapping to improve dialogue generation, particularly in multi-turn dialogue tasks. In several embodiments, the machine classifier includes a generator and a discriminator. The discriminator may be trained using a variety of data, including negative samples based on the generator's deterministic teacher forcing output and unrelated dialogue samples from the training set. This makes the discriminator's task more challenging and improve the quality of the feedback to the generator by discouraging the generation of high frequency generic responses. In several embodiments, the training samples used are taken from the top k (where k is an arbitrary number) generator outputs and/or the maximum a posterior probability output with Gaussian noise as additional inputs. This allows the machine classifier to be trained based on plausible trajectories during training, particularly as compared to existing machine classifiers where the discriminator mostly score the generated samples very low. The top k sampling strategy also mitigates the gradient variance problem found in typical machine classifiers. Machine classifiers in accordance with aspects of the disclosure may be trained using both a maximum likelihood objective from the generator along with a metric learning objective from the discriminator.
The machine classifier may be trained to generate candidate responses based on a variety of criteria such as, but not limited to, a context, conversation history, and the like. In a variety of embodiments, a context xi may be represented as

xi=(x1,x2, . . . ,xi)

up to turn i, with xi+1 being the target response for xi. Based on target input samples (xi, xi+1), a generative model pθG(yi|x) may be used to score representative hypothesis yi given arbitrary dialogue contexts xi such that responses that are indistinguishable from informative and diverse target responses are favored with high scores and otherwise given low scores, where θG is the parameters for the generator G. The collection of possible responses at turn i may be expressed as

yi=(yi1,yi2, . . . ,yiTi)

With Ti being the length of the i-th candidate response yi and yit is the t-th word of that response.

The machine classifier may adversarially train the generator and/or discriminator to generate output data for a variety of tasks, such as multi-turn dialogue models. In several embodiments, the machine classifier may be trained based on the objective



 
  
   
        AB
   
   
    (
    
     θ
     G
    
    )
   
  
  =
  
   -
   
    
     ∑
     
      
       y
       i
      
      ∈
      
       y
       i
      
     
    
    
     
      
       t
       G
      
      (
      
       y
       i
      
      )
     
     ⁢
        
     log
     ⁢
        
     
      
       p
       
        θ
        G
       
      
      (
      
       
        y
        i
       
       ❘
       
        x
        i
       
      
      )
     
    
   
  
 



where AB is the adversarial bootstrapping objective, and tG is the target variable that controls the generator training. In a variety of embodiments, particularly those using hard bootstrapping, tG may be defined, for hyperparameter β, with the piecewise equation:





  
    
      
        t
        G
      
      ⁡
      
        (
        
          y
          i
        
        )
      
    
    =
    
      β
      
        [
        
          
            y
            i
          
          =
          
            x
            
              i
              +
              1
            
          
        
        ]
      
    
  
  ,
  
    
      
        t
        G
      
      ⁡
      
        (
        
          y
          i
        
        )
      
    
    =
    
      1
      -
      
        β
        
          [
          
            
              y
              i
            
            =
            
              
                argmax
                
                  y
                  i
                
              
              ⁢
              
                
                  p
                  
                    θ
                    G
                  
                
                ⁡
                
                  (
                  
                    
                      y
                      i
                    
                    |
                    
                      x
                      i
                    
                  
                  )
                
              
            
          
          ]
        
      
    
  




and 0 otherwise. In several embodiments, particularly those using a maximum likelihood estimation, tG may be defined using the piecewise equation:

tG(yi)=1[yi=xi+1]

and 0 otherwise. In many embodiments, the generator target is defined using the piecewise equation:




 
  
   
    t
    G
   
   (
   
    y
    i
   
   )
  
  =
  
   {
   
    
     
      
       β
                              
      
     
     
      
       
        
         y
         i
        
        =
        
         x
         
          i
          +
          1
         
        
       
                                        
      
     
    
    
     
      
       0
                               
      
     
     
      
       
        y
        i
       
       =
       
        
         argmax
         
          y
          i
         
        
        ⁢
           
        
         
          p
          
           θ
           G
          
         
         (
         
          
           y
           i
          
          ❘
          
           x
           i
          
         
         )
        
       
      
     
    
    
     
      
       α
       ⁢
       
        
         Q
         
          θ
          D
         
        
        (
        
         
          y
          i
         
         ,
         
          x
          i
         
        
        )
       
      
     
     
      
       otherwise
                                      
      
     
    
   
  
 



for hyperparameter α and

QθD(yi,xi)∈[0,1]

being the bootstrapped target obtained from a discriminator D with parameters θD. The generator output and/or ground truth training labels may be used in training the discriminator in addition to any human-generated negative samples xi+1 in the input data. The inclusion of human-generated negative samples encourages the discriminator to assign low scores to high frequency, generic target responses in the dataset, thereby discouraging the generator from producing them.

The objective function may include the term



 
  
   
    t
    D
   
   (
   
    y
    i
   
   )
  
  =
  
   {
   
    
     
      β
     
     
      
       
        
         y
         i
        
        =
        
         x
         
          i
          +
          1
         
        
       
                                        
      
     
    
    
     
      0
     
     
      
       
        y
        i
       
       =
       
        
         argmax
         
          y
          i
         
        
        ⁢
           
        
         
          p
          
           θ
           G
          
         
         (
         
          
           y
           i
          
          ❘
          
           x
           i
          
         
         )
        
       
      
     
    
    
     
      0
     
     
      
       
        
         y
         i
        
        =
        
         
          x
          _
         
         
          i
          +
          1
         
        
       
                                       
      
     
    
   
  
 



and the discriminator objective may include the cross-entropy between the output and the target of the discriminator given by




 
  
   
        AB
   
   
    (
    
     θ
     D
    
    )
   
  
  =
  
   -
   
    
     ∑
     
      
       y
       i
      
      ∈
      
       y
       i
      
     
    
    
     [
     
      
       
        
         t
         D
        
        (
        
         y
         i
        
        )
       
       ⁢
          
       log
       ⁢
          
       
        
         Q
         
          θ
          D
         
        
        (
        
         
          y
          i
         
         ,
         
          x
          i
         
        
        )
       
      
      +
      
       
        (
        
         1
         -
         
          
           t
           D
          
          (
          
           y
           i
          
          )
         
        
        )
       
       ⁢
          
       log
       ⁢
          
       
        (
        
         1
         -
         
          
           Q
           
            θ
            D
           
          
          (
          
           
            y
            i
           
           ,
           
            x
            i
           
          
          )
         
        
        )
       
      
     
     ]
    
   
  
 



To backpropagate the learning signal for the case where

t(yi)=αQθD(yi,xi)

both stochastic and/or deterministic gradient methods may be used, where α is a hyperparameter. For stochastic gradient methods, the gradient of

AB(θG)w.r.t.θG 

may be approximated based on Monte Carlo samples such as, for Euclidian space ,

∇θGAB(θG)≈pθG(yi|xi)QθD(yi,xi)·∇θG log pθG(yi|xi)

For deterministic gradient methods, the gradient may be approximated by




 
  
   
    
     
      ∇
      
       θ
       G
      
     
     
            AB
     
    
    ⁢
    
     (
     
      θ
      G
     
     )
    
   
   ≈
   
    
     E
     
      p
      ⁡
      (
      
       z
       i
      
      )
     
    
    ⁢
    
     
      
       ∇
       
        y
        max
       
      
      
       
        Q
        
         θ
         D
        
       
       (
       
        
         y
         max
        
        ,
        
         x
         i
        
       
       )
      
     
     ·
     
      
       ∇
       
        θ
        G
       
      
         
      log
     
    
    ⁢
       
    
     
      p
      
       θ
       G
      
     
     (
     
      
       
        y
        max
       
       ❘
       
        x
        i
       
      
      ,
      
       z
       i
      
     
     )
    
   
  
  ⁢
  

  
                  
   where
  
  ⁢
  

  
                  
   
    
     y
     max
    
    =
    
     
      argmax
      
       y
       i
      
     
     ⁢
        
     
      
       p
       
        θ
        G
       
      
      (
      
       
        
         y
         i
        
        ❘
        
         x
         i
        
       
       ,
       
        z
        i
       
      
      )
     
    
   
  
  ⁢
  

  
                  
   and
  
  ⁢
  

  
                  
   
    
     z
     i
    
    ∼
    
          
      (
      
       0
       ,
       I
      
      )
     
    
   
  
 



is a source of randomness.

In a number of embodiments, the top k generator outputs may be sampled for training and/or autoregression purposes. The top k outputs may be sampled based on a categorical distribution based on the output logits and/or a uniform distribution of generator outputs.
FIGS. 3A-B show an example of a machine classifier in accordance with one or more aspects described herein. The machine classifier 300 may include a generator and a discriminator. As shown in FIG. 3A, the generator may include a generator encoder 310, a generator decoder 312, and a generator cost function 314.
The generator encoder 310 may encode input data, such as a context, conversation history, or the like. In a variety of embodiments, the generator and discriminator both use the generator encoder 310. In several embodiments, the generator and discriminator use separate encoders. The generator encoder 310 may utilize any of a variety of machine learning models, including (but not limited to) decision trees, k-nearest neighbors, support vector machines (SVM), neural networks (NN), recurrent neural networks (RNN), convolutional neural networks (CNN), and/or probabilistic neural networks (PNN). RNNs may further include (but are not limited to) fully recurrent networks, Hopfield networks, Boltzmann machines, self-organizing maps, learning vector quantization, simple recurrent networks, echo state networks, long short-term memory networks, bi-directional RNNs, hierarchical RNNs, stochastic neural networks, and/or genetic scale RNNs. In a number of embodiments, a combination of machine learning models may be utilized, more specific machine learning models when available, and general machine learning models at other times.
The generator encoder 310 may encode input data having one or more tasks. In a number of embodiments, the tasks include multi-turn dialogue samples. A dialogue sample may include a single statement (e.g. context) and a response to that statement such that a multi-turn dialogue includes two or more turns. In many embodiments, during turn i, the generator encoder 310 may map a conversation context

xi=(xi1,xi2, . . . ,xiJi)

having sequence length Ji into a sequence of hidden state vectors

{eij}j=1Ji 

according to

eij=eRNN(E(xij),eij−1),j=1, . . . ,Ji 

where E( ) is an embedding lookup and

E∈hdim×V 

is an embedding matrix with dimension hdim and vocabulary size V.

The vector representation of xi may be the L2 pooling over the encoded sequence

{eij}j=1Ji 

The L2 pooling may include a square root of sums of activations within the generator encoder 310. However, any of a variety of poolings, such as max-pooling, may also be used as appropriate.

The output sequence of the generator encoder 310 may also be used as an attention memory for the generator decoder 312, thereby improving the relevance of the response generated by the generator.
The generator encoder 310 may use a unidirectional context RNN, cRNN( ), to capture xi by combining a past dialogue context hi−1 with the pooling of the encoded sequence as

hi=cRNN(L2{eij}j=1Ji),hi−1)

In many embodiments, the use of a single vector representation helps to simplify both training and inference procedures. However, a variety of representations, such as turn-level sequential memories and/or random access memories, may also be used as appropriate.
The generator decoder (gRNNN) 312 may include a unidirectional decoder RNN with (or without) an attention memory. However, the generator decoder 312 may include one or more machine learning models as described herein. The generator decoder 312 may be initialized with the last state of the generator encoder 310. The generator decoder 312 may output a hidden state representation gij for each previous token xj−1 according to

gij=gRNN(E(xj−1),gij−1,αij,hi)

where αij is the attention over the encoded sequence

{eij}j=1Ji 

In several embodiments, the training of the generator is run in teacher forcing mode, where the ground truth output (e.g. x=xi+1) for the training example currently being used to train the generator discriminator 312 is used rather than the output actually generated by the generator discriminator 312 in the backpropagation portion of the training. This may be contrasted with the inference mode of the generator, where the output of the generator discriminator 312 (e.g. x=yi) is used. However, it should be noted that the use of teacher forcing is optional during the training phase of the generator and/or machine classifier 300.
A hidden state of the generator decoder 312 gij may be mapped to a probability distribution through a logistic layer σ( ), yielding

pθG(yij|χ1:j−1,xi)=softmax(σ(gij)/τ)

where τ is a hyperparameter, σ(gij)=E·gij+bg, and bg∈1×V is the logit bias. In a variety of embodiments, the output projection matrix is the same as the embedding matrix.

The generative model pθG may be derived as



 
  
   
    p
    
     θ
     G
    
   
   (
   
    
     y
     i
    
    ❘
    
     x
     i
    
   
   )
  
  =
  
   
    
     p
     θ
    
    (
    
     
      y
      i
      1
     
     ❘
     
      x
      i
     
    
    )
   
   ⁢
   
    
     ∏
     
      j
      =
      2
     
     
      T
      i
     
    
     
    
     
      p
      
       θ
       G
      
     
     (
     
      
       
        y
        i
        j
       
       ❘
       
        χ
        
         
          1
          :
          j
         
         -
         1
        
       
      
      ,
      
       x
       i
      
     
     )
    
   
  
 



The generator cost function 314 may be used to determine the generator output based on the generative model generated by the generator decoder 312. In many embodiments, the generator cost function 314 includes a maximum likelihood estimator. In several embodiments, the generator cost function 314 is weighted based on the output from the discriminator cost function 326 and/or similarity function 324. In a number of embodiments, the generator cost function 314 ∇θG is defined as



 
  
   
    
     
      
       
        
         ∇
         
          θ
          G
         
        
        
         1
         m
        
       
       ⁢
       
        
         ∑
         
          i
          =
          1
         
         m
        
         
        
         [
         
          log
          (
          
           
            P
            
             θ
             
              G
              T
             
            
           
           (
           
            
             x
             r
             
              (
              i
              )
             
            
            ❘
            
             x
             c
             
              (
              i
              )
             
            
           
           )
          
          )
         
        
       
      
      )
     
     +
     
      
       
        D
        c
       
       (
       
        
         
          G
          A
         
         (
         
          
           x
           c
           
            (
            i
            )
           
          
          ,
          
           z
           
            (
            i
            )
           
          
         
         )
        
        ,
        
         x
         c
         
          (
          i
          )
         
        
       
       )
      
      ⁢
      
       log
       ⁡
       (
       
        
         
          P
          
           θ
           G
          
         
         (
         
          
           x
           c
           
            (
            i
            )
           
          
          ,
          
           z
           
            (
            i
            )
           
          
         
         )
        
        ,
        
         x
         c
         
          (
          i
          )
         
        
       
       )
      
     
    
    )
   
   )
  
  ]
 



with elements as defined herein with respect to FIGS. 3A-B.

As shown in FIG. 3B, the discriminator may include a discriminator encoder 320, a discriminator classifier 322, a similarity function 324, and a discriminator cost function 326. In a variety of embodiments, the discriminator

QθD(yi,xi)

includes a binary classifier that takes a response sequence yi and a dialogue context xi as input. In several embodiments, the discriminator is trained using the output labels provided by the generator. The discriminator may employ a variety of machine learning models described herein, such as a RNN. The discriminator may share the hierarchical encoder and the word embeddings with the generator, with the initial state of the discriminator being the final state of the generator encoder 310.

The discriminator encoder 320 encodes input data to be provided to the discriminator classifier 322 and/or similarity function 324. In several embodiments, the discriminator encoder 320 corresponds to the generator encoder 310; that is, the discriminator encoder 320 and generator encoder 310 are the same. In many embodiments, the discriminator encoder 320 encodes some or all of the input data as described with respect to generator encoder 310.
The discriminator classifier 322 may estimate an action-value function Q, also known as a dialogue context-response function, for a particular input sequence. The Q value may be calculated at an utterance level and/or at a word level. The Q value may be calculated using the last output of the discriminator classifier 322. In several embodiments, the Q value at the utterance level may be calculated as:

QθD(yi,xi)=sigmoid(σ(diTi))

where

σ(diTi)=Wd·hgij+bd,

Wd∈hdim×V 

is the logit projection, and

bg∈1×V 

is the bias.

At the word level, the discriminator classifier 322 produces a word-level evaluation. The normalized Q value and the adversarial bootstrapping objective function may be defined as:



 
  
   
    d
    i
    j
   
   =
   
    
     
      Q
      
       θ
       D
      
     
     (
     
      
       y
       i
       j
      
      ,
      
       
        x
        i
       
       ❘
       
        y
        i
       
      
     
     )
    
    =
    
     sigmoid
     (
     
      σ
      ⁡
      (
      
       d
       i
       j
      
      )
     
     )
    
   
  
  ⁢
  

  and
  ⁢
  

  
   
    
          AB
    
    
     (
     
      θ
      G
     
     )
    
   
   =
   
    -
    
     
      ∑
      
       
        y
        i
       
       ∈
       
        y
        i
       
      
     
     
      
       ∑
       
        j
        =
        1
       
       
        T
        i
       
      
       
      
       
        
         t
         G
        
        (
        
         y
         i
         j
        
        )
       
       ⁢
       log
       ⁢
          
       
        
         P
         
          θ
          G
         
        
        (
        
         
          y
          i
          j
         
         ❘
         
          x
          i
         
        
        )
       
      
     
    
   
  
  ⁢
  

  where
  ⁢
  

  
   
    
     t
     G
    
    (
    
     y
     i
     j
    
    )
   
   =
   
    {
    
     
      
       
        β
                        
       
      
      
       
        
         
          y
          i
          j
         
         =
         
          x
          
           i
           +
           1
          
          j
         
        
                                                          
       
      
     
     
      
       
        0
                         
       
      
      
       
        
         y
         i
         j
        
        =
        
         
          argmax
          
           y
           i
           j
          
         
         ⁢
            
         
          
           p
           
            θ
            G
           
          
          (
          
           
            
             y
             i
             j
            
            ❘
            
             χ
             
              
               1
               :
               j
              
              -
              1
             
            
           
           ,
           
            x
            i
           
          
          )
         
        
       
      
     
     
      
       
        
         (
         
          1
          -
          β
         
         )
        
        ⁢
        
         d
         i
         j
        
       
      
      
       
        otherwise
                                                         
       
      
     
    
   
  
 



The output of the discriminator classifier 322 may be provided to a logistic layer and sigmoid function, such as similarity function 324 and/or discriminator cost function 326 to produce a normalized Q (action-value function) value of the pair of dialogue context (state) and response (action). This differs from existing machine classifiers that may only determine if a context-response pair is human-generated or machine-generated. In several embodiments, the discriminator cost function 326 includes a metric learner. Accordingly, the training of the machine classifier may be viewed as joint metric and maximum likelihood learning.
The similarity function 324 may determine how similar the generator output is to the discriminator output. Similarity learning is closely related to distance metric learning. Metric learning is the task of learning a distance function over objects. A metric or distance function has to obey four axioms: non-negativity, identity of indiscernibles, symmetry and subadditivity (or the triangle inequality). In practice, metric learning algorithms ignore the condition of identity of indiscernibles and learn a pseudo-metric. Any of a variety of similarity functions including, but not limited to, regression similarity functions, classification similarity functions, ranking similarity functions, and hashing similarity functions, may be used as appropriate.
The discriminator cost function 326 may be used to determine the discriminator output based on the model generated by the discriminator classifier 322. In many embodiments, the discriminator cost function 326 includes a metric learner. In several embodiments, the discriminator cost function 326 is weighted based on the output from the generator cost function 326 and/or similarity function 324. In a number of embodiments, the discriminator cost function 326 ∇θD is defined as



 
  
   
    
     
      
       
        ∇
        
         θ
         D
        
       
       
        1
        m
       
      
      ⁢
      
       
        ∑
        
         i
         =
         1
        
        m
       
        
       
        [
        
         
          log
          ⁢
          
           
            D
            c
           
           (
           
            
             x
             r
             
              (
              i
              )
             
            
            ,
            
             x
             c
             
              (
              i
              )
             
            
           
           )
          
         
         +
         
          
           
           
          
          ⁢
          
           log
           ⁡
           (
           
            1
            -
            
             
              D
              c
             
             (
             
              
               
                G
                T
               
               (
               
                x
                c
                
                 (
                 i
                 )
                
               
               )
              
              ,
              
               x
               c
               
                (
                i
                )
               
              
             
             )
            
           
           )
          
         
         +
        
       
      
     
     
    
    ⁢
    
     
     
    
    ⁢
    
     log
     ⁡
     (
     
      1
      -
      
       
        D
        c
       
       (
       
        
         x
         w
         
          (
          i
          )
         
        
        ,
        
         x
         c
         
          (
          i
          )
         
        
       
       )
      
     
     )
    
   
   +
   
    
     S
     ⁡
     (
     
      
       
        D
        e
       
       (
       
        
         x
         r
         
          (
          i
          )
         
        
        ,
        
         x
         c
         
          (
          i
          )
         
        
       
       )
      
      ,
      
       
        D
        e
       
       (
       
        
         
          G
          A
         
         (
         
          
           x
           c
           
            (
            i
            )
           
          
          ,
          
           z
           
            (
            i
            )
           
          
         
         )
        
        ,
        
         x
         c
         
          (
          i
          )
         
        
       
       )
      
     
     )
    
    ⁢
    log
    ⁢
    
     
      D
      c
     
     (
     
      
       
        G
        A
       
       (
       
        
         x
         c
         
          (
          i
          )
         
        
        ,
        
         z
         
          (
          i
          )
         
        
       
       )
      
      ,
      
       x
       c
       
        (
        i
        )
       
      
     
     )
    
   
   +
   
    
     (
     
      1
      -
      
       S
       ⁡
       (
       
        
         
          D
          e
         
         (
         
          
           x
           r
           
            (
            i
            )
           
          
          ,
          
           x
           c
           
            (
            i
            )
           
          
         
         )
        
        ,
        
         
          D
          e
         
         (
         
          
           
            G
            A
           
           (
           
            
             x
             c
             
              (
              i
              )
             
            
            ,
            
             z
             
              (
              i
              )
             
            
           
           )
          
          ,
          
           x
           c
           
            (
            i
            )
           
          
         
         )
        
       
       )
      
     
     )
    
    ⁢
    
     log
     ⁡
     (
     
      1
      -
      
       
        D
        c
       
       (
       
        
         
          G
          A
         
         (
         
          
           x
           c
           
            (
            i
            )
           
          
          ,
          
           z
           
            (
            i
            )
           
          
         
         )
        
        ,
        
         x
         c
         
          (
          i
          )
         
        
       
       )
      
     
     )
    
   
  
  ]
 



FIG. 4 shows a flow chart of a process for training a machine classifier according to one or more aspects of the disclosure. Some or all of the steps of process 400 may be performed using one or more computing devices as described herein. In a variety of embodiments, some or all of the steps described below may be combined and/or divided into sub-steps as appropriate.
When training a machine classifier, the generator and discriminator may be trained simultaneously and/or separately. In many embodiments, the generator is trained with two samples and the discriminator is trained with three samples. In a variety of embodiments, teacher forcing outputs (e.g. ground truth labels) from the generator are used to train the discriminator. The encoder parameters may be included with the generator output. In several embodiments, the generator encoder is not updated during the training of the discriminator. The generator and discriminator may employ a variety of cells and/or hidden state sizes, such as 3-layer GRU cells and a hidden state size of 512. The word embedding size may be defined to be any value, and in a number of embodiments is set to the hidden state size. The vocabulary size may be set to any appropriate value for a target language and/or task, such as 50,000. Other hyperparameters may include β=1, α=1, topk=10, and/or τ=1. For training, the initial learning rate may be 0.5 with decay rate factor of 0:99, applied when the generator loss has increased over two iterations. A batch size of 64 may be used and clip gradients may be approximately 5.0. However, it should be noted that any parameter may be set to any value as appropriate. Parameters may be initialized with Xavier uniform random initialization. A variety of softmax functions, such as full softmax and sampled softmax, may be used based on processing and/or memory concerns for a particular computing device. In particular, it should be noted that different softmax functions may be used in training and inference. The machine classifier may be trained end-to-end using a stochastic gradient descent algorithm.
At step 410, input data may be obtained. The input data may include one or more training examples for one or more tasks. In several embodiments, the input data includes one or more turns of a multi-turn dialog example. Each turn may include a context and a response. Each turn may be independent and/or dependent on one or more previous turns within the multi-turn dialog example.
At step 412, encoded input data can be generated. In many embodiments, the encoded input data includes one or more word embeddings generated based on the input data. The word embeddings may be generated for each training example in the input data. In several embodiments, the word embeddings are generated using a variety of techniques, such as those described with respect to FIGS. 3A-B.
At step 414, a generator response may be generated. The generator response may be generated during the training of the generator. Training the generator may include determining an output based on the word embeddings as described with respect to FIG. 3A. In several embodiments, the output of the generator is determined using a maximum likelihood estimation objective. In many embodiments, training the generator includes updating one or more weights of a cost function used to determine the generator output based one or more candidate outputs generated based on the word embeddings.
At step 416, an encoder may be updated. The encoder may be updated based on the output of the generator (e.g. the generator response). In a variety of embodiments, updating the encoder includes updating one or more weights of a cost function used to determine the word embeddings based on the input data. In several embodiments, the weights of the encoder are updated during an autoregression phase of the training of the generator.
At step 418, discriminator feedback may be generated. In several embodiments, the discriminator may be trained based on the discriminator feedback and/or generator response. Training the discriminator may include determining an output based on the word embeddings and the generator output as described with respect to FIG. 3B. In several embodiments, the output of the discriminator is determined using a metric learning objective. In many embodiments, training the discriminator includes updating one or more weights of a cost function used to determine the discriminator output based one or more candidate outputs generated based on the word embeddings and the generator output.
At step 420, model parameters may be calculated. In a variety of embodiments, the model parameters include output weights for determining an output based on the generator response and discriminator feedback for a particular input. The output weights may be used in a combined maximum likelihood estimation objective and metric learning objective to determine an output from the machine classifier for a particular word embedding. In several embodiments, the output weights are based on the metric learning objective and are used as an input to the maximum likelihood estimation objective. The output weights may be calculated based on an autoregressive function determined based on the training of the generator and/or discriminator.
FIG. 5 shows a flow chart of a process for classifying data according to one or more aspects of the disclosure. Some or all of the steps of process 500 may be performed using one or more computing devices as described herein. In a variety of embodiments, some or all of the steps described below may be combined and/or divided into sub-steps as appropriate.
At step 510, input data may be obtained. The input data may include one or more training examples for one or more tasks. In several embodiments, the input data includes one or more turns of a multi-turn dialog example. Each turn may include a context and a response. Each turn may be independent and/or dependent on one or more previous turns within the multi-turn dialog example.
At step 512, an input sequence may be generated. The input sequence may include one or more word embeddings are described herein. In a variety of embodiments, the input sequence includes one or more turns of a multi-turn dialogue.
At step 514, a generator output may be generated. The generator output may include a response to a context as described herein. In a variety of embodiments, the context is a context in a multi-turn dialog and the response is to the context. The generator output may be generated as described herein, particularly with respect to FIG. 3A.
At step 516, a discriminator output may be generated. The discriminator output may indicate if the generator output is generated from a human, a machine, and/or normalized Q (action-value function) value as described herein. The discriminator output may be generated as described herein, particularly with respect to FIG. 3B.
At step 518, a current response may be calculated. The current response may be determined based on the generator output and/or the discriminator output. In a variety of embodiments, the current response is based on a joint maximum likelihood estimation objective and metric learning objective as described herein.
At step 520, an output sequence may be updated. The output sequence may be updated by appending the current response to the output sequence. In a variety of embodiments, the output sequence may be updated by adding the context corresponding to the corresponding response to the output sequence. In many embodiments, the output sequence includes a multi-turn dialog with contexts provided in the obtained input data and responses generated by the machine classifier.
At step 522, remaining task steps may be determined. If additional steps remain in the task, process 500 may return to step 514 and the next step in the task may be processed by the machine classifier. If no additional steps remain, the generated output sequence may be returned and process 500 ends. For example, in a multi-turn dialogue, the output sequence may include one or more responses to a question provided by a human user.
One or more aspects discussed herein may be embodied in computer-usable or readable data and/or computer-executable instructions, such as in one or more program modules, executed by one or more computers or other devices as described herein. Generally, program modules include routines, programs, objects, components, data structures, and the like. that perform particular tasks or implement particular abstract data types when executed by a processor in a computer or other device. The modules may be written in a source code programming language that is subsequently compiled for execution, or may be written in a scripting language such as (but not limited to) HTML or XML. The computer executable instructions may be stored on a computer readable medium such as a hard disk, optical disk, removable storage media, solid-state memory, RAM, and the like. As will be appreciated by one of skill in the art, the functionality of the program modules may be combined or distributed as desired in various embodiments. In addition, the functionality may be embodied in whole or in part in firmware or hardware equivalents such as integrated circuits, field programmable gate arrays (FPGA), and the like. Particular data structures may be used to more effectively implement one or more aspects discussed herein, and such data structures are contemplated within the scope of computer executable instructions and computer-usable data described herein. Various aspects discussed herein may be embodied as a method, a computing device, a system, and/or a computer program product.
Although the present invention has been described in certain specific aspects, many additional modifications and variations would be apparent to those skilled in the art. In particular, any of the various processes described above may be performed in alternative sequences and/or in parallel (on different computing devices) in order to achieve similar results in a manner that is more appropriate to the requirements of a specific application. It is therefore to be understood that the present invention may be practiced otherwise than specifically described without departing from the scope and spirit of the present invention. Thus, embodiments of the present invention should be considered in all respects as illustrative and not restrictive. Accordingly, the scope of the invention should be determined not by the embodiments illustrated, but by the appended claims and their equivalents.

## Claims

1. A computing device, comprising:
one or more processors; and
memory storing instructions that, when executed by the one or more processors, cause the computing device to:
initialize a machine classifier having a deep neural network architecture and a plurality of machine classifier parameters for multi-turn dialogue generation, wherein the deep neural network architecture comprises an encoder, a generator, a discriminator, and an output layer;
train the machine classifier to generate candidate responses for multi-turn dialogues, based on a training set comprising a plurality of examples, to refine the plurality of machine classifier parameters, wherein the plurality of examples comprises a plurality of dialogue sequences, wherein each dialogue sequence comprises two or more turns, and each turn is independent or dependent on one or more previous turns, and wherein training the machine classifier using the plurality of examples comprises:
generating, by the encoder, an encoded input based on the plurality of examples;
generating, by the generator, a generator response based on the encoded input;
providing, as input data to the discriminator, a combination of ground truth labels, the generator response, and negative examples, wherein the negative examples comprise negative samples based on the generator's deterministic teacher forcing output and unrelated dialogue samples from the plurality of examples, wherein the unrelated dialogue samples comprise unrelated dialogue sequences having two or more turns, and each turn is independent from one or more previous turns;
generating, by the discriminator, discriminator feedback based on the input data to the discriminator; and
updating the plurality of machine classifier parameters based on minimizing an average gradient of a loss function calculated based on a first weight determined based on the discriminator feedback and a second weight determined based on the generated response; and

generate, by the output layer and using the trained machine learning classifier, one or more class labels based on an input data set comprising a multi-turn dialogue data set.

2. The computing device of claim 1, wherein the instructions, when executed by the one or more processors, further cause the computing device to generate the discriminator feedback based on a ground truth label associated with the encoded input and at least one previous response generated by the generator based on the encoded input.

3. The computing device of claim 1, wherein the instructions, when executed by the one or more processors, further cause the computing device to generate the generator response for the plurality of examples by:
using the discriminator feedback to weight a cross-entropy loss for each of a set of candidate responses generated by the generator, and
selecting, from the set of candidate responses, a candidate response with a lowest loss as the generator response.

4. The computing device of claim 1, wherein the encoded input comprises a single vector representation of an example.

5. The computing device of claim 1, wherein the discriminator comprises a metric encoder.

6. The computing device of claim 1, wherein the generator comprises a maximum likelihood estimator classifier.

7. The computing device of claim 1, wherein the deep neural network architecture comprises a feed-forward neural network.

8. The computing device of claim 1, wherein the deep neural network architecture comprises a convolutional neural network.

9. The computing device of claim 1, wherein the deep neural network architecture comprises a recurrent neural network.

10. The computing device of claim 1, wherein the input data set comprises the multi-turn dialogue data set.

11. A method, comprising:
initializing a machine classifier having a deep neural network architecture and a plurality of machine classifier parameters for multi-turn dialogue generation, wherein the deep neural network architecture comprises an encoder, a generator, a discriminator, and an output layer;
training the machine classifier to generate candidate responses for multi-turn dialogues, based on a training set comprising a plurality of examples, to refine the plurality of machine classifier parameters, wherein the plurality of examples comprises a plurality of dialogue sequences, wherein each dialogue sequence comprises two or more turns, and each turn is independent or dependent on one or more previous turns, and wherein training the machine classifier using the plurality of examples comprises:
generating, by the encoder, an encoded input based on the plurality of examples;
generating, by the generator, a generator response based on the encoded input;
providing, as input data to the discriminator, a combination of ground truth labels, the generator response, and negative examples, wherein the negative examples comprise negative samples based on the generator's deterministic teacher forcing output and unrelated dialogue samples from the plurality of examples, wherein the unrelated dialogue samples comprise unrelated dialogue sequences having two or more turns, and each turn is independent from one or more previous turns;
generating, by the discriminator, discriminator feedback based on the input data to the discriminator; and
updating the plurality of machine classifier parameters based on minimizing an average gradient of a loss function calculated based on a first weight determined based on the discriminator feedback and a second weight determined based on the generated response; and

generating, by the output layer and using the trained machine learning classifier, one or more class labels based on an input data set comprising a multi-turn dialogue data set.

12. The method of claim 11, further comprising generating the generator response by:
generating, by the generator, a plurality of candidate responses, each candidate response comprising a loss calculated based on the discriminator feedback; and
selecting the generator response from the plurality of candidate responses based on the loss for each candidate response.

13. The method of claim 11, further comprising generating the generator response based on a ground truth label associated with the encoded input and at least one previous response generated by the generator based on the encoded input.

14. The method of claim 11, wherein the discriminator comprises a metric encoder.

15. The method of claim 14, wherein the generator comprises a maximum likelihood estimator classifier.

16. The method of claim 11, wherein the deep neural network architecture comprises a recurrent neural network.

17. A non-transitory machine-readable medium storing instructions that, when executed by one or more processors, cause the one or more processors to perform steps comprising:
initializing a machine classifier having a deep neural network architecture and a plurality of machine classifier parameters for multi-turn dialogue generation, wherein the deep neural network architecture comprises an encoder, a generator, a discriminator, and an output layer;
training the machine classifier to generate candidate responses for multi-turn dialogues, based on a training set comprising a plurality of examples, to refine the plurality of machine classifier parameters, wherein the plurality of examples comprises a plurality of dialogue sequences, wherein each dialogue sequence comprises two or more turns, and each turn is independent or dependent on one or more previous turns, and wherein training the machine classifier using the plurality of examples comprises:
generating, by the encoder, an encoded input based on the plurality of examples;
generating, by the generator, a generator response based on the encoded input;
providing, as input data to the discriminator, a combination of ground truth labels, the generator response, and negative examples, wherein the negative examples comprise negative samples based on the generator's deterministic teacher forcing output and unrelated dialogue samples from the plurality of examples, wherein the unrelated dialogue samples comprise unrelated dialogue sequences having two or more turns, and each turn is independent from one or more previous turns;
generating, by the discriminator, discriminator feedback based on the input data to the discriminator; and
updating the plurality of machine classifier parameters based on minimizing an average gradient of a loss function calculated based on a first weight determined based on the discriminator feedback and a second weight determined based on the generated response; and
generating, by the output layer and using the trained machine learning classifier, one or more class labels based on an input data set comprising a multi-turn dialogue data set.

18. The non-transitory machine-readable medium of claim 17, wherein the deep neural network architecture comprises a recurrent neural network.

19. The non-transitory machine-readable medium of claim 17, wherein the discriminator comprises a metric encoder.

20. The non-transitory machine-readable medium of claim 17, wherein the generator comprises a maximum likelihood estimator classifier.