Title: TOWARDS INTERPRETABLE CHIT-CHAT: OPEN DO-MAIN DIALOGUE GENERATION WITH DIALOGUE ACTS

Abstract: Conventional methods model open domain dialogue generation as a black box through end-to-end learning from large scale conversation data. In this work, we make the first step to open the black box by introducing dialogue acts into open domain dialogue generation. The dialogue acts are generally designed and reveal how people engage in social chat. Inspired by analysis on real data, we propose jointly modeling dialogue act selection and response generation, and perform learning with human-human conversations tagged with a dialogue act classifier and a reinforcement approach to further optimizing the model for long-term conversation. With the dialogue acts, we not only achieve significant improvement over state-of-the-art methods on response quality for given contexts and long-term conversation in both machine-machine simulation and human-machine conversation, but also are capable of explaining why such achievements can be made.

1. INTRODUCTION:

Conversational agents are becoming ubiquitous recently. Through human-machine conversation, such agents either help users complete specific tasks (Young et al., 2013) or engage them in social chat (Vinyals & Le, 2015) . Depending on application scenarios, various conversational agents have been designed including chatbots, personal assistants, and automated customer service, etc.

Traditional research on conversational agents focuses on task-oriented dialogue systems (Young et al., 2013) where task specific dialogue acts are handcrafted in a form of slot-value pairs. On the one hand, through slot-filling, the dialogue acts make conversations in such systems interpretable and controllable; on the other hand, they also hinder scaling such systems to new domains. To escape from the limitation, recent interest of research moves to end-to-end dialogue learning without any assumptions on dialogue acts. Most of the effort is paid to non-task-oriented chit-chat (Vinyals & Le, 2015) , and there are also a few studies on task-oriented dialogues (Bordes & Weston, 2017; Eric & Manning, 2017) . Without dialogue acts, these work directly constructs a response by learning from large scale data with neural networks, and thus is easy to scale to new domains. On the other hand, due to the absence of dialogue acts, it is hard to interpret the emergence of a response to a dialogue context and predict where the conversation will flow to.

In this work, we aim to achieve interpretability and controllability in non-task-oriented dialogues. To this end, we introduce dialogue acts into open domain dialogue generation. Open domain dialogue generation has been widely applied to chatbots which aim at engaging users by keeping conversation going. Existing work concentrates on generating relevant and diverse responses for a static context. However, it is not clear if relevance and diversity are sufficient to engagement in dynamic interactions. Therefore, we investigate the following problems: (1) if we can properly design dialogue acts that can enable us to understand engagement in human-human open domain conversation; (2) how to learn a dialogue generation model with the dialogue acts; and (3) how the model performs in practice and if the performance can be explained by the dialogue acts.

To examine how people engage in social chat, we establish a general dialogue act taxonomy for open domain conversation by extending the existing work with high-level dialogue acts regarding to conversational context. The taxonomy, when applied to real data, gives rise to an interesting finding that in addition to replying with relevance and diversity , people are used to driving their social chat by constantly switching to new contexts and properly asking questions. Such behaviors are less explored before, and thus are difficult for the existing end-to-end learning methods to imitate. To mimic human behaviors, we propose jointly modeling dialogue act selection and response generation in open domain dialogue generation. The dialogue model is specified with neural networks. We propose learning from human-human interactions by fitting the model to large scale real world dialogues tagged with a dialogue act classifier and further optimizing the policy of act selection for long-term conversation through a reinforcement learning approach. Our model enjoys several advantages over the existing models: (1) the dialogue acts provide interpretation to response generation from a discourse perspective; (2) the dialogue acts enhance diversity of responses by expanding the search space from language to act × language; (3) the dialogue acts manage the flow of humanmachine conversations and thus enhance human engagement; and (4) the dialogue act selection is compatible with post-engineering work (e.g., combination with rules), and thus allows engineers to flexibly control their systems through picking responses from their desired dialogue acts. Evaluation results on large scale test data indicate that our model can significantly outperform state-of-the-art methods in terms of quality of generated responses regarding to given contexts and lead to longterm conversation in both machine-machine simulation and human-machine conversation in a way similar to how human behave in their interactions.

Our contributions in this work include: (1) design of dialogue acts that represent human behavior regarding to conversational context and insights from analysis of human-human interactions with the design; (2) joint modeling of dialogue act selection and response generation in open domain dialogue generation; (3) proposal of a supervised learning approach and a reinforcement learning approach for model optimization; (4) empirical verification of the effectiveness of the model through automatic metrics, human annotations, machine-machine simulation, and human-machine conversation. 

2. DIALOGUE ACTS FOR OPEN DOMAIN CONVERSATION:

We first define dialogue acts, and then describe the data for learning and the insights we obtain from the data. Finally, we elaborate how we build the classifier with neural networks.

2.1. DEFINITION OF DIALOGUE ACTS:

Our dialogue acts are inherited from the existing work on 1-on-1 live chats and twitter (Kim et al., 2010; Ivanovic, 2005) . Similar to (Oraby et al., 2017) , we organize the 12 acts in (Ivanovic, 2005) which originate from the 42 tags (Jurafsky et al., 1997; Stolcke et al., 2006) based on the DAMSL annotation scheme (Core & Allen, 1997) into high-level dialogue acts: "statement" and "expressive" are merged as "statement"; "yes-no question" and "open question" are combined as "question";

"yes-answer", "no-answer", and "response-ack" are collapsed as "answer"; and other tags are treated as "others". On top of these acts, we further define two high-level dialogue acts that describe how people behave regarding to conversational context in their interactions. As will be seen later, the extension may bring us further insights on engagement in social chat. Details of the dialogue acts are described in Table 1 .

