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.
Jiahao Zhu and Zijian Jiang—Contributed Equally
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Achiam, J., Adler, S., Agarwal, S., Ahmad, L., Akkaya, I., Aleman, F.L., Almeida, D., Altenschmidt, J., Altman, S., Anadkat, S., et al.: Gpt-4 technical report. arXiv preprint arXiv:2303.08774 (2023)
Brown, T.B., Mann, B., Ryder, N., Subbiah, M., Amodei, D.: Language models are few-shot learners (2020)
Chiang, W.L., Li, Z., Lin, Z., Sheng, Y., Wu, Z., Zhang, H., Zheng, L., Zhuang, S., Zhuang, Y., Gonzalez, J.E., Stoica, I., Xing, E.P.: Vicuna: An open-source chatbot impressing gpt-4 with 90%* chatgpt quality (March 2023). https://lmsys.org/blog/2023-03-30-vicuna/
Cui, J., Li, Z., Yan, Y., Chen, B., Yuan, L.: Chatlaw: Open-source legal large language model with integrated external knowledge bases. arXiv preprint arXiv:2306.16092 (2023)
Du, Z., Qian, Y., Liu, X., Ding, M., Qiu, J., Yang, Z., Tang, J.: Glm: General language model pretraining with autoregressive blank infilling. arXiv preprint arXiv:2103.10360 (2021)
Fu, C., Chen, P., Shen, Y., Qin, Y., Zhang, M., Lin, X., Yang, J., Zheng, X., Li, K., Sun, X., Wu, Y., Ji, R.: Mme: A comprehensive evaluation benchmark for multimodal large language models. arXiv preprint arXiv:2306.13394 (2023)
Fu, C., Zhang, R., Wang, Z., Huang, Y., Zhang, Z., Qiu, L., Ye, G., Shen, Y., Zhang, M., Chen, P., Zhao, S., Lin, S., Jiang, D., Yin, D., Gao, P., Li, K., Li, H., Sun, X.: A challenger to gpt-4v? Early explorations of gemini in visual expertise. arXiv preprint arXiv:2312.12436 (2023)
Kang, D., Kim, S., Kwon, T., Moon, S., Cho, H., Yu, Y., Lee, D., Yeo, J.: Can large language models be good emotional supporter? Mitigating preference bias on emotional support conversation. ArXiv abs/2402.13211 (2024). https://api.semanticscholar.org/CorpusID:267759569
Lei, S., Dong, G., Wang, X., Wang, K., Wang, S.: Instructerc: Reforming emotion recognition in conversation with a retrieval multi-task llms framework. ArXiv abs/2309.11911 (2023). https://api.semanticscholar.org/CorpusID:262084263
Li, Z., Chen, G., Shao, R., Jiang, D., Nie, L.: Enhancing the emotional generation capability of large language models via emotional chain-of-thought. arXiv preprint arXiv:2401.06836 (2024)
Liu, J.M., Li, D., Cao, H., Ren, T., Liao, Z., Wu, J.: Chatcounselor: A large language models for mental health support. arXiv preprint arXiv:2309.15461 (2023)
Radford, A., Narasimhan, K., Salimans, T., Sutskever, I., et al.: Improving language understanding by generative pre-training (2018)
Rashkin, H., Smith, E.M., Li, M., Boureau, Y.L.: Towards empathetic open-domain conversation models: A new benchmark and dataset. arXiv preprint arXiv:1811.00207 (2018)
Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.A., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., Azhar, F., et al.: Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971 (2023)
Yang, H., Liu, X.Y., Wang, C.D.: Fingpt: Open-source financial large language models. arXiv preprint arXiv:2306.06031 (2023)
Yin, S., Fu, C., Zhao, S., Xu, T., Wang, H., Sui, D., Shen, Y., Li, K., Sun, X., Chen, E.: Woodpecker: Hallucination correction for multimodal large language models. arXiv preprint arXiv:2310.16045 (2023)
Yu, Y., Yang, C.H.H., Kolehmainen, J., Shivakumar, P.G., Gu, Y., Ren, S.R.R., Luo, Q., Gourav, A., Chen, I.F., Liu, Y.C., et al.: Low-rank adaptation of large language model rescoring for parameter-efficient speech recognition. In: 2023 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU), pp. 1–8. IEEE (2023)
Zhang, W., Deng, Y., Liu, B., Pan, S.J., Bing, L.: Sentiment analysis in the era of large language models: A reality check. arXiv preprint arXiv:2305.15005 (2023)
Zhang, Y., Wang, M., Tiwari, P., Li, Q., Wang, B., Qin, J.: Dialoguellm: Context and emotion knowledge-tuned llama models for emotion recognition in conversations. arXiv preprint arXiv:2310.11374 (2023)
Zheng, Z., Liao, L., Deng, Y., Nie, L.: Building emotional support chatbots in the era of llms. ArXiv abs/2308.11584 (2023), https://api.semanticscholar.org/CorpusID:261065100
Zhu, W., Wang, X.: Chatmed: A chinese medical large language model. https://github.com/michael-wzhu/ChatMed (2023)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2025 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Zhu, J., Jiang, Z., Zhou, B., Su, J., Zhang, J., Li, Z. (2025). Empathizing Before Generation: A Double-Layered Framework for Emotional Support LLM. In: Lin, Z., et al. Pattern Recognition and Computer Vision. PRCV 2024. Lecture Notes in Computer Science, vol 15032. Springer, Singapore. https://doi.org/10.1007/978-981-97-8490-5_35
Download citation
DOI: https://doi.org/10.1007/978-981-97-8490-5_35
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-97-8489-9
Online ISBN: 978-981-97-8490-5
eBook Packages: Computer ScienceComputer Science (R0)