Abstract: Large Language Models (LLMs) have found extensive use across different applications due to its diverse capabilities and proficiency in executing instructions. In the case of chatbots, they are frequently required to show empathy when used in the context of emotional support. However, to date their performance is still not satisfactory due to the lack of deep understanding of user related issues. Hence, we introduce the Empathizing Before Generation (EBG), a two-step learning framework that allows LLMs to analyze the chain of thought (COT) prior to generating a response. This model also enables the inference of the 24 emotions conveyed in the user’s text as well as facilitates the generation of empathetic, high-quality and appropriate responses. We create a COT version of the dataset for sentiment inference by utilizing a publicly accessible sentiment dialogue. This dataset is then used as support for the training of two layers of EBG. Experiments indicate that models integrated with the EBG outperform other models in demonstrating empathy, with 98.2% and 92.8% accuracy in emotional attributes and labels respectively. Additionally, there is a notable enhancement in the model’s capacity to comprehend COT instructions, infer emotions, and generate answers that are more satisfactory than other models.
Loading