SlowGuess/ACL_2020_OCR huggingface dataset:
Koustuv Sinha,\*1,2,3 Prasanna Parthasarathi, 1,2 Jasmine Wang, Ryan Lowe, 1,2,4 William L. Hamilton, 1,2 and Joelle Pineau 1,2,3
<sup>1</sup> School of Computer Science, McGill University, Canada
$^{2}$  Quebec Artificial Intelligence Institute (Mila), Canada
<sup>3</sup> Facebook AI Research (FAIR), Montreal, Canada
4 OpenAI
Evaluating the quality of a dialogue interaction between two agents is a difficult task, especially in open-domain chit-chat style dialogue. There have been recent efforts to develop automatic dialogue evaluation metrics, but most of them do not generalize to unseen datasets and/or need a human-generated reference response during inference, making it infeasible for online evaluation. Here, we propose an unreferenced automated evaluation metric that uses large pre-trained language models to extract latent representations of utterances, and leverages the temporal transitions that exist between them. We show that our model achieves higher correlation with human annotations in an online setting, while not requiring true responses for comparison during inference.
Recent approaches in deep neural language generation have opened new possibilities in dialogue generation (Serban et al., 2017; Weston et al., 2018). Most of the current language generation efforts are centered around language modelling or machine translation (Ott et al., 2018), which are evaluated by comparing directly against the reference sentences. In dialogue, however, comparing with a single reference response is difficult, as there can be many reasonable responses given a context that have nothing to do with each other (Liu et al., 2016). Still, dialogue research papers tend to report scores based on word-overlap metrics from the machine translation literature (e.g. BLEU (Papineni et al., 2002),METEOR (Denkowski and Lavie, 2014)). However word-overlap metrics aggressively penalize the generated response based on lexical differences with the ground truth and correlate poorly to human judgements (Liu et al., 2016).
Figure 1: Model architecture for MaUdE, which is an unsupervised unreferenced metric for dialog evaluation.
One can build dialogue evaluation metrics in two ways: referenced metrics, which compare the generated response with a provided ground-truth response (such as the above word-overlap metrics), or an unreferenced metrics, which evaluate the generated response without any such comparison. Lowe et al. (2017) propose a learned referenced metric named ADEM, which learns an alignment score between context and response to predict human score annotations. However, since the score is trained to mimic human judgements, it requires collecting large-scale human annotations on the dataset in question and cannot be easily applicable to new datasets (Lowe, 2019).
Recently, Tao et al. (2017) proposed a hybrid referenced-unreferenced metric named RUBER, where the metric is trained without requiring human responses by bootstrapping negative samples directly from the dataset. However, referenced metrics (including RUBER, as it is part referenced) are not feasible for evaluation of dialogue models in an online setting—when the model is pitched against a human agent (model-human) or a model agent (model-model)—due to lack of a reference response. In this setting, models are usually eval
*Corresponding author: koustuv.sinha@mail.mcgill.ca. Code for reproducing the experiments are available at https://github.com/facebookresearch/online_DIALOG.eval.
Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2430-2441 July 5 - 10, 2020. ©2020 Association for Computational Linguistics
uated directly by humans, which is costly and requires careful annotator training (Li et al., 2019).
The contributions of this paper are (1) a completely unsupervised unreferenceed metric MAUDE (Metric for automatic Unreferenced dialogue evaluation), which leverages state-of-the-art pretrained language models (Devlin et al., 2018; Sanh et al., 2019), combined with a novel discourse-structure aware text encoder and contrastive training approach; and (2) results showing that MAUDE has good correlation with human judgements.
We consider the problem of evaluating the response of a dialogue system, where an agent is provided with a sequence of sentences (or utterances)  $c = \{u_1, u_2, \dots, u_n\}$  (termed as context) to generate a response  $r = u_{n+1}$ . Each utterance,  $u_i$ , can be represented as a set of words  $u_i = \{w_1, w_2, \dots, w_n\}$ . An utterance  $u_i$  can be represented as a vector as  $\mathbf{h}_i = f_e(u_i)$ , where  $f_e$  is an encoder that encodes the words into a fixed vector representation.
This work focuses on the evaluation of generative neural dialogue models, which typically consist of an encoder-decoder style architecture that is trained to generate  $u_{n+1}$  word-by-word (Serban et al., 2017). The response of a generative model is typically evaluated by comparing with the ground-truth response using various automatic word-overlap metrics, such as BLEU or METEOR. These metrics, along with ADEM and RUBER, are essentially single-step evaluation metrics, where a score is calculated for each context-response pair. If a dialogue  $D_i$  contains  $n$  utterances, we can extract  $n-1$  context-response pairs:  $(c_1 : \{u_1\}, r_1 : \{u_2\})$ ,  $(c_2 : \{u_1, u_2\}, r_2 : \{u_3\}), \ldots, (c_{n-1} : \{u_1 \ldots u_{n-1}\}, r_{n-1} : u_n)$ . In this paper, we are interested in devising a scalar metric that can evaluate the quality of a context-response pair:  $\text{score}(c_i, r_i) = \mathcal{R} \in (0,1)$ . A key benefit of this approach is that this metric can be used to evaluate online and also for better training and optimization, as it provides partial credit during response generation.
We propose a new model, MAUDE, for online unreferenced dialogue evaluation. We first describe the general framework behind MAUDE, which is inspired by the task of measuring alignment in natural
language inference (NLI) (Williams et al., 2017). It involves training text encoders via noise contrastive estimation (NCE) to distinguish between valid dialogue responses and carefully generated negative examples. Following this, we introduce our novel text encoder that is designed to leverage the unique structural properties of dialogue.
MAUDE is designed to output a scalar score  $(c_{i},r_{i}) = \mathcal{R}\in (0,1)$ , which measures how appropriate a response  $r_i$  is given a dialogue context  $c_{i}$ . This task is analogous to measuring alignment in NLI, but instead of measuring entailment or contradiction, our notion of alignment aims to quantify the quality of a dialogue response. As in NLI, we approach this task by defining encoders  $f_{e}^{\theta}(c)$  and  $f_{e}^{\theta}(r)$  to encode the context and response, a combination function  $f_{comb}(.)$  to combine the representations, and a final classifier  $f_{t}(.)$ , which outputs the alignment score:
$$
\operatorname {s c o r e} (c, r) = \sigma \left(f _ {t} \left(f _ {\text {c o m b}} \left(f _ {e} ^ {\theta_ {1}} (c), f _ {e} ^ {\theta_ {2}} (r)\right)\right)\right). \tag {1}
$$
The key idea behind an unreferenced dialogue metric is the use of Noise Contrastive Estimation (NCE) (Gutmann and Hyvarinen, 2010) for training. Specifically, we train the model to differentiate between a correct response  $(\mathrm{score}(c,r)\to 1)$ , and a negative response  $(\mathrm{score}(c,\hat{r})\to 0)$ , where  $\hat{r}$  represents a candidate false response for the given context  $c$ . The loss to minimize contains one positive example and a range of negative examples chosen from a sampling policy  $P(\hat{r})$ :
$$
\mathcal {L} = - \log (\operatorname {s c o r e} (c, r)) - \mathbb {E} _ {\hat {r} \sim P (\hat {r})} \log (- \operatorname {s c o r e} (c, \hat {r})). \tag {2}
$$
The sampling policy  $P(\hat{r})$  consists of syntactic and semantic negative samples.
Syntactic negative samples. We consider three variants of syntax level adversarial samples: word-order (shuffling the ordering of the words of  $r$ ), word-drop (dropping  $x\%$  of words in  $r$ ) and word-repeat (randomly repeating words in  $r$ ).
Semantic negative samples. We also consider three variants of negative samples that are syntactically well formed, but represent corruption in the semantic space. First, we choose a response  $r_j$  which is chosen at random from a different dialogue such that  $r_j \neq r_i$  (random utterance). Second, we use a pre-trained seq2seq model on the dataset, and pair random seq2seq generated response with  $r_i$  (random seq2seq). Third, to provide a bigger variation of semantically negative samples, for each  $r_i$  we generate high-quality paraphrases
$r_i^b$  using Back-Translation (Edunov et al., 2018). We pair random Back-Translations  $r_j^b$  with  $r_i$  as in the above setup (random back-translation). We also provide the paired  $r_i^b$  as positive example for the models to learn variation in semantic similarity. We further discuss the effect of different sampling policies in Appendix C.
Dialogue-structure aware encoder. Traditional NLI approaches (e.g., Conneau et al. (2017)) use the general setup of Equation 1 to score context-response pairs. The encoder  $f_{e}$  is typically a Bidirectional LSTM—or, more recently, a BERT-based model (Devlin et al., 2018), which uses a large pre-trained language model.  $f_{comb}$  is defined as in Conneau et al. (2017):
$$
f _ {c o m b} (u, v) = \operatorname {c o n c a t} ([ u, v, u * v, u - v ]). \quad (3)
$$
However, the standard text encoders used in these traditional NLI approaches ignore the temporal structure of dialogues, which is critical in our setting where the context is composed of a sequence of distinct utterances, with natural and stereotypical transitions between them. (See Appendix A for a qualitative analysis of these transitions). Thus we propose a specialized text encoder for MAUDE, which uses a BERT-based encoder  $f_{e}^{\mathrm{BERT}}$  but additionally models dialogue transitions using a recurrent neural network:
$$
\mathbf {h} _ {u _ {i}} = \mathbf {D} _ {g} f _ {e} ^ {\mathrm {B E R T}} (u _ {i}),
$$
$$
\mathbf {h} _ {u _ {i + 1}} ^ {\prime} = f _ {R} (\mathbf {h} _ {u _ {i}}, \mathbf {h} _ {u _ {i}} ^ {\prime}),
$$
$$
\mathbf {c} _ {i} = \mathbf {W}. \operatorname {p o o l} _ {\forall t \in \left\{u _ {1}, \dots , u _ {n - 1} \right\}} \left(\mathbf {h} _ {t} ^ {\prime}\right)
$$
$$
\operatorname {s c o r e} \left(c _ {i}, r _ {i}\right) = \sigma \left(f _ {t} \left(\left[ \mathbf {h} _ {r _ {i}}, \mathbf {c} _ {i}, \mathbf {h} _ {r _ {i}} * \mathbf {c} _ {i}, \mathbf {h} _ {r _ {i}} - \mathbf {c} _ {i} \right]\right)\right), \tag {4}
$$
where  $\mathbf{h}_{u_i} \in \mathcal{R}^d$  is a downsampled BERT representation of the utterance  $u_i$  (using a global learned mapping  $\mathbf{D}_g \in \mathcal{R}^{B \times d}$ ).  $\mathbf{h}_{u_i}'$  is the hidden representation of  $f_R$  for  $u_i$ , where  $f_R$  is a Bidirectional LSTM. The final representation of the dialogue context is learned by pooling the individual hidden states of the RNN using max-pool (Equation 4). This context representation is mapped into the response vector space using weight  $\mathbf{W}$ , to obtain  $\mathbf{c}_i$ . We then learn the alignment score between the context  $\mathbf{c}_i$  and response  $r_i$ 's representation  $\mathbf{h}_{r_i}$  following Equation 1, by using the combination function  $f_{comb}$  being the same as in Equation 3.
To empirically evaluate our proposed unreferenced dialogue evaluation metric, we are interested in answering the following key research questions:
- Q1: How robust is our proposed metric on different types of responses?
- Q2: How well does the self-supervised metric correlate with human judgements?
Datasets. For training MAUDE, we use PersonaChat (Zhang et al., 2018), a large-scale open-domain chit-chat style dataset which is collected by human-human conversations over provided user persona. We extract and process the dataset using ParlAI (Miller et al.) platform. We use the public train split for our training and validation, and the public validation split for testing. We use the human-human and human-model data collected by See et al. (2019) for correlation analysis, where the models themselves are trained on PersonaChat.
Baselines. We use InferSent (Conneau et al., 2017) and unreferenced RUBER as LSTM-based baselines. We also compare against BERT-NLI, which is the same as the InferSent model but with the LSTM encoder replaced with a pre-trained BERT encoder. Note that these baselines can be viewed as ablations of the MAUDE framework using simplified text encoders, since we use the same NCE training loss to provide a fair comparison. Also, note that in practice, we use DistilBERT (Sanh et al., 2019) instead of BERT in both MAUDE and the BERT-NLI baseline (and thus we refer to the BERT-NLI baseline as DistilBERT-NLI).<sup>1</sup>.
4.1 Evaluating MAUDE on different types of responses
We first analyze the robustness of MAUDE by comparing with the baselines, by using the same NCE training for all the models for fairness. We evaluate the models on the difference score,  $\Delta = \text{score}(c, r_{\text{ground-truth}}) - \text{score}(c, r)$  (Table 6).  $\Delta$  provides an insight on the range of score function. An optimal metric would cover the full range of good and bad responses. We evaluate response  $r$  in three settings: Semantic Positive: responses that are semantically equivalent to the ground truth response; Semantic Negative: responses that are semantically opposite to the ground truth response; and Syntactic
DistilBERT is the same BERT encoder with significantly reduced memory footprint and training time, which is trained by knowledge distillation (Bucilu et al., 2006; Hinton et al., 2015) on the large pre-trained model of BERT.
R	IS	DNLI	M
Semantic Positive ↓	BackTranslation	0.249	0.278	0.024	0.070
Seq2Seq	0.342	0.362	0.174	0.308
Semantic Negative ↑	Random Utterance	0.152	0.209	0.147	0.287
Random Seq2Seq	0.402	0.435	0.344	0.585
Syntactic Negative ↑	Word Drop	0.342	0.367	0.261	0.3
Word Order	0.392	0.409	0.671	0.726
Word Repeat	0.432	0.461	0.782	0.872
Table 1: Metric score evaluation  $(\Delta = \text{score}(c, r_{\text{ground-truth}}) - \text{score}(c, r))$  between RUBER (R), InferSent (IS), DistilBERT-NLI (DNI) and MAUDE (M) on PersonaChat dataset's public validation set. For Semantic Positive tests, lower  $\Delta$  is better; for all Negative tests higher  $\Delta$  is better.
Negative: responses that have been adversarially modified in the lexical units. Ideally, we would want  $\Delta \rightarrow 1$  for semantic and syntactic negative responses,  $\Delta \rightarrow 0$  for semantic positive responses.
We observe that the MAUDE scores perform robustly across all the setups. RUBER and InferSent baselines are weak, quite understandably so because they cannot leverage the large pre-trained language model data and thus is poor at generalization. DistilBERT-NLI baseline performs significantly better than InferSent and RUBER, while MAUDE scores even better and more consistently overall. We provide a detailed ablation of various training scenarios as well as the absolute raw  $\Delta$  scores in Appendix C. We also observe both MAUDE and DistilBERT-NLI to be more robust on zero-shot generalization to different datasets, the results of which are available in Appendix B.
4.2 Correlation with human judgements
Metrics are evaluated on correlation with human judgements (Lowe et al., 2017; Tao et al., 2017), or by evaluating the responses of a generative model trained on the metric (Wieting et al., 2019), by human evaluation. However, this introduces a bias either during the questionnaire setup or during data post-processing in favor of the proposed metric. In this work, we refrain from collecting human annotations ourselves, but refer to the recent work by See et al. (2019) on PersonaChat dataset. Thus, the evaluation of our metric is less subject to bias.
See et al. (2019) conducted a large-scale human evaluation of 28 model configurations to study the effect of controllable attributes in dialogue generation. We use the publicly released model-human and human-human chat logs from See et al. (2019) to generate the scores on our models, and correlate them with the associated human judgement on a Likert scale. See et al. (2019) propose to use a multi-step evaluation methodology, where the hu
R	IS	DNLI	M
Fluency	0.322	0.246	0.443	0.37
Engagingness	0.204	0.091	0.192	0.232
Humanness	0.057	-0.108	0.129	0.095
Making Sense	0.0	0.005	0.256	0.208
Inquisitiveness	0.583	0.589	0.598	0.728
Interestingness	0.275	0.119	0.135	0.24
Avoiding Repetition	0.093	-0.118	-0.039	-0.035
Listening	0.061	-0.086	0.124	0.112
Mean	0.199	0.092	0.23	0.244
Table 2: Correlation with calibrated scores between RUBER (R), InferSent (IS), DistilBERT-NLI (DNI) and MAUDE (M) when trained on PersonaChat dataset
man annotators rate the entire dialogue and not a context-response pair. On the other hand, our setup is essentially a single-step evaluation method. To align our scores with the multi-turn evaluation, we average the individual turns to get an aggregate score for a given dialogue.
Figure 2: Human correlation on un-calibrated scores collected on PersonaChat dataset (Zhang et al., 2018), for MAUDE, DistilBERT-NLI, InferSent and RUBER
We investigate the correlation between the scores and uncalibrated individual human scores from 100 crowdworkers (Fig. 2), as well as aggregated scores released by See et al. (2019) which are adjusted for annotator variance by using Bayesian calibration (Kulikov et al., 2018) (Table 2). In all cases, we report Spearman's correlation coefficients.
For uncalibrated human judgements, we observe MAUDE having higher relative correlation in 6 out of 8 quality measures. Interestingly, in case of calibrated human judgements, DistilBERT proves to be better in half of the quality measures. MAUDE achieves marginally better overall correlation for calibrated human judgements, due to significantly strong correlation on specifically two measures: Interestingness and Engagingness. These measures answers the questions "How interesting or boring did you find this conversation?" and "How much did you enjoy talking to this user?". (Refer to Appendix B of See et al. (2019) for the full
list of questions). Overall, using large pre-trained language models provides significant boost in the human correlation scores.
In this work, we explore the feasibility of learning an automatic dialogue evaluation metric by leveraging pre-trained language models and the temporal structure of dialogue. We propose MAUDE, which is an unreferenced dialogue evaluation metric that leverages sentence representations from large pretrained language models, and is trained via Noise Contrastive Estimation. MAUDE also learns a recurrent neural network to model the transition between the utterances in a dialogue, allowing it to correlate better with human annotations. This is a good indication that MAUDE can be used to evaluate online dialogue conversations. Since it provides immediate continuous rewards and at the single-step level, MAUDE can be also be used to optimize and train better dialogue generation models, which we want to pursue as future work.
We would like to thank the ParlAI team (Margaret Li, Stephen Roller, Jack Urbanek, Emily Dinan, Kurt Shuster and Jason Weston) for technical help, feedback and encouragement throughout this project. We would like to thank Shagun Sodhani and Alborz Geramifard for helpful feedback on the manuscript. We would also like to thank William Falcon and the entire Pytorch Lightning community for making research code awesome. We are grateful to Facebook AI Research (FAIR) for providing extensive compute / GPU resources and support regarding the project. This research, with respect to Quebec Artificial Intelligence Institute (Mila) and McGill University, was supported by the Canada CIFAR Chairs in AI program.
Layla El Asri, Hannes Schulz, Shikhar Sharma, Jeremie Zumer, Justin Harris, Emery Fine, Rahul Mehrotra, and Kaheer Suleman. 2017. Frames: A corpus for adding memory to goal-oriented dialogue systems. arXiv.
Cristian Bucilu, Rich Caruana, and Alexandru Niculescu-Mizil. 2006. Model compression. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining.
Pawel Budzianowski, Tsung-Hsien Wen, Bo-Hsiang Tseng, Inigo Casanueva, Ultes Stefan, Ramadan Osman, and Milica Gašić. 2018. Multiwoz - a large-scale multi-domain wizard-of-oz dataset for task-oriented dialogue modelling. In Proceedings of EMNLP. MultiWoz CORPUS licensed under CC BY 4.0.
Alexis Conneau, Douwe Kiela, Holger Schwenk, Loic Barrault, and Antoine Bordes. 2017. Supervised Learning of Universal Sentence Representations from Natural Language Inference Data.
Michael Denkowski and Alon Lavie. 2014. Meteor universal: Language specific translation evaluation for any target language. In Proceedings of the ninth workshop on statistical machine translation.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. arXiv.
Sergey Edunov, Myle Ott, Michael Auli, and David Grangier. 2018. Understanding back-translation at scale. In Proceedings of ACL.
W.A. Falcon. 2019. Pytorch lightning. https://github.com/williamFalcon/pytorch-lightning.
Michael Gutmann and Aapo Hyvarinen. 2010. Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics.
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. 2015. Distilling the knowledge in a neural network. arXiv.
Ilya Kulikov, Alexander H Miller, Kyunghyun Cho, and Jason Weston. 2018. Importance of a search strategy in neural dialogue modelling. arXiv.
Margaret Li, Jason Weston, and Stephen Roller. 2019. Acute-eval: Improved dialogue evaluation with optimized questions and multi-turn comparisons. arXiv.
Yanran Li, Hui Su, Xiaoyu Shen, Wenjie Li, Ziqiang Cao, and Shuzi Niu. 2017. Dailydialog: A manually labelled multi-turn dialogue dataset. In Proceedings of IJCNLP.
Chia-Wei Liu, Ryan Lowe, Iulian V. Serban, Michael Noseworthy, Laurent Charlin, and Joelle Pineau. 2016. How NOT To Evaluate Your Dialogue System: An Empirical Study of Unsupervised Evaluation Metrics for Dialogue Response Generation. arXiv.
Ryan Lowe. 2019. A Retrospective for "Towards an Automatic Turing Test - Learning to Evaluate Dialogue Responses". ML Retrospectives.