R ef GPT : Dialogue Generation of GPT , by GPT , and for GPT (2023)

Abstract: Large Language Models (LLMs) have attained the impressive capability to resolve a wide range of NLP tasks by fine-tuning high-quality instruction data. However, collecting human-written data of high quality, especially multi-turn dialogues, is expensive and unattainable for most people. Though previous studies have used powerful LLMs to generate the dialogues automatically, they all suffer from generating untruthful dialogues because of the model hallucination. Therefore, we propose a method called RefGPT to generate enormous truthful and customized dialogues without worrying about factual errors caused by the model hallucination. RefGPT solves the model hallucination in dialogue generation by restricting the LLMs to leverage the given reference instead of reciting their own knowledge to generate dialogues. Additionally, RefGPT adds detailed controls on every utterance to enable high customization capability, which previous studies have ignored. On the basis of RefGPT, we also propose two high-quality dialogue datasets generated by GPT-4, namely **RefGPT-Fact** and **RefGPT-Code**. RefGPT-Fact is a dataset with 100k multi-turn dialogues based on factual knowledge and RefGPT-Code has 76k multi-turn dialogues covering a wide range of coding scenarios. Our code and datasets are released in https://github.com/mutonix/RefGPT.

## introduction general chat models @xcite @xcite based on large language models (llms) have shown the impressive capability to intention recognition and complete a variety of nlp tasks only via fine-tuning with a small amount of high-quality instruction data @xcite @xcite . however, such high-quality instruction datasets, especially multi-turn dialogues with instructions in vertical domains, requires enormous crowdsource workers with extensive professional knowledge to collect @xcite , where the cost is unaffordable for most people. previous studies @xcite @xcite have shown the effectiveness of prompting llms like @xcite to generate enormous instructions (singleturn dialogues) or multi-turn dialogues with given human-written instructions or conversation topics as seeds. however, such one-shot or few-shot methods have a common deficiency that they have the risk of generating untruthful and misleading content due to the language model hallucination @xcite . the reason why the issue of untruthfulness happens is obvious. this is because the quantity of information in seed prompts like human-written instructions or topics is not enough for being converted to the dialogue on a new topic so llms have to recite their own knowledge to complete such a new dialogue which may lead to the model hallucination of generating untruthful facts. therefore, we introduce refgpt, a method for generating truthful and customized multi-turn dialogues utilizing the ability of powerful llms like gpt-3.5/gpt-4. refgpt first provides a plain text or a document as the reference and guides the llms to leverage the references to generate dialogues. by providing enough information on a new topic as context, llms will be prompted not to rely on their own knowledge to generate the dialogues, thus resolving the hallucination issue. after ensuring the authenticity of the dialogue, we further develop an effective prompting process for refgpt to guide the llms to generate highly controllable dialogues in a specified uniform format which is easy for training. previous studies @xcite for automatically generating dialogues have very little control over the generated dialogues. for comparison, refgpt enables llms to generate customized multi-turn dialogues with detailed controls on the structure, style, and content, which further gives diversity to the generated dialogues. based on the refgpt, we also propose two new multi-turn dialogue datasets, namely refgpt-fact and refgpt-code. both datasets have english and chinese versions. refgpt-fact and refgpt-code consist of 100k and 76k high-quality multiturn dialogues generated from gpt-4 separately, using the online encyclopedia websites and github repositories as the references. as long as the content on the online encyclopedia website and github codes is truthful and reliable, the authenticity of the generated dialogues can be maximally ensured. besides the topics in refgpt-fact and refgpt-code, refgpt has the potential to generate truthful dialogues on any topics or vertical domains if we give it relevant references. refgpt enables such people working in a specific domain, e.g., the nuclear industry, to have a high-quality multi-turn dialogues dataset to train a chatbot specializing in such domain using their own knowledge base as the reference. to sum up, our contributions are stated as follows: ## conclusion we present refgpt, a new method that generates truthful and customized multi-turn dialogues using llms like gpt-3.5/gpt-4. incorporating a reliable reference, refgpt minimizes hallucination and untruthful content generation. refgpt also allows for dialogue customization in structure, style, and content, making it flexible to generate dialogues with diversity. on the basis of refgpt, we also use gpt-4 to construct two new multi-turn dialogue datasets, refgpt-fact and refgpt-code, based on the online encyclopedia websites and github repositories. these datasets also showcase refgpt's significant potential for developing dependable, domain-specific dialogue data required by specialized chatbots and other natural language processing applications.