Towards Zero-Shot Persona Dialogue Generation with In-Context Learning
Year: 2023

Abstract:
Much work has been done to improve persona consistency by finetuning a pretrained dialogue model on high-quality human-annoated persona datasets. However, these methods still face the challenges of high cost and poor scalability. To this end, we propose a simpleyet-effective approach to significantly improve zero-shot persona consistency via in-context learning. Specifically, we first pre-train a persona-augmented dialogue generation model and then utilize in-context prompting mechanism to realize zero-shot persona customization. Experimental results demonstrate that our method can dramatically improve persona consistency without compromising coherence and informativeness in zero-shot settings.

heading: 1 Introduction
text: Endowing a dialog agent with consistent personas plays a very crucial role for build a more engaging and human-like chatbot. While large-scale pretrained dialog models have achieved great success (Adiwardana et al., 2020; Roller et al., 2021; Bao et al., 2021a; Gu et al., 2022; Thoppilan et al., 2022), maintaining persona consistency remains unsatisfactory and challenging when applying these pretrained models to different scenarios with preset personas.
Traditional approaches for addressing this issue typically involve manually collecting persona dialogue datasets, such as PersonaChat (Zhang et al., 2018), and fine-tuning pre-trained dialogue models on these datasets (Liu et al., 2020; Wolf et al., 2019). However, these methods face high costs for obtaining high-quality human-labeled persona datasets and scalability issues when encountering unseen persona information in the fine-tuned datasets (Huang et al., 2020; Roller et al., 2020)
To this end, we propose a novel in-context prompting learning mechanism to tackle zero-shot persona-based dialogue generation. By leveraging the pre-trained dialogue foundation model, we
aim to generate persona-based dialogues without the need for expensive labeled data. Prompt-based in-context learning(Brown et al., 2020, Liu et al., 2021) has demonstrated its efficacy in few-shot or even zero-shot settings. In this work, we aim to implement a zero-shot persona dialogue generation mechanism using in-context prompt learning. However, we face two challenges:
• Selecting appropriate prompts: Previous research (Zheng and Huang, 2021) has identified that their prompting method is not compatible with knowledge-grounded approaches. The prompts should be effective for the pretrained dialogue foundation model to implement zero-shot persona dialogue generation (see Section 3).
• Even though designing an appropriate prompt is crucial, improving the in-context learning ability of the pretrained model is also important (see Section 4).
We would also like to highlight the practical value of our proposed work. In real application scenarios, the only cost of creating a new personalized chatbot is obtaining the corresponding persona prompts based on the prompt template, without the need for additional data annotation work. This significantly reduces the cost of creating a personalized chatbot.
In summary, this work makes the following contributions:
• We firstly propose a novel persona prompting mechanism in persona dialogue, enabling zero-shot capabilities to maintain consistency with preset personas.
• We demonstrate the importance of persona information in the pre-trained dialogue model for persona dialog, which can improve the in-context learning ability compared to the
1387
state-of-the-art models PLATO-2(Bao et al., 2020) and EVA2.0(Gu et al., 2022).

heading: 2 Related Work
text: There exists much work on consistent personabased dialog generation. In particular, Zhang et al. (2018) proposed the PersonaChat dataset that has extensively promoted the development of this field where the crowd-workers are simply asked to chat with the other person naturally with the given personas. Zheng et al. (2019) constructed a large-scale persona dataset based on structured persona knowledge with public Weibo data. For improving persona consisitency, Qian et al. (2018) proposed an explicit persona model to generate consistent responses for given profile information. Liu et al. (2020) proposed P2 BOT to improve dialogue consistency by incorporating mutual persona perception. Song et al. (2021) disentangled persona-based dialogue generation into consistency understanding and dialogue generation. Cao et al. (2022) presented a model-agnostic data manipulation method for consistent persona generation.
While these works have shown promising performance on preset personas in their respective datasets, they heavily rely on expensive humanlabeled datasets. Moreover, customizing a chatbot with unseen personas in zero-shot settings remains challenging. To address these limitations, this paper proposes an in-context prompting learning mechanism to improve zero-shot persona consistency without the need for human-annotated data.

