Target-Guided Dialogue Response Generation Using Commonsense and Data Augmentation
Abstract
Target-guided response generation enables dialogue systems to smoothly transition a conversation from a dialogue context toward a target sentence.
Such control is useful for designing dialogue systems that direct a conversation toward specific goals, such as providing counselling and creating non-obtrusive recommendations.
In this paper, we introduce a new technique for target-guided response generation, which first finds a bridging path of commonsense knowledge concepts between the source and the target, and then uses the identified bridging path to generate transition responses.
Additionally, we propose techniques to re-purpose existing dialogue datasets for target-guided generation.
Experiments reveal that the proposed techniques outperform various baselines on this task.
Finally, we observe that the existing automated metrics for this task correlate poorly with human judgement ratings.
We propose a novel evaluation metric that we demonstrate is more reliable for target-guided response evaluation.
Our work generally enables dialogue system designers to exercise more control over the conversations that their systems produce.
Introduction
Open-domain conversational systems have made significant progress in generating good quality responses driven by strong pre-trained language models (Radford et al., 2019;
Devlin et al., 2019) and large-scale corpora available for training such models.
However, instead of passively responding to a user, dialogue systems can take on a more proactive role to make recommendations, help users discover new services, or educate users about interesting new topics to improve user experience.
Furthermore, in case a conversation goes awry or a user becomes abusive towards the system, a proactive or target-guided system can bring the conversation back to the system’s agenda and towards safer conversational topics.
Prior work has used mechanisms such as emotion labels (Zhong et al., 2019), persona (Song et al., 2019), and politeness (Niu and Bansal, 2018) to control conversations according to the system’s agenda.
However, such approaches require labelled training data for a set of pre-determined labels, making it harder to incorporate new goals in a system.
In this work, we study the problem of proactive response generation based on a target sentence.
For example in Figure 1, given the context ‘I enjoy swimming’, the system guides the conversation towards the target ‘I like to travel to new places’ by mentioning ‘I like to swim at beaches when I go on vacation’.
Using target sentences for proactive control is a intuitive and flexible control mechanism for dialogue developers, free of domain-specific handcrafting and annotations.
Existing publicly available dialogue corpora generally consists of free-flow conversations where the speakers move the conversation forward based on the dialogue history alone, with no particular agenda.
We build upon the recently released Otters dataset (Sevegnani et al., 2021) with one-turn topic transitions for mixed-initiative in open-domain conversations.
Given a source sentence from a speaker, the task is to generate a topic transition sentence with “bridging” strategies to a target sentence from another speaker.
The task is challenging on several fronts.
First, the system needs to balance the trade-off between coherence with the context while smoothly transitioning towards to the target.
Second, the Otters training dataset is relatively small (less than 2000 training instances), making it a lowresource setting.
Finally,we show that standard word-overlap metrics are insufficient for this task.
In this work, we propose methods to leverage commonsense knowledge from ConceptNet (Speer et al., 2017a) to improve the quality of transition responses.
Our technique decomposes the response generation process into first generating explicit commonsense paths between the source and target concepts, followed by conditioning on the generated paths for the response generation.
This is intended to mimic how humans might bridge concepts for creating transitions in conversations using commonsense knowledge.
This technique offers two benefits: 1) Leveraging external ConceptNet knowledge solves the data scarcity issue and improves the model’s capability to generate logical transitions; 2) Since the transition response is grounded on commonsense knowledge paths, the explicit paths used by the model can provide explanations for the concepts used by the model, as well as provide control over the generation process.
Furthermore, we propose a data augmentation mechanism to help with the data scarcity issue by re-purposing training data from DailyDialog, an open-domain dialogue dataset.
Both these approaches are complementary and outperform existing baselines in response quality and transition smoothness.
We demonstrate how the proposed approach of using explicit bridging paths enables improved quality of transitions through qualitative and human studies.
Automated evaluation is a challenging aspect in dialogue response generation tasks (Zhao et al., 2017).
We show that the existing word-overlap metrics such as BLEU can be easily fooled to assign high scores to poor responses just based on high n-gram overlap with reference responses.
We propose a metric T ARGET -C OHERENCE which is trained using hard adversarial negative instances, and achieves high correlation with human judgement ratings of system outputs.
As part of this work, we collect and release a dataset of human ratings of various system outputs for this task.
Related Work
Target Guided Dialogue Response Generation:
Sevegnani et al.
(2021) is perhaps the closest to our work described in this paper.
They work on the task of generating a new utterance which can achieve a smooth transition between the previous turn’s topic and the given target topic.
Past work in controllable text generation has explored steering neural text generation model outputs to contain a specific keyword (Keskar et al., 2019), a knowledge graph (Wu et al., 2019), or a topic (Ling et al., 2021).
Steering dialogue towards a given keyword has also been explored in past work (Tang et al., 2019; Qin et al., 2020a; Zhong et al., 2021), albeit as a retrieval task.
In contrast, our goal is to generate a next utterance in a dialogue setup which can steer a conversation towards target sentence in a smooth fashion rather than generating a response for a given keyword or topic.
Our work is also related to prior work on text infilling (Donahue et al., 2020; Qin et al., 2020b), though compared to them we work in a dialogue setup and utilize commonsense knowledge to perform the infilling.
Commonsense for Dialogue Generation: Commonsense knowledge resources (Speer et al., 2017b; Malaviya et al., 2020) have been used in dialogue response generation for tasks such as personagrounded dialogue (Majumder et al., 2020) and open-domain dialogue generation (Ghazvininejad et al., 2018; Hedayatnia et al., 2020;
Zhou et al., 2021c).
Zhou et al.
(2021a) created a dataset focusing on social commonsense inferences in dialogue and Arabshahi et al.
(2020) designed a theorem prover for if-then-because reasoning.
A concurrent work (Zhou et al., 2021b) proposed to train a model to explicitly generate implicit knowledge and use this knowledge to generate a response.
Compared to their work, we focus on target-guided response generation, suggest mechanism for knowledge alignment with the transition response during training, and focus on multi-hop knowledge paths.
More broadly, commonsense knowledge has been used in text generation tasks such as story and essay generation (Guan et al., 2019a; Yang et al., 2019).
Automated Metrics for Evaluating Dialogue
Quality: Automated metrics such as BLEU (Papineni et al., 2002), METEOR (Banerjee and
Lavie, 2005), and BertScore (Zhang et al., 2020) are widely used to evaluate quality of machinegenerated text.
However, such metrics often correlate poorly with human judgement ratings of generated text quality (Sai et al., 2020).
Past work has explored trained model-based metrics such as
ADEM (Lowe et al., 2017) and RUBER (Tao et al., 2017).
However, training such model-based metrics often relies on tagged training data.
Gupta et al.
(2021) propose ways to mitigate the need for such labelled data by automatically synthesizing negative examples.
Our proposed metric is along similar lines, though we utilize different techniques for synthetic negative example generation.
Task Overview
We first formalize the task of target-guided response generation.
Given a conversation context c between two speakers A and B, and a target utterance t for speaker B, the task is to generate a transition sentence s which serves as a smooth link between the context and the target.
The target is a phrase or a sentence.
Otters dataset (Sevegnani et al., 2021) consists of a simplified setting of oneturn topic transitions, where the conversation history consists of a single utterance u a from speaker
A, and a target utterance u b for speaker B, and the task is to generate a transition utterance s for speaker B to serve as a smooth link between u a and u b .
The task is challenging since a system needs to devise a strategy that balances the competitive objectives of generating a response which is coherent to the context, while smoothly driving the conversation towards the target.
In this work, we propose two approaches for the transition response generation task: 1)
Commonsense-guided response generation (section 4), and 2) Data augmentation to tackle data sparsity (section 5).
We refer to the proposed method as CODA (Commonsense Path and Data
Augmentation) .
We also propose a novel metric
T ARGET -C
OHERENCE to automatically evaluate the smoothness of response transitions (section 6).
Commonsense-Guided Response Generation
We frame the target-guided response generation task as follows.
Given a conversation context c and a target t , a conditional language model learns to predict the transition response s .
Target-guided generation can potentially benefit by incorporating commonsense reasoning by identifying rich connections between a pair of entities which enable us to generate logical transition responses connecting the two.
Pre-trained language models are known to suffer in cases where commonsense knowledge is required during generation (Zhou et al., 2018;
Guan et al., 2019b), especially in tasks where there is not enough data available for learning commonsense patterns from the text, which is true for our case.
In contrast, Commonsense Knowledge Graphs like
ConceptNet (Speer et al., 2017a) provide structured knowledge about entities, which enables higherlevel reasoning about concepts.
In this work we use commonsense knowledge from ConceptNet for planning a transition response.
ConceptNet is a large-scale semantic graph that has concepts as nodes and has commonsense relationships between them, such as ‘IsA’ and ‘AtLocation’.
However, ConceptNet suffers from severe sparsity issues (Malaviya et al., 2020; Bosselut et al., 2019).
Therefore, it is not always possible to find the concepts and relationships between context and target concepts.
To address the sparsity issue, we develop Knowledge Path Generator ( KPG ), a language model trained on paths sampled from
ConceptNet.
The model takes a pair of entities or concepts as input and generates a multi-hop path connecting the two.
Since the knowledge paths are sampled from a generative model rather than retrieved from a fixed knowledge base, we are no longer limited by the entities and paths present in the ConceptNet knowledge base.
To generate commonsense based responses, we train a Commonsense Response Generator ( CRG ) model to generate the transition response conditioned on the paths generated by the KPG model ( Figure 2).
Conditioning the response generation on commonsense paths improves the reasoning capabilities of the CRG model and provides the added benefits of interpretability and control over the generation process.
4. Commonsense path generator
The KPG models attempts to connect a concept or entity phrase from the context to a concept from the target by creating knowledge paths between them.
Path Sampling:
To create training data for the
KPG models, we sample paths between entity phrases from ConceptNet using random walks.
This step builds upon past work of Wang et al.
Given nodes N and edges E from Con- ceptNet, we perform random walks on the graph to sample a set of paths P of the form p = { n 0 , e 0 , n 1 , e 1 , ..., e k − 1 , n k } ∈ P .
Here, a path p connects a head entity phrase n 0 with the tail entity phrase n k via intermediate entities and edges (or relations) n i , e i .
To sample paths, the random walk begins with a random entity node n 0 and samples a path of random length k ∈ { 1 , 2 , ..., K } , where we have set K = 6 in this work.
To sample paths that are useful for our task, we prevent sampling certain edges types such as Synonym (Appendix A.1).
KPG-head-tails (KPG-ht): KPG-ht is a GPT2 (Radford et al., 2019)
based model which is trained to predict a knowledge path p which links a head entity n h to a tail entity n t .
For a sample path p = { n h , e 0 , n 1 , e 1 , ..., e k − 1 , n t } from ConceptNet, the path is formatted into the following sequence “[target] n t [sep] n h e 0 n 1 e 1 , . . .
, e k −n t ”.
KPG-ht is only used during CRG inference where the head entity is extracted from the context and tail entity from the target (Figure 2).
KPG-will-contain (KPG-wc): A large number of possible paths can exist for a given head-tail entity pair.
Training the CRG model by conditioning on paths which are irrelevant to the gold transition response might discourage the CRG model from conditioning on the provided commonsense path.
Since we do not have gold paths for a response, we instead train a model KPG-wc to generate paths which are more aligned to the gold response by enforcing the generated path to contain entities from the gold response.
KPG-wc is trained to predict a path which contains a pre-specified entity set
E p = { k 1 , ..., k n } in the generated path by formatting paths sampled from ConceptNet as the following sequence: “[wc] k 1 [wc] k 2 . . .
[target] n t [sep] n h e 0 n 1 e 1 , . . .
, e k − 1 n t ” (Figure 2).
The entity set E p is a randomly permuted sequence of entities n 1 , n 2 , . . . , n k − 1 from the sampled path.
Here “wc” symbolizes “will contain”.
Training with this sequence indicates to the model that the path generated between n h and n t should contain the entities from the set E p in a sensible order.
Specifying the special token “[target]” followed by the tail entity n t informs the model about the last entity it should output when generating a path.
We discuss how the set E p is constructed for CRG model training in the next section.
In practice, we train a single common GPTbased model for KPG-wc and KPT-ht.
The model at test time is able to generate knowledge paths for either case, whether in-path entities from E p are present (KPG-wc) in the input or not (KPG-ht).
4. Response generator
The Commonsense response generator conditions on the commonsense paths generated from the KPG models to generate the transition responses.
Entity extraction .
We extract a set of entities
E h , E t and E r from the context, target and gold transition response respectively using NLTK.
We designed simple grammar rules (details in Appendix A.1) to convert phrases to concise forms that match the nodes present in ConceptNet, e.g. , “watching the star” is converted to “watch stars”.
Sampling and filtering paths: In this step, for every pair of head and tail entity from E h and E t , we sample multiple paths from the KGP models using topk sampling and chose one or more of these paths for training and inference.
For training the
CRG models with the commonsense paths, we need to curate paths that are relevant to and aligned with the gold response so that they are not ignored by the
CRG model during inference.
We achieve this by first sampling paths which are relevant to the gold response, and then apply filtering mechanisms to curate the final set of paths.
For training data path sampling, we use the KPG-wc model (Figure 2).
The input to the model is a head and tail entity pair n h and n t , and the entity set E p that consists of the set of entities E r from the gold transition response.
The model then generates a set of paths that contain the head and tail entities as well as the gold response keywords.
Thus, the sampled path is inherently relevant to the gold response due to the conditioning on gold keyword entities.
During inference , the set E r is not available, so we leverage the KPG-ht model that takes just the head and tail entity pair n h and n t as input to generate a commonsense path.
Assuming the context and target consists of m and n entities each, and we generate q number of paths per pair, we get a total of m × n × q number of paths for each data instance.
Since m × n × q can be a large number, we use simple methods to sub-select entity pairs and paths.
(1) Sub-selecting
Entity Pairs: We score an entity pair by calculating the inverse document frequencies (computed using
Gutenberg English corpus) of the entity tokens and summing up the maximum value found for a token in each entity in the pair.
For training phase, we keep the top D pairs of entities, and for testing phase we keep only the highest-scoring pair.
Sub-selecting paths: We apply the following strategies to prune the set of paths for each entity pair: 1) Perplexity - We filter out all the paths whose perplexity values (from the KGP models) are more than double the average perplexity values of all paths between an entity pair.
We remove all the paths which have repetition of entities since repetition often leads to degeneration during decoding. 3) For paths in training data, we filter out paths which contain entities not present in the gold response.
The final set of paths P are converted into natural language by converting the relation and inverse relations into textual format.
For example, “art gallery UsedFor for art” is converted to “art gallery is used for art”.
Training and inference in CRG model .
The CRG model (GPT-2 based) is trained as a conditional model with the following input sequence: “ knowledge path [target] target sentence [context] context sentence [response] transition response ” for each knowledge path from the set P .
We train the CRG model by minimizing the log-likelihood loss of the transition response.
For inference, we create the set of paths P by entity extraction, path sampling and filtering and choose a random path p from the final set P .
The model generates the transition response conditioned on the sequence of c, t , and p .
Data Augmentation
The task of target-guided response generation is still a relatively unexplored task, and Otters (Sevegnani et al., 2021) is the only suitable dataset for this task to the best of our knowledge.
However,
Otters is small and consists of only a few hundred context-target pairs.
This makes learning transition concepts and strategies challenging in this lowresource setup.
On the other hand, there are many publicly available dialogue datasets for training response generation models.
Such datasets contain free-flow conversations, where although the speakers generate context coherent responses, they do not condition their responses on any target.
We propose a technique to leverage and re-purpose such datasets for the task of target-guided response generation.
We pick the DailyDialog (Li et al., 2017) dataset for experimentation and convert its conversations to target-guided conversations in two steps: 1) Target creation, and 2) Data filtering.
For target creation , we run Semantic Role La- [Figure] belling (SRL) to predict predicate and arguments in a response.
For each predicate identified, we create a clause by putting together the predicate and arguments in a textual sequence.
Finally, we only use the clause occurring towards the end of the response as a target.
An example for target creation is shown in Figure 3 (More details about clause identification are in Appendix A.2).
The target creation step does not guarantee that a candidate response transitions smoothly towards the target clause.
In the data filtering step, we introduce a T ARGET -C
OHERENCE metric to score a transition response in terms of its coherence to the context and smoothness towards the target.
The metric is described in more detail in section 6.
The metric assigns a score between 0-1 for a transition response and we remove instances with a score less than a threshold k (set to 0.7) from consideration.
The remaining instances are used for pretraining response generation models which are finally finetuned on the Otters dataset.
Target-Coherence Metric
Evaluating target-guided responses is a challenging task as a good transition response needs to be both - coherent to the context and smoothly transition towards the target.
Furthermore, since the task is open-domain and open-ended, there are many possible correct responses which may not match with a reference response (Çelikyilmaz et al., 2020).
To tackle these challenges, we propose an automatic metric for this task that does not use human references.
The proposed metric T ARGETC OHERENCE is based on a classification model trained to classify a transition response as either positive , that is, it is coherent to the context and smoothly transitions towards the target, or negative, that is, the response is either not coherent to the context or does not transition towards the target.
We use the gold transition response from the training dataset to create positive instances for training.
For a positive instance with context c , target
POSITIVE Gold c,r,t
CONTEXT c the restaurant looks authentic european.
RESPONSE r the chef trained in florence.
TARGET t the pasta tastes nice here. NEGATIVE Random t’ with gold r,c TARGET t’ i love to drive my car. NEGATIVE Random c’ with gold r,t CONTEXT c’ i enjoy computers and phones. NEGATIVE Random r’ with gold c,t Response r’ there is no parking here.
Dataset
Train
Dev
Test
Otters-id
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] DailyDialog 11, 1, 1, t and response r , we create negative instances using the following mechanisms: 1) We hold two out of (c,t,r) constant while randomly sample the third one.
For example, sample a random context c ′ , which makes r incoherent to the c ′ .
An example is shown in Figure 4.
We use a GPT-2 model trained on Otters dataset to generate a response r ′ coherent to c but conditioned on a random target t ′ .
For a target t , we chose a response r ′ from the Otters training set which has t as the target but context c ′ ̸
= c .
We sample a maximum ofnegative instance per mechanism and balance the count of positive and negative instances by repeating positive instances.
We fine-tune a pre-trained BERT-base (Devlin et al., 2019) model on these instances with binary cross entropy loss.
Experiments 7. Datasets
We use two datasets in our experiments.
1) Otters (Sevegnani et al., 2021) contains instances with context-target-transition response triplets.
It consists of two sets of splits.
The Out-Of-Domain (OOD) split ensures that none of the context-target pairs in the test set are present in the train set.
In the In-Domain (ID) split, one of either the context or the target in each pair in the test-set is allowed to appear in the train-set.
DailyDialog dataset consists of casual conversations between two speakers.
In Table 1 we present the number of dialogues in
DailyDialog dataset and number of responses in otters, along with number of unique context-target pairs in brackets.
Otters dataset consists of multiple responses per context-target pair.
Some transition responses in Otters dataset are noisy - they contain sentences and phrases from the target sentences.
We remove such data from the test sets (with word overlap 0.75), leaving 1019 data points in the
Otters-id test set and 988 data points in the Ottersood test set.
7. Baselines for generation
We report results for a number of baselines.
We provide complete implementation details of CODA and all baselines in Appendix A and B.
• GPT-2: (Radford et al., 2019)
A pretrained GPT– small language model fine-tuned on Otters data.
Conditions on the context and target sentences to generate the transition response.
• GPT2-Fudge Yang and Klein (2021) uses a discriminator trained to distinguish good response continuations from the poor ones and guides the GPT-2 based decoder towards responses that are coherent to both the source and target sentences.
• Multigen (Ji et al., 2020) combines the vocabulary distribution generated by underlying GPTmodel with a concept distribution from a commonsense knowledge base (ConceptNet).
• Concept-Predict leverages a concept prediction strategy from Qin et al.
(2020a).
The concept is predicted based on closeness to the target.
• CS-Pretrain model is pretrained with commonsense paths used for training the KPG models and is based on the commonsense story generation model from Guan et al.
Ablation experiments : We report results for following CODA variants:
• CODA-O NLY DA : CODA variant that uses DailyDialog augmentation and does not use commonsense paths from KPG models in the CRG model.
• CODA-N O DA : CODA trained without additional data from DailyDialog.
• CODA-N O E DGE CODA variant that uses only entities and no edges from the path.
• CODA-N O A LIGN : variant that relies on only KPG-ht for training and inference.
Does not select paths based on alignment with responses.
• CODA-KBP ATH : variant that retrieves paths directly from ConceptNet using the algorithm proposed in Lin et al.
• CODA-Upper Upper bound for CODA which
[Table] uses paths inferred from the gold responses using the KPG-wc keywords model during inference.
7. Evaluation Metrics
We report standard automated metrics such as
BLEU (Papineni et al., 2002), ROUGE-L (Lin, 2004), METEOR (Banerjee and Lavie, 2005) [Table]
and BertScore (BS-rec and BS-F1) (Zhang et al., 2020).
Evaluation is carried out using multiple references from the test set.
Word-overlap metrics do not correlate well with human judgements (Liu et al., 2016).
Additionally, we observe that on this task, even a poor transition response can get a high score on reference-based metrics if it has high overlap with the context or the target.
We carry out an experiment where we use the target, context and one of the references as the transition response.
An ideal metric would score the reference response high, and give low scores to target and context used as a response.
In Table 2, reference-based metrics assign higher scores to target and context sentences used as responses compared to human-written responses.
In contrast, T ARGET -C
OHERENCE assigns high scores to reference responses and low scores to target and context sentences.
Correlation of metrics with human judgements:
We investigate how well do the metrics correlate with human ratings of system outputs.
To perform this analysis, responses from CODA, baselines, as well as reference responses are judged by crowdsource annotators who rate the smoothness of a response given the dialogue context and the target on a scale of 0 to 1.
We collect a total ofratings across Otters ID and OOD splits, and report Spearman rank correlation (Spearman, 1961) of the metrics and the ratings.
Krippendorff’s alpha for annotation is 0.42.
Results, shown in last column of Table 2, depict that most standard automated metrics correlate poorly with human ratings, while [Table] [Table]
the, proposed T ARGET -C
OHERENCE achieves a very high correlation score of 0 . 47 .
We present the Amazon Mechanical Turk interface for human ratings collection in Figurein the Appendix.
The workers were first shown instructions about the task with definitions and examples for all the rating criteria. We paid crowd workers on Amazon’s Mechanical Turk platform $0.7 per annotation and gave bonuses to annotators with high annotation quality. Our estimated hourly pay was $13, which is above the minimum US federal hourly wage.
We set the worker qualification condition as 1000 HITS completed, 95% or more approval rate and location as native English speaking countries.
We release the human ratings and system outputs used for computing the metric correlations as part of this work.
7. Results
In this section we present the automatic and human evaluation results.
Automated metric results are summarized in Table 3.
Although reference-based metrics are lexically biased (subsection 7.3), we still report their scores.
We observe that CODA outperforms all the baselines under in-domain (ID) as well as out-of-domain (OOD) setups of Otters data as per T ARGET -C OHERENCE (TC) score.
For example, CODA gets a high TC score of 36 . 7 (ID) and 37 .
9 (OOD) while the TC scores of the closest baselines GPT2-Fudge, Multigen and Conceptpredict are in the range of 28 - 31 , demonstrating that the proposed method leads to significant improvements in response quality.
However, CODA is far from reaching human performance (TC 77.4).
CODA Ablations: We observe that: (1) Not using commonsense knowledge (CODA-O NLY DA) leads to large performance drops, highlighting that
CODA effectively utilizes commonsense knowl-
[Table] edge. (2) Dropping data augmentation leads to a small drop in performance (CODA-N O DA), hinting at relatively small (but still significant) benefit from pretraining the model using data augmentation.
(3) Low performance of CODA-N O E DGE shows the importance of using edges in commonsense paths.
(4) Not aligning and selecting paths based on their relevance to responses during CRG training (CODA-N O A LIGN ) leads to a high drop in performance.
(5) CODA outperforms CODAKBP ATH by 8% (ID) and 14.5% (OOD).
This improved performance can be attributed to the generalizability of entities and paths generated from the KPG models.
(6) CODA-U PPER achieves high scores, highlighting that further improvement in commonsense path generation component can significantly boost the output quality of CODA.
Human Evaluation: We conduct human evaluations on Amazon Mechanical Turk to evaluate the quality of generated transition responses.
Annotators are requested to evaluate the transition response on following criteria: (1) Smooth : rate whether the response serves as a smooth transition between the dialogue context and target.
(2) Sensible : whether the response makes sense in itself i.e. it is grammatical and logically coherent.
(3) Informative : how much informative content a response carries.
Human annotators compare (or mark as a [Table] tie) responses from two models.
We collect two annotations for 100 randomly selected data points from the test outputs.
Results in Table 4 demonstrate that CODA outputs are preferred over the baselines on ‘Smooth’ and ‘Informative’ criteria.
7. Qualitative Analysis
We present representative outputs from the models in Table 5.
For CODA [Table] we show the path used in response generation.
We notice that GPT-2 and
Multigen often tend to either generate simple outputs ( e.g. ‘I hate my food’ in the last example) or simply repeat or address either the target or the context ( e.g. ‘My pet is the gecko’, ‘Seattle is my favorite city to go.’) which leads to high BLUE and METEOR scores, but low TC scores.
CODA avoids these pitfalls as it is conditioned on generated commonsense paths based on both the context and target entities leading to more informative and sensible outputs.
However, CODA is susceptible to two issues: 1) Using poor keywords for path generation, and 2) Generation of irrelevant paths ( e.g. ‘server is a person not desires greasy food’ in the last example).
Path quality : We conduct a human evaluation study to measure the quality of the generated paths.
For randomly selected 100 generated responses, we ask annotators to judge 1) Relevance: Is the path relevant and used in the response?
and 2) Makes sense: Does the path makes sense?
Results reveal that 79% of the paths were judged to be relevant and 76% of the paths were judged to make sense.
Thus in aggregate, the generated knowledge is good in quality, and is used in the generated response.
Path novelty :
We analyzed the paths generated by
CODA which were judged as sensible by human annotators and found that 26.8% of entities in the paths were not found in ConceptNet.
This include entities such as ‘favorite food’, ‘pet kitten’, ‘single kid’ and ‘online class’.
Thus, the actual paths from the ConceptNet might not be able to cover a large fraction of head/tail entities.
Furthermore, 81% of sensible paths are novel and do not exist in ConceptNet.
For example, even though the path ‘eat motivates go to restaurant has subevent dinner is the location for bread’ exist in ConceptNet, the path ‘eat motivates go to restaurant has subevent dinner is the location for pizza’ does not exist in ConceptNet.
Thus we show that CODA can generalize to new entities and paths.
In Appendix C we discuss a human-in-the-loop study for controllability.
The human-in-the-loop experiment shows that even minimal human intervention in the form of domain relevant keywords input for knowledge paths can improve the quality and smoothness of the transition responses.
Conclusion
In this work, we propose and evaluate models for target-guided response generation using explicit commonsense bridging paths.
We also introduce an automated metric to evaluate smoothness of a transition response.
We showed that our model generates more smooth and informative outputs through automatic and human evaluation.
Furthermore, it allows for more interpretable results.
Going forward, we envision a model which could combine target and non-target guided dialogue planning.
Ethics and Broader Impact
Our proposed models for target-guided response generation can be used to generate responses based on target sentences that can drive the system’s agenda in a conversation. Deploying a targetsentence guided dialogue model needs careful consideration and testing since designating a target sentence for all turns of a conversation might disrupt the natural flow of the conversation. Therefore, they can be deployed alongside existing non-target guided dialogue models that perform free-flow conversations without predesignated targets. At each turn of a conversation, a central system can use the target-coherence metric to decide if the sys- tem should generate a target guided response or a simple follow-up response to the context.
Target guided systems can used for several useful applications such as providing counselling and advice, creating non-obtrusive recommendations, comforting people, recommending new products and services, and introducing interesting new topics and educating users about those topics.
We also recognize potential misuse of such models for persuading users by people with ill intentions.
For example, conversational systems can pose as humans and then proactively alter user’s perceptions about specific issues, evaluations of products or services, or political inclinations.
To circumvent such issues, it is necessary to improve transparency through regulations, such as informing the users that they are conversing with a bot and not a human. Proposed systems can create risks that must be addressed to avoid hazardous outcomes during deployment. For example, European Union’s regulatory framework proposal on artificial intelligence 2 defines “educational or vocational training, that may determine the access to education and professional course of someone’s life” as high risk. Anyone who uses or builds upon our system should comply with such regulations.
Current conversational systems suffer from several limitations, such as, they are not good at human qualities such as empathy, morality, discretion and factual correctness. There is a risk that a target driven system would ignore these factors to achieve the target. Therefore more research is needed to equip bots with such qualities. Our models are trained on existing datasets such as Otters and DailyDialog, and also leverage external commonsense knowledge resources.
Knowledge graphs such as ConceptNet have been found to contain biases and have weak representations of moral common sense knowledge (Hulpus , et al., 2020; Mehrabi et al., 2021). While grounding on knowledge paths from knowledge graphs can provide insights and explanation about the model’s reasoning, our models could potentially inherit biases present in these data sources. Advancements in adding a moral dimension to KGs, and extending them with intuition of morality (such as crime is bad), can enable generation of morally correct knowledge paths.
Finally, Henderson et al. ; Dinan et al. (2021) highlight and discuss potential ethical and safety is- sues that arise in dialogue systems research and Xu et al.
(2020) provides a review of recent methods that try to mitigate safety issues in open-domain dialogue generation which can be utilized for the target-guided response generation task.
A Implementation Details for CODA A. Training Details for CODA
Model training : We code our models using Pytorch and Huggingface 3 library.
We use validation loss to do model selection.
The KPG-wc, KPGht and CRG models are all based on GPT-2 small architecture.
We use batch size of 10 for GPTmodels.
We use Adam optimizer with initial learning rate of 1 e − 4 .
We use GeForce RTX[-
-]
GPUs for training models.
All existing code used and datasets were CC-BY 4.0 or open sourced by original authors.
Decoding paths and responses : For decoding paths using the KPG models, we use temperature of 0.7 and nucleus sampling with top-p set to 0.9.
We use the same decoding strategy and hyperparameters for decoding responses using CRG model.
Concept Extraction : Entities are extracted from the context, target and response to generate and align paths using the KPG models.
For a sentence s, we first extract the set of noun and verb phrases from the sentence using NLTK.
We design simple grammar rules to convert some phrases to a more concise forms that are similar to the kinds of nodes present in ConceptNet,e.g., “watching the star” is converted to “watch stars”.
We use NLTK’s
POS tagging combined with the following grammar rules: (1) Nouns and Adjectives, terminated with Nouns <NN.*|JJ>*<NN.
*> (2) Verb and verb phrases <RB.?>*<VB.?>*<JJ>*<VB.?>+<VB>?.
We normalize the verbs using NLTK.
The final set of entities consist of the noun and verb phrases.
We exclude phrases such as “today”, “enough” which are sometimes incorrectly detected as entities.
Sub-selecting entity pairs during training of
CRG model :
For every context-target pair, we have n number of pair of head-tails entities.
We score an entity pair by calculating the inverse document frequencies (computed using Gutenberg English corpus) of the entity tokens and summing up the maximum value found for a token in each entity in the pair.
For training phase, we keep the topD pairs of entities.
The value of top D is selected based on validation performance and comes out typically between 1-3.
Knowledge graph details : The number of nodes in the ConceptNet resource we have used 4 is 382226.
We perform random walks on the graph with paths of length from 1 to 6 and get a total ofnumber of paths.
Edges in the knowledge path : We discard some edge types which are regarded to be uninformative and offer little help for our task following Wang et al.
They include RelatedTo, Synonym,
Antonym, DerivedFrom, FormOf, EtymologicallyDerivedFrom and EtymologicallyRelatedTo.
Since the nodes in ConceptNet are directional, we also add inverse edges during path sampling.
For example the path “ecosystem <– PartOf <– organism” can be sampled as “ecosystem _isPartOf organism” where the underscore indicates a reverse edge.
A. Clause Identification for Data Augmentation
For target creation , given a dialogue context c and its response r , we first break the response r into sentence clauses.
For example, given a context “Is my booking complete?”
and the response “your reservation is confirmed.
now i need your phone number,”, we extract a clause t “i need your phone number” as the target candidate t .
For clause extraction we use Allennlp’s SRL parser 5 which is trained using a BERT-based model (Shi and Lin, 2019) and is based on PropBank (Palmer et al., 2005).
It identifies the arguments associated with the predicates or verbs of a sentence predicates (verbs or events) in a sentence and classifies them into roles such as agent, patient and instrument.
For the example above, it identifies “need” as a predicate with agent “i” and instrument “your number”.
A. Data Augmentation for CODA
We filter data from the dailydialog dataset based on a threshold set to 0.7 for data augmentation.
This threshold was selected using emperical performance of thr CODA model.
For CODA-O NLY DA model which does not use knowledge paths, the context, target and transition response is used directly in training the CRG decoder of CODAO NLY DA model.
But for CODA model which uses the knowledge paths, the dailydialog data is converted to the same format as Otters data, that is, we first do entity detection on the target component of the responses as well as the the dialogue context.
Then we generate a set of paths for each pair of entities.
The CODA model is first trained on paths from the filtered dailydialog data and then finetuned on the Otters dataset which follows the same [Table] knowledge path format.
The maximum dialogue history length is set to 2 for dailydialog dataset.
A. Target Coherence Metric
In Table [Table] we provide examples for stress testing the Target-Coherence metric.
TC scores for the responses are shown in brackets.
Simply repeating or addressing either the target or context gets a low
TC score.
For example the response “I like stargazing outside” is not a smooth transition and gets a low TC score, while “I like stargazing outside with my pet” is a smooth transition and gets a high
TC score.
In Figure 4 we present an overview of the mechanisms used for generating negative samples for training the Target-Coherence metric.
For negative examples, 1) Given gold response r, and context c, we sample a random negative target t’, which creates a response which does not transition towards the target t, 2) Given gold response r, and target t, we sample a random negative context c’, which creates a response which is not coherent to the context c, 3)
Given gold context c, and target t, we either sample a random negative response r’ or generate a response r’ conditioned on random c’ or t’, which creates a response which does not transition to target t or is coherent to context c.
B Training Details of Baselines
Training GPT-2 Fudge model Yang and Klein (2021) proposed a future discriminator based decoding technique.
The Fudge discriminator uses a discriminator trained to distinguish good response continuations from the poor ones and guides the
GPT2 based decoder towards responses that are coherent to both the source and target sentences.
The
Fudge discriminator needs positive and negative sample data for training.
We train the discriminator to distinguish a good response from a bad (not coherent to target or context).
The input to [Table] i need your address send money; visit; mail; send gift; send coupon you should spend time with your friends don’t be alone; mental health; be happy; you can try our restaurant best ingredients ; cheapest food; free delivery our new recipe is best selling fat free; healthy; protein; tasty i am the best financial advisor get rich quickly; sound advice; money management you should have a positive attitude mental health; others will help; peace we should always avoid fighting peace; happiness; injury; understand other people i want to come to united states freedom ;democracy; money; job; american dream; education everyone should get vaccinated public health; reduce hospital burden; live longer; covid; be safe we should donate to charity help poor; make a difference; give assistance; feel good; social benefits train the discriminator (a LSTM model) is the concatenation of the context sentence, followed by the target sentence and finally the tokens of a response r with tokens k.
The discriminator then learns to predict 1 if the next token in the response at position k belongs to the gold response or 0 if the token is a random one.
We train the Fudge discriminator by preparing negative instances using the same techniques we use to train the Target-Coherence model - sampling random negative responses, responses coherent to the context but not to the target, and responses coherent to the target but not to the context.
Training CS-Pretrain model The model is based on the commonsense story generation model from
Guan et al.
We create training data for the CS-Pretrain model by using the same sampled paths we use for training the KPG-wc model.
The paths are converted into textual format by converting edges into text sequences.
The model is only pretrained with general commonsense paths and then fine-tuned on Otters dataset in a manner similar to the GPT-2 baselines (i.e. without paths).
Our experiments show that pretraining with commonsense model does not help with target-guided task, probably since the task needs target conditional commonsense and general commonsense knowledge only confuses the model during decoding.
Training Concept-Predict leverages a concept prediction strategy from Qin et al.
(2020a).
The input to the model is the context and target and it predicts a single concept based on closeness to the target.
The concept is then fed as an input to the CRG model along with the context and target sentences.
Training CODA-O NLY DA : CODA variant that uses Dailydialog augmentation and does not use commonsense paths from KPG models in the CRG model.
Therefore the model consists of only a CRG model (no KPG models) which take the context and target sentences as inputs.
Training CODA-N O E DGE CODA variant that uses only entities and no edges from the path.
For example the path “favorite city is the location which has bicycle shop is a dependency of ride bicycle” is converted to “favorite city bicycle shop ride bicycle”, which is fed as input to the CRG model.
Training CODA-N O A LIGN : variant that relies on only KPG-ht for training and inference.
Does not select paths based on alignment with responses.
The paths used during training the CRG model come from KPG-ht instead of KPG-wc.
Training CODA-KBP ATH : variant that samples paths directly from ConceptNet using the algorithm proposed in Lin et al.
Given a pair of context and target concept, we use their algorithm to sample an actual path directly from ConceptNet.
The model is pretrained on Dailydialog augmented data and fine-tuned on Otters with the sampled paths from ConceptNet.
The model suffers from missing entities and missing links between entities in ConceptNet which is solved by CODA.
C Human-in-the-loop Experiment Can human involvement improve generation?
Our CRG model uses explicit paths generated from the KPG models, which not only provides interpretability, it also allows human-in-the-loop intervention for finer controllability.
To test this hypothesis, we create a model KPG-oneent which is a hybrid version of KPG-wc and KPG-
ht model.
The model takes a single entity n k given by a user as an input and is trained to generate a path containing that entity.
We test this model on a manually created set of target sentences S of size 10 belonging to domains such as healthcare and charity.
The data created is shown in Table 7.
An example sentence in set S is ‘we should donate to charity’ and we manually curate a set of keywords such as ‘help poor’, ‘give assistance’ and ‘tax deductions’ that are relevant to the target sentence of interest and can guide the knowledge path sampling towards [Table] meaningful paths.
This data creation took the authors 30 minutes of effort.
For 100 random sampled contexts from the Otters dataset, we select a random target sentence from the set S and sample a keyword k from the curated set of keywords of that target.
We compare this controllable model with the KPG-ht model that was used for path generation in all our experiments.
We present sample outputs of the model in Table 8.
The input keywords used as intervention are underlined.
The paths which use the keyword intervention generate smoother transitions compared to the paths which do not use the keyword intervention.
We find that the T ARGET -C
OHERENCE metric favors the KPGoneent model in 59 percent of cases, confirming that even minimal human intervention in the form of domain relevant keywords can improve the quality of generation.