R ole C raft- GLM : Advancing Personalized Role-Playing in Large Language Models (2024)

Abstract: This study presents RoleCraft-GLM, an innovative framework aimed at enhancing personalized role-playing with Large Language Models (LLMs). RoleCraft-GLM addresses the key issue of lacking personalized interactions in conversational AI, and offers a solution with detailed and emotionally nuanced character portrayals. We contribute a unique conversational dataset that shifts from conventional celebrity-centric characters to diverse, non-celebrity personas, thus enhancing the realism and complexity of language modeling interactions. Additionally, our approach includes meticulous character development, ensuring dialogues are both realistic and emotionally resonant. The effectiveness of RoleCraft-GLM is validated through various case studies, highlighting its versatility and skill in different scenarios. Our framework excels in generating dialogues that accurately reflect characters’ personality traits and emotions, thereby boosting user engagement. In conclusion, RoleCraft-GLM marks a significant leap in personalized AI interactions, and paves the way for more authentic and immersive AI-assisted role-playing experiences by enabling more nuanced and emotionally rich dialogues.

## introduction large language models (llms) have become a cornerstone in understanding and generating natural language, showcasing remarkable capabilities that often surpass human proficiency in certain language reasoning tasks. consequently, they have excelled notably excelled as conversational agents, offering high-level responses in various dialogues and significantly influencing human-ai interactions, thus hinting at their potential to reshape numerous aspects of daily life @xcite . despite these advancements in generative ai @xcite ,challenges persist, particularly in meeting the diverse requirements of different user groups.presently, many ai systems rely on generic models, which may not adequately address the specific needs of varied users. this limitation can negatively influence user experiences and the applicability of ai in certain scenarios @xcite . thus, there is a burgeoning recognition of the importance of personalization within ai, gradually influencing the direction of the field. there is a growing trend toward developing ai systems that are more attuned to individual preferences and needs @xcite , emphasizing the need for a deeper understanding of user behaviors and a more tailored approach to ai interactions. this evolving trend suggests a move toward more personalized, user-centric ai models, potentially transforming the generative ai sector to offer more individualized and effective solutions. existing open-source llms, while trained across broad domains, may not always offer the specialized optimization desired for nuanced roleplaying tasks. this suggests that additional customization might be beneficial to more effectively meet the specific requirements of role-playing scenarios. on the other hand, advanced llms such as @xcite showcase enhanced abilities in role-playing due to their extensive training and sophisticated algorithms. however, this closed-source model may introduce practical limitations. these include higher costs associated with api usage, limited scope for fine-tuning to tailor the models for specific role-playing contexts, and restrictions in context window sizes which can impact the fluidity and depth of generated dialogues in complex role-playing scenarios. in this paper, as illustrated in the figure 1, we introduce the rolecraft-glm framework designed to enhance personalized role-playing experiences with llms. moving beyond traditional celebrityfocused characters, we focus on diverse, noncelebrity personas, each with unique emotional annotations. this approach aims to enrich realism and emotional depth in language interactions. we compiled a novel dataset encompassing a wide array of real-world dialogues, with careful consideration for personal privacy and copyright laws. our data analysis highlights the potential benefits of integrating emotional labels in dialogue datasets for improved natural language processing. we conducted comparative experiments using models like chatglm3, fine-tuned with the low-rank adaptation (lora) method, to assess rolecraft-glm's effectiveness in producing nuanced and characterconsistent dialogues. the main contributions of our work are as follows: ## methodology as shown in figure 1 , the rolecraft-glm framework, rooted in 'role' and 'craft', represents our approach to enhancing ai role-playing. 'role' em- name ：唐鹏 | tang peng age ：30 years old height ：180cm weight ：72kg birthday ：10月7日 | october 7 horoscope ：天秤座 | libra character traits ：冷静、理性、坚持正义，同时具备强烈 的好奇心… |calm, rational and insistent on justice, he also possesses a strong sense of curiosity… background ：唐鹏出生在一个普通的家庭，从小就对法律 和正义充满了他在警校受过良好的训练，成为一名优秀的 警察…|born into an ordinary family, tang peng grew up with an interest in law and justice... hobbies ：跑步、阅读侦探小说、拳击 |running, reading detective novels, boxing specialties ：侦查、武术、心理分析 |detection, martial arts, psychoanalysis dream ：成为一名刑侦专家，揭露和解决更多复杂的案件 |become a criminal investigation expert to uncover and solve more complex cases relationships ：唐鹏与他的同事和上司关系良好，虽然有 时会因为方法和原则上的分歧而产生摩擦。他对家人非常 关心… |tang peng has a good relationship with his coworkers … favorite foods ：家常菜、烧烤、面食 |home cooking, grilling, pasta dislikes ：过于甜腻的食物 |overly sweet and fatty foods… you are a character building expert and your task is to create a detailed character description based on the provided character description template and a series of dialog pairs with emotion markup. please use the information and emotional annotations from the dialog to enrich your role description with consistency and depth. ## conclusions in this paper, we present rolecraft-glm, our innovative framework aimed at enhancing personalized role-playing experiences. central to this framework is a unique dataset featuring 20 diverse, non-celebrity chinese characters, each with distinct emotional annotations. this shift from traditional celebrity-focused characters to more authentic, everyday personas marks a significant advancement in language modeling. rolecraft-glm's dataset emphasizes real-life scenarios and emotional depth, setting new standards in natural language processing. our evaluations demonstrate that rolecraft-glm excels in creating dialogues that are not only contextually rich but also emotionally nuanced, outperforming conventional models. in the future, we hope to to develop behavioral agents that excel in personalization and interactivity, skillfully tailored to individual user preferences, thereby elevating the level of user engagement.