heading: 3 In-Context Persona Prompting Learning
text: We propose a novel in-context prompting learning mechanism for zero-shot personalized dialogue. The idea is simple yet highly effective. We format the preset persona information into multiple turns of a dialogue and place it at the beginning of the original dialogue context, as illustrated in Figure 1. This approach differentiates our method from (Thoppilan et al., 2022), where the prompt consists of a single starting sentence. Furthermore, our method also differs from most previous prompting methods in GPT-3 (Brown et al., 2020), where prompts are typically used to distinguish between different tasks.
One of the key advantages of our approach is that it enables zero-shot persona customization without the need for annotating specific persona data.
This distinguishes it from the dialogue prompting method proposed in (Zheng and Huang, 2021), which requires fine-tuning on specific persona information.
The detailed process of in-context persona prompting is as follows:
(1) Customize the specific persona settings in the prompt templates, as described in Table 3 of Appendix A. For example, if the name is set to Lucy, then the corresponding slot in the name response of the template is filled with Lucy.
(2) Construct the dialog flow using the prompt based on the current dialog context, following the template. Place this constructed prompt in front of the dialog context. For example, if we choose three attributes name, gender, and age, then we need to connect the corresponding utterance-response pairs to create a sequence of six sentences and place them before the context. Note that our work involves 14 persona attributes.

heading: 4 Pre-trained Dialogue Model
text: To enhance the persona utilization ability of the pre-trained model in the aforementioned in-context prompting approach, we conduct pretraining on a persona-augmented dialogue generation model. Instead of using the conventional encoder-decoder architecture for dialogue generation, the pretrained model retains the use of the prefix LM (language model) approach, as described in (Dong et al., 2019; Bao et al., 2021a,b; Lei et al., 2022). The key difference lies in the inclusion of persona informa-
tion for both speakers in the input of the pretrained model. This requires specific modifications to the input representation, which are described in detail in the following subsection.

heading: 4.1 Input Representation
text: A visual representation of our input representation is given in Figure 2.
• Input Tokens: The input includes user profile, bot profile, context, and response. In order to handle cases with or without profiles, we randomly sample and add user profiles and bot profiles. During the construction of training samples, there is a 50% chance of adding profiles. As a result, the input can fall into one of the following four types: 25% of the samples do not include profile information, 25% only contain user profiles, 25% only contain bot profiles, and 25% include both user and bot profiles. The attributes and values of the profiles are packed into the user profile sequence or bot profile sequence, respectively.
• Delimiter Tokens: In order to distinguish different input slots, special delimiters [BOS] and [EOS] are used. Each input part starts with [BOS] and ends with [EOS] and the sentence in the context ends with [EOS].
• Embeddings: The embeddings of the token are constructed by summing the corresponding token, position, type, and role embeddings as shown in Figure 2.

heading: 4.2 Data Collection for Pretrained Model
text: The dataset for training our pre-trained model, referred to as Persona Dialogue Pre-training(PDP) Dataset, is collected from publicly available social media sources. Following the approach in (Mazaré et al., 2018; Bao et al., 2020), the text is processed
into the format of dialogue sessions. The key difference from previous dialogue pretraining corpora is the addition of profile information for dialogue participants in each dialogue session. In addition, another difference is that we did not truncate the length of the dialogue context. For example, in Meena (Adiwardana et al., 2020), the context is only 7 turns. The basic statistics of the dataset are presented in Table 1.

heading: 5 Experiments
text: In this section, we will discuss the baselines, evaluation metrics, model comparisons, and results.

heading: 5.1 Baselines
text: We select the following state-of-the-art Chinese pretrained generative dialogue models as baselines.
• EVA2.0 (Gu et al., 2022) is trained on the transformer-based architecture combined with a bidirectional encoder and a unidirectional decoder with cleaning WDC-Dialogue(Zhou et al., 2021). There are three model sizes: 300M, 970M and 2.8B. Since the the 2.8B version EVA2.0xLarge obtains the best performance, we compare with this version.
• PLATO-2-FT is trained on the basis of PLATO-2 (Bao et al., 2021a) using the DuLeMon dataset (Xu et al., 2022) with persona utilization. The PLATO-2-FT model consists of approximately 1.6 billion parameters.