The high-level dialogue acts in For dialogue act learning, we randomly sample 500 dialogues from the training set and recruit 3 native speakers to label dialogue acts3 for each utterance according to the definitions in Table 1 . Table 3 shows a labeling example from one annotator. Each utterance receives 3 labels, and the Fleiss' kappa of the labeling work is 0.45, indicating moderate agreement among the labelers. The frequencies of the dialogue acts in terms of percentages of the total number of utterances in the labeled data are CM.S 55.8%, CM.Q 11.7%, CM.A 12.2%, CS.S 12.4%, CS.Q 4.8%, CS.A 2%, and O 1.1%. In addition to the numbers, we also get further insights from the data that are instructive to our dialogue generation learning:

Context switch is a common skill to keep conversation going. In fact, we find that 78.2% dialogues contain at least one CS.* act. The average number of turns of dialogues that contain at least one CS.* is 8.4, while the average number of turns of dialogues that do not contain a CS.* is 7. When dialogues are shorter than 5 turns, only 47% of them contain a CS.*, but when dialogues exceed 10 turns, more than 85% of them contain a CS.*. Because there are no specific goals in their conversations, people seldom stay long in one context. The average number of turns before context switch is 3.39. We also observed consecutive context switch in many dialogues (43.7%). The numbers suggest dialogue generation with smooth context switch and moderate context maintenance.

Question is an important building block in open domain conversation. In fact, 13.9% CM.* are CM.Q and the percentage is even higher in CS.* which is 20.27%. People need to ask questions in order to maintain contexts. The average number of turns of contexts with questions (i.e., consecutive CM.* with at least one CM.Q) is 3.92, while the average number of turns of contexts without questions is only 2.95. The observation indicates that a good dialogue model should be capable of asking questions properly, as suggested by Li et al. (2017a) . A further step to study human's questioning behavior is to look into types and functions of questions. We leave it as future work.

The observations raise new challenges that are difficult for the existing end-to-end methods to tackle (e.g., smoothly interleaving context blocks with switch actions), and thus encourage us to create a new model. Note that these observations may relate to dialogue scenarios (e.g., chatting online instead of face-to-face) and cultures, but we ignore these factors and just study how to learn the conversational patterns from the data with a principled approach. The learning approach is generally applicable to other data. To perform learning, we need to build a classifier that can automatically tag large scale dialogues with dialogue acts.

2.4. DIALOGUE ACT CLASSIFICATION:

We aim to learn a classifier c from D A = {d i } N i=1 where d i = {(u i,1 , a i,1 ), . . . , (u i,ni , a i,ni )} represents a dialogue with u i,k the k-th utterance and a i,k the labeled dialogue act. Given a new dialogue d = {u 1 , . . . , u n }, c can sequentially tag the utterances in d with dialouge acts by taking u i , u i-1 , and the predicted a i-1 as inputs and outputting a vector c(u i , u i-1 , a i-1 ) where the j-th element representing the probability of u i being tagged as the j-th dialogue act.

We parameterize c(•, •, •) using neural networks. Specifically, u i and u i-1 are first processed by bidirectional recurrent neural networks with gated recurrent units (biGRUs) (Chung et al., 2014) respectively. Then the last hidden states of the two biGRUs are concatenated with an embedding of a i-1 and fed to a multi-layer perceptron (MLP) to calculate a dialogue act distribution. Formally, suppose that u i = (w i,1 , . . . , w i,n ) where w i,j is the embedding of the j-th word, then the j-th hidden state of the biGRU is given by h

EQUATION

Similarly, we have h i-1,j as the j-th hidden state of u i-1 . Let e(a i-1 ) be the embedding of a i-1 , then c(u i , u i-1 , a i-1 ) is defined by a two-layer MLP:

EQUATION

where we pad zeros for u 0 and a 0 in c(u 1 , u 0 , a 0 ). We learn c(•, •, •) by minimizing cross entropy with D A . Let p j (a i ) be the probability of a i being the j-th dialogue act and c(u i , u i-1 , a i-1 )[j] be the j-th element of c(u i , u i-1 , a i-1 ), then the objective function of learning is formulated as 1  𝑤1, 2 𝑤1, 3 𝑤1, 4   𝑤2, 1   𝑤2, 2   𝑤2, 3   𝑤3, 1  𝑤3, 2 𝑤3, 3 𝑤3, 4   𝑤4, 1  𝑤4, 2 𝑤4, 3 𝑤4 2 .

EQUATION

) Encoder 1 v 2 v 3 v 4 v 5 v Decoder Attention 2 ' v 3 ' v 4 ' v 6 v 1 ' v 5 ' v ... Softmax i a 1,1 i w  1,2 i w  1,3 i w  1,4 i w  1,5 i w  ,1 i w ,2 i w ,3 i w ,4 i w ,5 i w (a) generation network 𝑤1,

3. DIALOGUE GENERATION MODEL:

We present dialogue generation learning using large scale dialogues tagged with dialogue acts. Then, we describe model optimization with reinforcement learning for long-term conversation.

3.1. SUPERVISED LEARNING:

We aim to learn a dialogue generation model g from D = {d i } N i=1 where d i = {(u i,1 , a i,1 ), . . . , (u i,ni , a i,ni )} refers to a human-human dialogue with u i,k the k-th utterance and a i,k the dialogue act tagged by the classifier in Section 2.4. Given s i = {(u 1 , a 1 ), . . . , (u i-1 , a i-1 )} as a new dialogue session, g(s i ) can generate a response as the next turn of the dialogue.

Our dialogue model consists of a policy network and a generation network. A dialogue act is first selected from the policy network according to the conversation history, and then a response is generated from the generation network based on the conversation history and the dialogue act. Formally, the dialogue model can be formulated as

EQUATION

