C haracter GLM : Customizing Social Characters with Large Language Models (2024)

Abstract: Character-based dialogue (CharacterDial) has become essential in the industry (e.g., Character.AI), enabling users to freely customize social characters for social interactions. However, the generalizability and adaptability across various conversational scenarios inherent in customizing social characters still lack public industrial solutions. To address these challenges, by dissecting well-rounded social characters composed of both inherent social profiles and external social behaviors, we manually collect a large-scale Chinese corpus featuring characters with diverse categories and behaviors, and develop CharacterGLM models alongside well-designed refinement methods. Extensive experiments show that CharacterGLM outperforms most popular open- and closed-source LLMs and performs comparably to GPT-4. We will release our data and models for local development and deployment.

## introduction character-based dialogue systems (characterdial), e.g., character.ai and replika, have emerged as crucial applications in the industry, transforming the way for social interactions. according to simi-larweb, character.ai boasts over one million daily active users and attracts hundreds of millions of visits each month. these platforms are built upon large language models (llms) @xcite to facilitate social dialogue through roleplaying and customizing interactions to meet various social needs. this customization allows users to engage with ai in a more personal, emotionally supportive manner, addressing a range of scenarios from casual chit-chatting to deeper emotional companionship @xcite . however, despite their crucial impact, there remains a gap in the industry for a publicly available characterdial solution. to develop such a system, several challenges need to be addressed. the first challenge is the generalizability of social characters across diverse scenarios. the industrial character customization requires robustness on characters from various domains. however, in characterdial, existing work builds training corpora only via llm synthesis or extracting from literature resources @xcite @xcite , with a narrow range of character categories @xcite ( the second challenge is the adaptability of social characters in evolving conversations. a wellrounded social character displayed in social interaction often integrates its inherent social profile and external social behaviors @xcite . the former sets the individual information that the character grounds during interactions. the latter reflects the character's real-time responses in evolving conversations, e.g., emotional transition @xcite and relationship dynamics @xcite , presenting the character's adaptability in response to multi-turn conversations. the longer the turn, the more diverse the social behaviors that may emerge. however, in charac-terdial, a naive way uses tuning-free llms, which are prompted to play characters upon given profiles. empirically, this way relies only on static profiles and could struggle in the later stages of the multi-turn conversations, as shown in figure 2 . to address these challenges, we develop char-acterglm, an open llm family that aligns social characters with social traits to facilitate generalizable and adaptable social character customization. inspired by interpersonal interaction theory @xcite , social traits can be defined as the combination of inherent social profile and external social behaviors, which create a well-rounded character in social interactions. the inherent social profile is the grounding of conversational expression, comprising attributes (e.g., identity) and styles (e.g., personality) @xcite . external social behaviors are characterized by the character's consistency with the profile, human-likeness, and engagement, which shape the evolving conversations. these two aspects of social traits guide our data construction, model development and evaluation, ensuring a comprehensive framework for character realization. specifically, firstly, to ensure generalizability, we design four approaches ( ## related work character-based dialogue (characterdial) aims to enable users to freely customize social characters, driving engaging social interactions through integrating their inherent social profiles and external social behaviors @xcite . there are currently two solutions for characterdial. one is a tuning-free method that prompts general-purpose llms @xcite to follow given profiles to play specific characters @xcite . relying only on static profiles, it may fail to maintain superiority in multi-turn conversations, thus leading to poor adaptability. another is a tuning-based method to train llms upon characterdial corpora. one existing way to collect corpora is synthesis via llms @xcite , where the characters' social behaviors often show a single machine pattern and qa format @xcite @xcite , deviating from the natural social dialogue. another scheme is the extraction from literary resources @xcite , covering a narrow range of character categories @xcite . the resulting short dialogues @xcite often lack specific story context, and contain complex multi-party conversations and non-verbal cues, thus diminishing the data quality. the limited corpus quality and character categories result in the low generalizability of trained llms on characters from various domains. ## social traits of social characters to thoroughly replicate human social interactions and present well-rounded characters, we dissect the characters into the integration of social traits: inherent social profile and external social behaviors. ## experiments we use 9 llms proficient in chinese as baselines (app. d.1), and our model is trained on chatglm2 @xcite . due to the low correlation between automatic evaluations and user studies (app. c), we hire user volunteers for manual evaluations to ensure that our results more accurately reflect the actual user experience in real-world applications. the models' names are anonymized during evaluation. more experiments are in app. d. ## conclusions in this paper, we focus on the generalizability and adaptability inherent in customizing social characters for industrial applications. by dissecting the inherent social profile and external social behaviors of social characters in social interactions, we manually collect large-scale chinese corpus covering characters with diverse scenarios and behaviors and develop characterglm models with well-designed refinement methods. extensive manual evaluations show the superiority of characterglm against popular open-and closed-source llms. our work can advance the industrial process of characterdial. we believe human-like and engaging social characters can greatly benefit social good applications.