heading: 5.2 Evaluation
text: Automatic evaluation of open-domain dialogue poses significant challenges, particularly when evaluating persona-related dialogues, which are often sparse (Roller et al., 2020). Therefore, in our experiments, we conduct human evaluations.
Evaluation Metrics. In the human evaluation, participants engage in conversations with the chatbot and assess the quality of the chatbot’s responses. We employ four utterance-level metrics for humanbot chat evaluation: coherence, informativeness, persona consistency, and persona question-answer. Inspired by the findings in (Vinyals and Le, 2015) that semantically similar questions can yield inconsistent answers, we devised the persona questionanswer metric for evaluation. For instance, by asking "what do you do?" and "what is your job?", we can observe if a chatbot consistently provides different answers. This metric helps assess the model’s consistency with the preset chatbot’s profile. Crowd-sourcing workers are tasked with scoring the response quality on a scale of [0, 1].
To evaluate coherence, informativeness, and persona consistency, we collected interactive conversations. Each conversation starts with a preselected topic and spans 7 turns. We extracted 100 diverse topics from the high-frequency topics of a commercial chatbot, covering various areas such as life, emotions, hobbies, and more. In total, 700 responses were evaluated for these metrics. For persona question-answer evaluation, we gathered 14 basic persona information attributes and created 24 questions for each attribute. The persona questionanswer test set comprises 336 questions, with 240 of them involving unseen persona attributes from the pretraining. More details about the persona question-answer evaluation can be found in Appendix C. The collected conversation data was distributed to crowd-sourcing workers for evaluation. We report the average score for each evaluation metric based on their assessments.

heading: 5.3 Results
text: The results presented in Table 2 demonstrate that our method is an effective zero-shot prompt-based learning approach that significantly improves persona consistency. It is evident that EVA-2.0 fails to achieve the desired results when utilizing persona prompting. We attribute this to the relatively small number of dialogue turns in the training data of these models, resulting in weaker in-context learning capabilities. In contrast, our method achieves a persona question-answer accuracy of 0.93, which is a substantial improvement compared to other models. Specifically, compared to PLATO-2-FT, our method exhibits a significant improvement of 78%. Notably, in terms of persona consistency, our method shows a 40% improvement, increasing from 0.45 to 0.85, which is a significant advancement over PLATO-2-FT. These results indicate that our model outperforms state-of-the-art baselines.
We also analyzed the impact of persona categories that were not included in the pretraining data, and the persona question-answer accuracy was found to be 0.92. This demonstrates that our method can be extended to incorporate additional persona attributes, showcasing its excellent transferability. Additionally, we tested the customization ability of the model and examined whether the model’s responses align with the pre-set persona configurations. Our model maintains consistency across different settings and exhibits strong robustness to variations in persona values, as detailed in Appendix C. These findings illustrate that our model possesses effective customization capabilities and achieves high persona consistency in the zero-shot setting.

heading: 6 Conclusion
text: In this paper, we propose a novel in-context prompting learning mechanism for zero-shot personalized dialogues. Our framework is conceptually simple and practically effective, which can freely customize the pre-set personas of the chatbot. In addition, we train a new persona-augmented pre-trained
generative dialogue model with the data merging the personal information of the dialogue speakers to enhance the in-context learning ability. Experiments demonstrate that our model can dramatically improve the persona consistency from 45% to 85% of dialogues while maintaining coherence and informativeness in the zero-shot setting. In the future, we will apply our zero-shot framework to problems related to common sense knowledge reasoning of personas.

heading: 7 Ethical Considerations
text: We are sure that PDP has been collected in a manner that is consistent with the terms of use of any sources and the intellectual property and privacy rights of the original authors of the texts. Meanwhile, our project is approved by an IRB. Finally, we also provide details on the characteristics of PDP and steps taken to ensure the potential problems with the quality of the dataset do not create additional risks.

heading: 8 Limitations
text: The biggest limitation of our framework is that persona prompting increases the input length of the model, increasing inference time. Through the analysis of real online user logs, the inference time will be 1.82 times that of the original. In the future, we will optimize the inference performance by compressing the length of the prompting part.