where a i = O(p a (a i |s i )) is the selected dialogue act for the i-th turn, and r i is the response of the i-th turn. p a is the policy network and p r is the generation network. O(•) refers to a dialogue act select operation according to the value of the policy network. A simple defintion of O(p a (a

EQUATION

)

where A is the space of dialogue acts. One can also customize O(•) with more complicated rules to achieve controllability or further optimization (e.g., improving response diveristy by selecting multiple acts) of their systems.

Figure 1 (b) shows the architecture of the policy network. The utterance sequence and the act sequence are encoded with a hierarchical encoder and a GRU encoder respectively. Then, the last hidden states of the two encoders are concatenated and fed to an MLP to calculate a probability distribution of dialogue acts for the next turn. Formally, ∀u j ∈ s i , u j is first transformed to hidden vectors {h u j,k } n j k=1 through a biGRU parameterized as Equation (1). Then, {h u j,n j } i-1 j=1 is processed by a GRU parameterized as

EQUATION

We build the generation network in a sequence-to-sequence framework. Here, we simplify p r (r i |s i , a i ) as p r (r i |a i , u i-1 , u i-2 ) since decoding natural language responses from long conversation history is challenging. Figure 1 (a) illustrates the architecture of the generation network. The only difference from the standard encoder-decoder architecture with an attention mechanism is that in encoding, we concatenate u i-1 and u i-2 , and attach a i to the top of the long sentence as a special word. The technique here is similar to that in zero-shot machine translation (Johnson et al., 2016) . More formulation details can be found in Appendix 7.1.

The dialogue model is then learned by minimizing the negative log likelihood of D:

EQUATION

where d i,<k = {(u i,1 , a i,1 ), . . . , (u i,k-1 , a i,k-1 )}. Through supervised learning, we fit the dialogue model to human-human interactions in order to learn their conversational patterns. However, supervised learning does not explicitly encourage long-term conversation (e.g., 45.35% dialogues in our training set are no more than 5 turns). The policy network is learned by fitting to the existing conversation history, and it is not aware what is going to happen in the future when a dialogue act is selected. This motivates us to further optimize the model through a reinforcement learning approach.

3.2. REINFORCEMENT LEARNING:

We aim to optimize the dialogue model by letting it know a possible result in the following conversation when an act and a response are generated. To avoid exhausting and expensive online optimization, we choose self-play (Li et al., 2016b; Lewis et al., 2017) where we let two models learned with the supervised approach talk to each other in order to improve their performance. In the simulation, a dialogue is initialized with a message sampled from the training set. Then, the two models continue the dialogue by alternately taking the conversation history as an input and generating a response (top one in beam search) until T turns (T = 20 in our experiments).

To speed up training and avoid generated responses diverging from human language, we fix the generation network and only optimize the policy network by reinforcement learning. Thus, the policy in learning is naturally defined by the policy network p a (a i |s i ) with s i = {(u 1 , a 1 ), . . . , (u i-1 , a i-1 )} a state and a i an action. We define a reward function r(a i , s i ) as

EQUATION

where E[len(a i , s i )] is the expected conversation length after taking action a i under state s i , E[rel(a i , s i )] is the expected response relevance within the conversation, α = 0.67, and β = 0.33.

Through Equation (8), we try to encourage actions that can lead to long (measured by E[len(a i , s i )]) and reasonable (measured by E[rel(a i , s i )]) conversations.

To estimate E[len(a i , s i )] and E[rel(a i , s i )], we fix (s i , a i ) and construct a dialogue set {d i,j } N j=1 (N = 10 in our experiments) by sampling after (s i , a i ) with self-play. ∀j, d i,j = (s i , u j,i+1 , . . . , u j,ni,j ) where ∀k, u j,i+k is randomly sampled from the top 5 beam search results of p r conditioned on the most probable dialogue act given by p a for that turn. Inspired by (Li et al., 2016b) , we terminate a simulated dialogue if (1) cosine(e(u i-1 ), e(u i )) > 0.9 && cosine(e(u i )), e(u i+1 )) > 0.9, or (2) cosine(e(u i-1 ), e(u i+1 )) > 0.9, or (3) the length of the dialogue reaches T , where e(•) denotes the representation of an utterance given by the encoder of p r . Condition (1) means three consecutive turns are (semantically) repetitive, and Condition (2) means one agent gives repetitive responses in two consecutive turns. Both conditions indicate a high probability that the conversation falls into a bad infinite loop. E[len(a i , s i )] and E[rel(a i , s i )] are then estimated by

EQUATION

where d i,j<k = (u 1 , . . . , u j,k-1 ), and m(•, •) is the dual LSTM model proposed in (Lowe et al., 2015) which measures the relevance between a response and a context. We train m(•, •) with the 30 million crawled data through negative sampling. The objective of learning is to maximize the expected future reward:

EQUATION

)

The gradient of the objective is calculated by Reinforce algorithm (Williams, 1992):

EQUATION