heading: A Prompt Templates
text: The design of the prompt template is very important. Our prompt templates are shown in Table 3. We concatenate these dialogues and place them in front of the dialogue context.

heading: B Pre-trained Model
text: The model is shown in Figure 2. The input consists user profile, bot profile, context and response. The input embeddings is the sum of the token embeddings, the position embeddings, the type embeddings and the role embeddings. Different participants have the corresponding roles.
We describe the details of different type token: (1) Token: we use the same token segmentation and the same vocabulary as PLATO-2(Bao et al.,
2020), and it contains 30K BPE tokens; (2) Position: the position encoding starts from the response, and then the position encoding starts from the context in reverse order. The range of the response is 0-127, and the encoding range of the other part is 128-1023. This encoding makes learning more robust for different sequences; (3) Type: context, response, and profile are set as 0, 1, and 2 for encoding, respectively; (4) Role: user profile and bot profile are set according to the roles of the participants. We exploit a similar method as proposed in (Bao et al., 2021b). The target response and utterances in the context by the same user will be assigned the role 0, and the rest will be assigned 1.
The layers of transformer model are set to L = 32, the attention heads are set to H = 32, the embedding dimension is D = 2048, and the maximal position length is set to 1024. We optimize all models using Adam(Kingma and Ba, 2015) with batch size of B = 524, 288 and learning rate of lr = 5e − 4. We conduct all experiments on 32 NVIDIA A100 40GB GPUs in mixed precision. It takes about 20 days to accomplish the training process of our pre-trained model.

heading: C Persona QA TestSet
text: For the confidence of the results, we carefully set the dimension and quantity of the persona of the evaluation data. We have specifically designed different questions for each persona dimension. This is similar to an attack test, which can effectively measure the dialogue model’s ability to maintain the persona’s consistency. The types of questions are shown in Table 4. We enriched multiple test cases in each question type. Moreover, we also tested the impact of the number of test cases on the final results. For more confidence in the results, our final test set contains 24 cases for each question type, as shown in Table 5.
During the experiment, in order to verify the customizability of the model on the chatbot persona, we set up multiple groups of different chatbot personas. We report in Table 6. The accuracy of persona QA is 0.98, 0.92, and 0.96.

heading: D Case Study
text: To intuitively show the customized bot’s personas ability of our method, we provided some generated cases in Figure 3. It demonstrates that the prompt-
ing technique based on our new pre-trained model is an effective method for persona dialog in the zero-shoting.
ACL 2023 Responsible NLP Checklist

heading: A For every submission:

heading: 3 A1. Did you describe the limitations of your work?
text: Section 8

heading: 3 A2. Did you discuss any potential risks of your work?
text: Section 8

heading: 3 A3. Do the abstract and introduction summarize the paper’s main claims?
text: Section 1
7 A4. Have you used AI writing assistants when working on this paper? Left blank.
B 7 Did you use or create scientific artifacts? Left blank.
7 B1. Did you cite the creators of artifacts you used? Left blank.
7 B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Left blank.
7 B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Left blank.
7 B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Left blank.
7 B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Left blank.
3 B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Section 5.2
C 7 Did you run computational experiments? Left blank.

heading: 3 C1. Did you report the number of parameters in the models used, the total computational budget
text: (e.g., GPU hours), and computing infrastructure used? Appendix B
The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance.

heading: 3 C2. Did you discuss the experimental setup, including hyperparameter search and best-found
text: hyperparameter values? Appendix B

heading: 3 C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary
text: statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Section 5
7 C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Left blank.
D 3 Did you use human annotators (e.g., crowdworkers) or research with human participants? Section 4

heading: 3 D1. Did you report the full text of instructions given to participants, including e.g., screenshots,
text: disclaimers of any risks to participants or annotators, etc.? Section 4
7 D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants’ demographic (e.g., country of residence)? Left blank.
7 D3. Did you discuss whether and how consent was obtained from people whose data you’re using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? Left blank.

heading: 3 D4. Was the data collection protocol approved (or determined exempt) by an ethics review board?
text: Section 7
7 D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? Left blank.

heading: Future Work
text: In the future, we will optimize the inference performance by compressing the length of the prompting part