where the baseline b t is empirically set as 1 |A| at∈A r(a t , s t ). (Li et al., 2016b) . We implement the algorihtm by finishing the code at (https://github.com/liuyuemaicha/ Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow).

4. EXPERIMENT:

Dull responses are defined as in (Li et al., 2016b) and listed in Appendix 7.3.

All baseline models are implemented with the recommended configurations in the existing literatures. We denote our Dialogue Act aware Generation Model with only Supervised Learning as SL-DAGM, and the full model (supervised learning + reinforcement learning) as RL-DAGM. Implementation details are given in Appendix 7.3.

4.2. RESPONSE GENERATION FOR GIVEN CONTEXTS:

The first experiment is to check if the proposed models can generate high-quality responses regarding to given contexts. To this end, we take the last turn of each test dialogue as ground truth, and feed the previous turns as a context to different models for response generation. Top one responses from beam search (beam size= 20) of different models are collected, randomly shuffled, and presented to 3 native speakers to judge their quality. Each response is rated by the three annotators under the following criteria: 2: the response is not only relevant and natural, but also informative and interesting; 1: the response can be used as a reply, but might not be informative enough (e.g.,"Yes, I see" etc.); 0: the response makes no sense, is irrelevant, or is grammatically broken. Table 4 (a) summarizes the annotation results. Improvements from our models over the baseline methods are statistically significant (t-test, p-value < 0.01). In addition to human annotations, we also compare different models using automatic metrics with the the ground truth. These metrics include (1) BLEU (Papineni et al., 2002) which measures term overlap of two responses; (2) embedding based metrics (Liu et al., 2016) such as Embedding Average (Average), Embedding Extrema (Extrema), and Embedding Greedy (Greedy) which measure similarity of two responses in a semantic space; and (3) ratios of distinct unigrams (distinct-1) and bigrams (distinct-2) in the generated responses which are employed in (Li et al., 2015) to measure response diversity. Table 5 reports the automatic evaluation results. We can see that one benefit brought by the dialogue acts is that diversity of responses is significantly improved. This is supported by the much more 2 responses from the two models in Table 4 (a) and the significant improvement on distinct n-grams in Table 5 . The reason is easy to understand: we search a response not only from a language space, but also from an act space. The dimension of dialogue acts provides further variations to the generated responses. On the other hand, due to the diversity, responses from our models may diverge from the ground truth sometimes. This is why improvements on other automatic metrics are not significant. To further explain the advantages of our models, we show an example in Table 6 . In addition to responses from SL-DAGM and RL-DAGM which are selected from the dialogue acts obtained by Equation ( 5), we also show responses from other reasonable but not selected acts. With dialogue acts, responses from our models become really rich, from confirmation (CM.Q) to an open question (CS.Q) and then to a long informative statement (CS.S). More importantly, the dialogue acts let us know why we have such responses: both SL-DAGM and RL-DAGM try to switch to new topics (e.g., Xiamen, noodle, and plan etc.) in order to continue the conversation. One can also change the flow of the conversation by picking responses from other dialogue acts. The example demonstrates that in addition to good performance, our models enjoy good interpretability and controllability as well. We show more such examples in Appendix 7.4.

SL-DAGM ： 好 吧 ， 我 刚 从 厦 门 回 来 ， 想 在 食 堂 吃 碗 面。

4.3. ENGAGEMENT TEST:

Secondly, we study conversation engagement with the proposed models. Experiments are conducted through machine-machine simulation and human-machine conversation. In both experiments, we compare SL-DAGM and RL-DAGM with RL-S2S, as RL-S2S is the only baseline optimized for future success. Responses from all models are randomly sampled from the top 5 beam search results. Average length of dialogues is employed as an evaluation metric.

Machine-machine simulation is conducted in a way similar to (Li et al., 2016b ) in which we let two bots equipped with the same model talk with each other in 1000 simulated dialogues. Each dialogue is initialized with the first utterance of a test example, and terminated according to the termination conditions for reward estimation in Section 3.2. In human-machine conversation, we recruit 5 native speakers as testers and ask them to talk with the bots equipped with the three models. Every time, a bot is randomly picked for a tester, and the tester does not know which model is behind. Every tester finishes 100 dialogues with each bot. To make a fair comparison, we let the bots start dialgoues. A starting message in a dialogue is randomly sampled from the test data and copied 3 times for all the 3 bots (a tester can skip the message if he/she cannot understand it). A dialogue is terminated if (1) the tester thinks the conversation cannot be continued (e.g., due to bad relevance or repetitive content etc.); or (2) the bot gives repetitive responses in two consecutive turns (measured by cosine(e(u i-1 ), e(u i+1 )) > 0.9). Dialogue acts in human turns are tagged by the classifier in Section 2.4. The evaluation metric is calculated with the total 500 dialogues for each model.

Table 4 (b) reports the evaluation results. In both experiments, SL-DAGM and RL-DAGM can lead to longer conversations, and the improvements from both models over the baseline are statistically significant (t-test, p-value < 0.01). Improvements in human-machine conversation are smaller than those in machine-machine simulation, indicating the gap between the simulation environment and the real conversation environment and encouraging us to consider online optimization in humanmachine conversations in the future. RL-DAGM is better than SL-DAGM in both experiments, indicating the efficacy of reinforcement learning.

The reason that our models are better is that they captured conversational patterns in human-human interactions and obtained further optimization through reinforcement learning. First, the models can pro-actively switch contexts in a smooth way. In machine-machine simulation, 65.4% (SL) and 94.4% (RL) dialogues contain at least one CS.*; and in human-machine conversation, the two percentages are 38.1% (SL) and 48.1% (RL) respectively. More interestingly, in machine-machine simulation, average lengths of dialogues without CS.* are only 4.78 (SL) and 2.67 (RL) respectively which are comparable with or even worse than RL-S2S, while average lengths of dialogues with CS.* are 8.66 (SL) and 8.18 (RL) respectively. The results demonstrate the importance of context switch for engagement in open domain conversation and one signficant effect of RL is promoting context switch in interactions for future engagment even with a little sacrifice on relevance of the current turn (e.g., more 0 responses than SL-DAGM in Table 4 (a)). Second, the models can drive conversations by asking questions. In machine-machine simulation, 36.5% (SL) and 32.4% (RL) dialogues contain at least one question. The percentages in human-machine conversation are 17.7% (SL) and 22.3% (RL) respectively. We give more analysis in Appendix 7.5.

4.4. DISCUSSION:

Finally, we study how the generated responses are affected by the dialogue acts. We collect generated responses from a specific dialogue act for the contexts of the test dialogues, and characterize the responses with the following metrics: (1) distinct-1 and distinct-2; (2) words out of context (OOC): ratio of words that are in the generated responses but not contained by the contexts; and (3) average length of the generated responses (Ave Len). 

5. RELATED WORK:

Existing dialogue models are either built for open domain conversation or for specific task completion. Regarding to the former, a common practice is to learn a generation model in an end-to-end fashion. On top of the basic sequence-to-sequence with attention architecture (Vinyals & Le, 2015; Shang et al., 2015) , various extensions have been proposed to tackle the "safe response" problem (Li et al., 2015; Mou et al., 2016; Xing et al., 2017) ; to model complicated structures of conversation contexts (Serban et al., 2016; Sordoni et al., 2015) ; to bias responses to some specific persona or emotions (Li et al., 2016a; Zhou et al., 2017) ; and to pursue better optimization strategies (Li et al., 2017b; 2016b) . On the other line of research, POMDP (Young et al., 2013) breaks down the development of task-oriented dialogue systems into natural language understanding (Yao et al., 2014; Henderson et al., 2014) , dialogue management (Mrkšić et al., 2016) , and response generation (Wen et al., 2015) . Recently, researchers also consider learning task-oriented dialogue models in an end-to-end way (Wen et al., 2016; 2017; Bordes & Weston, 2017) . In this work, we introduce dialogue acts into open domain dialogue generation. Although some previous work (Zhao et al., 2017; Serban et al., 2017a) has leveraged dialogue acts as extra features, the dialogue acts in this work are generally designed for explaining engagement in social chat and modelled as policies to manage the flow of interactions. To the best of our knowledge, we are the first who design dialogue acts to explain social interactions, control open domain response generation, and guide human-machine conversations.

Before us, some researchers have proposed analyzing open domain dialogues with dialogue acts (Kim et al., 2010; 2012; Oraby et al., 2017; Ivanovic, 2005; Wallace et al., 2013; Wu et al., 2005; Ritter et al., 2010) . These work, however, stops at performing utterance classification or clustering.

Our dialogue act design is inspired by these work, but we not only exploit the dialogue acts to interpret open domain dialogues, but also conduct dialogue generation with the dialogue acts.

6. CONCLUSION:

We study open domain dialogue generation with generally designed dialogue acts that can describe human behavior in social interactions. To mimic such behavior, we propose jointly modeling dialogue act selection and response generation, and perform both supervised learning with a learned dialogue act classifier and reinforcement learning for long-term conversation. Empirical studies on response generation for given contexts, machine-machine simulation, and human-machine conversation show that the proposed models can significantly outperform state-of-the-art methods.

7. APPENDIX:

7.1 GENERATION NETWORK Suppose that x i = [a i ; u i-1 ; u i-2 ] = (w i,1 , . . . , w i,n i ) where w i,k is the embedding of the k-th word, then the k-th hidden state of the encoder is given by v

EQUATION

Positions of u -1 and u 0 in x 1 and x 2 are padded with zeros. Let r i = (w i,1 , . . . , w i,T ), then in decoding the j-th word w i,j , {v i,1 , . . . , v i,n i } is summarized as a context vector c through an attention mechanism:

c i,j = n i k=1 α j,k v i,k ; α j,k = exp(e j,k

)

EQUATION

where v and W α are parameters, and v i,j-1 is the (j -1)-th hidden state of the decoder GRU in which v i,j is calculated by

v i,j = f d GRU (v i,j-1 , w i,j-1 , c i,j ).

(14) The generation probability of w i,j is then defined as p r (w i,j |w i,<j , x i ) = I(w i,j ) sof tmax(w i,j-1 , v i,j ),

where I(w i,j ) is a vector with only one element 1 indicating the index of w i,j in the vocabulary. p r (r i |a i , u i-1 , u i-2 ) is finally defined as

EQUATION

7.2. DETAILS OF LEARNING THE DIALOGUE ACT CLASSIFIER:

We randomly split the 500 labeled dialogues as 400, 30, and 70 dialogues for training, validation, and test respectively. Utterances in the three sets are 3280, 210, and 586 respectively. In training, we represent dialogue acts as probability distributions by averaging the labels given by the three annotators. For example, if an utterance is labeled as "CM.S", "CM.S", and "CS.S", then the probability distribution is (0.67, 0, 0, 0.33, 0, 0, 0). In test, we predict the dialogue act of an utterance u i by arg max j g(u i , u i-1 , a i-1 )[j]. To avoid overfitting, we pre-train word embeddings using word2vec5 with an embedding size of 200 on the 30 million data and fix them in training. We set the embedding size of the dialogue acts and the hidden state size of the biGRUs as 100, and the dimensions of the first layer and the second layer of the MLP as 200 and 7 respectively. We optimize the objective function (3) using back-propagation and the parameters are updated by stochastic gradient descent with AdaDelta algorithm (Zeiler, 2012) . The best performing model on the validation data is picked up for test.

7.3. DETAILS OF IMPLEMENTATION OF THE DIALOGUE GENERATION MODEL:

In learning of the generation network, we set the size of word embedding as 620 and the size of hidden vectors as 1024 in both the encoder and the decoder. Both the encoder vocabulary and the decoder vocabulary contain 30, 000 words. Words out of the vocabularies are replaced by a special token "UNK". We employ AdaDelta algorithm (Zeiler, 2012) to train the generation network with a batch size 128. We set the initial learning rate as 1.0 and reduce it by half if perplexity on validation begins to increase. We stop training if the perplexity on validation keeps increasing in two successive epochs.

In learning of the policy network, we set the size of word embedding, the size of dialogue act, and the size of hidden states of the biGRU as 100. There are 50 neurons in the first layer of the MLP and 7 neurons in the second layer of the MLP. Vectors in the policy network have smaller sizes than those in the generation network because the complexity of dialogue act prediction is much lower than language generation.

In reinforcement learning, the size of mini-batch is 60 and learning rate is fixed as 0.05. To estimate the reward, we train a dual LSTM (Lowe et al., 2015) with the size of word embedding and the size of hidden states as 100. Responses from the simulated dialogues are generated with a beam size 20.

In RL-S2S, we define 8 responses as dull responses according to the frequency of responses in the training set. Table 8 gives the responses. 

7.4. MORE EXAMPLES OF RESPONSE GENERATION:

We compare SL-DAGM and RL-DAGM with baseline models in terms of response quality for given contexts with more examples in Table 9 .

7.5. FURTHER ANALYSIS ON ENGAGMENT TEST:

Table 10 gives some examples on machine-machine simulation. Unlike the dialogues from RL-S2S which quickly converge to loops, dialogues from our models smoothly move forward under the management of the dialogue acts. The dialogue acts let us know why such responses are generated and make the simulated dialogues closer to human dialogues with moderate context continuation and jumping out of the contexts at proper timing. Table 11 and Table 12 show some examples from the test of human-machine conversation. We denote a machine turn as "M" and a human turn as "H". After each example, we give the reason of termination in which "EOD-H" means the dialogue is terminated by the tester and "EOD-R" means the dialogue is terminated by the repetition check with the next generated turn attached. Compared to dialogues with the baseline, dialogues with our models can go deeper with much richer content, although a side-effect is that sometimes responses from CS.* might be nonsense (e.g., the first example of SL-DAGM). This sheds light on our future direction to further improve the generation network with knowledge. In addition to the qualitative results, we also show quantitative results of human-machine conversation test in terms of different testers in Figure 2 . Although there exists variance among the testers, the overall trend is consistent with the numbers in Table 4 (b). 

:

https://github.com/cgpotts/swda

https://nlp.stanford.edu/software/tokenizer.shtml

By default, the first utterance in a dialogue is labeled as CM.* except clear opening expressions such as "hello" or "morning", because the first utterance often follows the context of a post.

We omit the dialogue act O, as only 1.1% of the labeled data are O and it is difficult for neural networks to capture the characteristics of text from such a few data. In practice, one can generate text for O by editorial.

https://code.google.com/archive/p/word2vec/

Figures and Tables:

Figure 1: Policy network and generation network.

Figure 2: Evaluation results on human-machine conversation in terms of different testers.

Definition of dialogue acts.

Table content: <table><tr><td>Dialogue Acts</td><td>Definitions</td><td>Examples</td></tr><tr><td>Context Main-</td><td/><td/></tr><tr><td>tain Statement</td><td/><td/></tr><tr><td>(CM.S)</td><td/><td/></tr><tr><td/><td>A user or a bot asks a question in the current</td><td/></tr><tr><td>Context Main-</td><td>context. Questions cover 5W1H and yes-no</td><td/></tr><tr><td>tain Question</td><td>with various functions such as context clarifica-</td><td/></tr><tr><td>(CM.Q)</td><td>tion, confirmation, knowledge acquisition, and</td><td/></tr><tr><td/><td>rhetorical questions, etc.</td><td/></tr><tr><td>Context Main-tain Answer (CM.A)</td><td>A response or an answer to the previous utter-ances in the current context.</td><td>"this summer." after "when are you going to Tokyo?".</td></tr><tr><td>Context Switch</td><td>Similar to CM.S, but the user or the bot tries to</td><td>"I plan to study English this sum-</td></tr><tr><td>Statement</td><td>switch to a new context (e.g., topic) by bringing</td><td>mer." after "I plan to have a tour in</td></tr><tr><td>(CS.S)</td><td>in new content.</td><td>Tokyo this summer.".</td></tr><tr><td>Context Switch Question (CS.Q)</td><td>A user or a bot tries to change the context of conversation by asking a question.</td><td>"When will your summer vaca-tion start?" after "I plan to have a tour in Tokyo this summer."</td></tr><tr><td/><td/><td>"I don't know because I have to</td></tr><tr><td>Context Switch</td><td>The utterance not only replies to the previous</td><td>get an A+ in my math exam."</td></tr><tr><td>Answer (CS.A)</td><td>turn, but also starts a new topic.</td><td>after "when are you going to</td></tr><tr><td/><td/><td>Tokyo?".</td></tr><tr><td>Others (O)</td><td>greetings, thanks, and requests, etc..</td><td>"thanks for your help."</td></tr></table>

Two people can communicate with each other through one posting a comment and the other one replying to the comment. Data in Baidu Tieba covers a large variety of topics, and thus can be viewed as a simulation of open domain conversation in a chatbot. We randomly sample 9 million dialogues as a training set, 90 thousand dialogues as a validation set, and 1000 dialogues as a test set. These data are used to learn a dialogue generation model later. We employ the Standford Chinese word segmenter 2 to tokenize utterances in the data. Table2reports statistics of the data.

Table content: <table><tr><td colspan="4">are generally applicable to open domain dialogues from var-</td></tr><tr><td colspan="4">ious sources in different languages such as Twitter, Reddit, Facebook, Weibo (www.weibo.com),</td></tr><tr><td colspan="4">and Baidu Tieba (https://tieba.baidu.com/), etc. One can extend the taxonomy by defin-</td></tr><tr><td colspan="4">ing finer-grained dialogue acts and learn their generation models with the approaches described later.</td></tr><tr><td colspan="4">Existing annotated data sets (e.g., the Switchboard Corpus 1 ) do not have dialogue acts regarding to</td></tr><tr><td colspan="4">conversational context. Therefore, it is not clear how such dialogue acts depict human behavior in</td></tr><tr><td colspan="4">interactions, and there are no large scale data available for learning dialgoue generation with the</td></tr><tr><td colspan="3">dialogue acts either. To resolve these problems, we build a data set.</td><td/></tr><tr><td>2.2 DATA SET</td><td/><td/><td/></tr><tr><td colspan="4">We crawled 30 million dyadic dialogues (conversations between two people) from Baidu Tieba.</td></tr><tr><td colspan="4">Baidu Tieba is the largest Reddit-like forum in China which allows users to post and comment on</td></tr><tr><td colspan="4">others' post. Table 2: Statistics of the experimental data sets</td></tr><tr><td/><td>train</td><td>val</td><td>test</td></tr><tr><td># dialogues</td><td>9M</td><td>90k</td><td>1000</td></tr><tr><td>Min. # turns per dialogue</td><td>3</td><td>5</td><td>5</td></tr><tr><td>Max. # turns per dialogue</td><td>50</td><td>50</td><td>50</td></tr><tr><td>Avg. # turns per dialogue</td><td>7.68</td><td>7.67</td><td>7.66</td></tr><tr><td colspan="4">Avg. # words per utterance 15.81 15.89 15.74</td></tr></table>

An example of dialogue with labeled acts.

Table content: <table><tr><td>Turns</td></tr></table>

4.1 EXPERIMENT SETUPOur experiments are conducted with the data in Table2. The following methods are employed as baselines: (1) S2SA: sequence-to-sequence with attention(Bahdanau et al., 2015) in which utterances in contexts are concatenated as a long sentence. We use the implementation with Blocks (https://github.com/mila-udem/blocks); (2) HRED: the hierarchical encoder-decoder model in(Serban et al., 2016)  implemented with the source code available at (https://github.com/julianser/hed-dlg-truncated); (3) VHRED: the hier-

Table content: <table/>

Evaluation Results

Table content: <table><tr><td colspan="5">(a) Human annotations. Ratios are calculated by</td><td colspan="2">(b) Average dialogue length in machine-machine and</td></tr><tr><td colspan="4">combining labels from the three judges.</td><td/><td colspan="2">human-machine conversations.</td></tr><tr><td/><td>0</td><td>1</td><td>2</td><td>Kappa</td><td/><td>Machine-Machine Human-Machine</td></tr><tr><td>S2SA</td><td colspan="3">0.478 0.478 0.044</td><td>0.528</td><td>RL-S2S</td><td>4.36</td><td>4.54</td></tr><tr><td>HRED</td><td colspan="3">0.447 0.456 0.097</td><td>0.492</td><td>SL-DAGM</td><td>7.36</td><td>5.24</td></tr><tr><td>VHRED</td><td colspan="3">0.349 0.471 0.180</td><td>0.494</td><td>RL-DAGM</td><td>7.87</td><td>5.58</td></tr><tr><td>RL-S2S</td><td colspan="3">0.393 0.462 0.142</td><td>0.501</td><td/></tr><tr><td colspan="4">SL-DAGM 0.279 0.475 0.244</td><td>0.508</td><td/></tr><tr><td colspan="4">RL-DAGM 0.341 0.386 0.273</td><td>0.485</td><td/></tr></table>

Automatic evaluation results. Numbers in bold mean that improvement from the model on that metric is statistically significant over the baseline methods (t-test, p-value < 0.01).

Table content: <table><tr><td/><td colspan="7">BLEU-1 BLEU-2 Average Extrema Greedy Distinct-1 Distinct-2</td></tr><tr><td>S2SA</td><td>4.67</td><td>1.18</td><td>21.45</td><td>16.68</td><td>21.53</td><td>0.033</td><td>0.069</td></tr><tr><td>HRED</td><td>3.70</td><td>1.06</td><td>16.87</td><td>13.58</td><td>20.15</td><td>0.062</td><td>0.139</td></tr><tr><td>VHRED</td><td>6.10</td><td>1.76</td><td>20.83</td><td>16.17</td><td>21.36</td><td>0.079</td><td>0.225</td></tr><tr><td>RL-S2S</td><td>5.57</td><td>1.83</td><td>20.72</td><td>16.73</td><td>20.64</td><td>0.100</td><td>0.213</td></tr><tr><td>SL-DAGM</td><td>6.23</td><td>2.07</td><td>20.68</td><td>16.42</td><td>21.52</td><td>0.200</td><td>0.466</td></tr><tr><td>RL-DAGM</td><td>6.77</td><td>2.12</td><td>21.18</td><td>16.97</td><td>21.76</td><td>0.223</td><td>0.503</td></tr></table>

An example of response generation. Utterances in the context are split by "⇒".

Table content: <table><tr><td>Context</td><td>Responses</td></tr><tr><td/><td>S2SA: 我也是这么想的。I think so</td></tr><tr><td>一起吃晚餐? ⇒ 中饭好吗？⇒ 中</td><td>HRED：放假了啊？You are already in vacation?</td></tr><tr><td>饭只能在公司吃。⇒ 那我不能来</td><td>VHRED：哈哈哈。Haha.</td></tr><tr><td>了。我在休假。</td><td>RL-S2S：我已经在吃了。I am having lunch now.</td></tr><tr><td>Have dinner together? ⇒ how</td><td/></tr><tr><td>about lunch? ⇒ I can only have my</td><td/></tr><tr><td>lunch at company. ⇒ Then I cannot</td><td/></tr><tr><td>join you because I am in my vaca-</td><td/></tr><tr><td>tion.</td><td/></tr></table>

Characteristics of the generated responses from different dialogue acts.Table7reports the results 4 . In general, responses generated from CS.* are longer, more informative, and contain more new words than responses generated from CM.*, which has been illustrated by the example in Table6. Another interesting finding is that statements and answers are generally more informative than questions in both CS.* and CM.*. In addition to these metrics, we also calculate BLEU scores and embedding based metrics, but do not observe significant difference among responses from different dialogue acts. The reason might be that these metrics are based on comparsion of the generated responses and human responses, but human responses in the test set are inherently mixture of responses from different dialogue acts.

Table content: <table><tr><td/><td colspan="4">Distinct-1 Distinct-2 OOC Ave Len</td></tr><tr><td>CM.S</td><td>0.114</td><td>0.262</td><td>0.091</td><td>5.57</td></tr><tr><td>CM.Q</td><td>0.092</td><td>0.220</td><td>0.038</td><td>5.21</td></tr><tr><td>CM.A</td><td>0.119</td><td>0.269</td><td>0.094</td><td>5.58</td></tr><tr><td>CS.S</td><td>0.250</td><td>0.521</td><td>0.168</td><td>8.21</td></tr><tr><td>CS.Q</td><td>0.223</td><td>0.460</td><td>0.152</td><td>5.85</td></tr><tr><td>CS.A</td><td>0.244</td><td>0.500</td><td>0.166</td><td>8.42</td></tr></table>

Dull responses for learning RL-S2S.

Table content: <table><tr><td colspan="3">No. Chinese responses English translations</td></tr><tr><td>1</td><td>我不知道</td><td>I do not know.</td></tr><tr><td>2</td><td>我觉得你说得对</td><td>I think you are right.</td></tr><tr><td>3</td><td>你是男的女的</td><td>Are you a man or a woman?</td></tr><tr><td>4</td><td>嗯我知道</td><td>I see.</td></tr><tr><td>5</td><td>我也不知道</td><td>I do not know either.</td></tr><tr><td>6</td><td>你说的对</td><td>You are right.</td></tr><tr><td>7</td><td>我也是这么想的</td><td>I think so.</td></tr><tr><td>8</td><td>好啊</td><td>OK.</td></tr></table>

More examples of response generation. Utterances in the context are split by "⇒". Your have dark circles under your eyes. Always stay up late? ⇒ I never stay up late after I graduate from my university. ⇒ Good boy! Early to bed, early to rise. ⇒ Yes. S2SA: 我也是这么想的。I think so HRED：哈哈。Haha. VHRED：你是在夸我吗？So you are praising me? RL-S2S：我也是好孩子。I am a good boy too. SL-DAGM ：我经常倒时差睡眠不好。But I often have poor sleep because of jet lag. (CS.S) RL-DAGM ：想问你每天几点起床。Then when do you get up everyday? (CS.Q) CM.Q：你要睡了吗？Are you going to sleep? CM.S：我也是早睡。I sleep early as well. 邮件发你了。I have sent you an email. HRED：你加我微信可以吗？Could you please add me in your WeChat? VHRED：加我微信。Add me in your WeChat. RL-S2S：邮件发你了。I have sent you an email. SL-DAGM：我想和你一起玩桌游。I want to play board games with you. (CS.S) RL-DAGM： 什 么 时 候 联 系 。When can I contact you? (CM.Q) CS.Q：你在哪个区？Which district do you live in? CM.S：给我微信号。Give me your WeChat ID.

Table content: <table><tr><td>Context</td><td>Responses</td></tr><tr><td>你眼袋略大，常熬夜? ⇒ 我大学</td><td/></tr><tr><td>毕业后没有熬夜过？⇒ 早睡早起</td><td/></tr><tr><td>好孩子⇒ 是的</td><td/></tr></table>

Example 1 of human-machine conversation. "M" means a machine turn, and "H" means a human turn.

Table content: <table/>

Example 2 of human-machine conversation. "M" means a machine turn, and "H" means a human turn.

Table content: <table/>

Peer review (iclr2018):
 The authors use a distant supervision technique to add dialogue act tags as a conditioning factor for generating responses in open-domain dialogues. In their evaluations, this approach, and one that additionally uses policy gradient RL with discourse-level objectives to fine-tune the dialogue act predictions, outperform past models for human-scored response quality and conversation engagement. While this is a fairly straightforward idea with a long history, the authors claim to be the first to use dialogue act prediction for open-domain (rather than task-driven) dialogue. If that claim to originality is not contested, and the authors provide additional assurances to confirm the correctness of the implementations used for baseline models, this article fills an important gap in open-domain dialogue research and suggests a fruitful future for structured prediction in deep learning-based dialogue systems. Some points: 1. The introduction uses "scalability" throughout to mean something closer to "ability to generalize." Consider revising the wording here. 2. The dialogue act tag set used in the paper is not original to Ivanovic (2005) but derives, with modifications, from the tag set constructed for the DAMSL project (Jurafsky et al., 1997; Stolcke et al., 2000). It*s probably worth citing some of this early work that pioneered the use of dialogue acts in NLP, since they discuss motivations for building DA corpora. 3. In Section 2.1, the authors don*t explicitly mention existing DA-annotated corpora or discuss specifically why they are not sufficient (is there e.g. a dataset that would be ideal for the purposes of this paper except that it isn*t large enough?) 3. The authors appear to consider only one option (selecting the top predicted dialogue act, then conditioning the response generator on this DA) among many for inference-time search over the joint DA-response space. A more comprehensive search strategy (e.g. selecting the top K dialogue acts, then evaluating several responses for each DA) might lead to higher response diversity. 4. The description of the RL approach in Section 3.2 was fairly terse and included a number of ad-hoc choices. If these choices (like the dialogue termination conditions) are motivated by previous work, they should be cited. Examples (perhaps in the appendix) might also be helpful for the reader to understand that the chosen termination conditions or relevance metrics are reasonable. 5. The comparison against previous work is missing some assurances I*d like to see. While directly citing the codebases you used or built off of is fantastic, it*s also important to give the reader confidence that the implementations you*re comparing to are the same as those used in the original papers, such as by mentioning that you can replicate or confirm quantitative results from the papers you*re comparing to. Without that there could always be the chance that something is missing from the implementation of e.g. RL-S2S that you*re using for comparison. 6. Table 5 is not described in the main text, so it isn*t clear what the different potential outputs of e.g. the RL-DAGM system result from (my guess: conditioning the response generation on the top 3 predicted dialogue acts?) 7. A simple way to improve the paper*s clarity for readers would be to break up some of the very long paragraphs, especially in later sections. It*s fine if that pushes the paper somewhat over the 8th page. 8. A consistent focus on human evaluation, as found in this paper, is probably the right approach for contemporary dialogue research. 9. The examples provided in the appendix are great. It would be helpful to have confirmation that they were selected randomly (rather than cherry-picked).