CharacterGLM: Customizing Social Characters with Large Language Models

Jinfeng Zhou, Zhuang Chen, Dazhen Wan, Bosi Wen, Yi Song, Jifan Yu, Yongkang Huang, Pei Ke, Guanqun Bi, Libiao Peng, Jiaming Yang, Xiyao Xiao, Sahand Sabour, Xiaohan Zhang, Wenjing Hou, Yijia Zhang, Yuxiao Dong, Hongning Wang, Jie Tang, Minlie Huang

Abstract

CharacterGLM is a family of large language models (6B to 66B) designed for creating customizable, socially consistent AI characters. By integrating inherent social profiles with dynamic social behaviors through a multi-stage training pipeline and the diverse CharacterDial dataset, CharacterGLM achieves performance comparable to GPT-4 while maintaining superior character consistency over extended conversations.

Introduction

Building AI characters that maintain a specific persona throughout a conversation is a significant challenge in natural language processing. While "tuning-free" methods—prompting generic LLMs with character descriptions—have gained popularity, they often suffer from poor generalizability and "character drift," where the model reverts to a generic assistant persona over time. CharacterGLM addresses these issues by treating characterization as an integration of inherent social profiles and external social behaviors.

Methodology

The development of CharacterGLM follows a sophisticated multi-stage pipeline designed to embed social traits directly into the model's parameters.

Social Trait Framework

Characters are defined through two lenses:

  1. Inherent Profiles: Static attributes (age, interests) and personality styles.
  2. External Behaviors: Dynamic traits such as consistency, human-likeness, and engagement.

Training Pipeline

Using ChatGLM2 as a backbone, the researchers implemented several key strategies:

  • Supervised Fine-Tuning (SFT): Training on the CharacterDial corpus.
  • Character Prompt Augmentation: Using LLMs to generate diverse descriptions (summarization, paraphrasing) to improve model flexibility.
  • Self-Refinement and DPO: Iterative human-in-the-loop feedback and Direct Preference Optimization to align the model with human social expectations.
The implementation pipeline of CharacterGLM, illustrating the flow from data collection to model refinement.

The CharacterDial Dataset

The core of CharacterGLM's success is the CharacterDial corpus. This large-scale Chinese dataset includes 1,930 characters and over 4,200 dialogues. Unlike previous datasets that focused primarily on fictional tropes, CharacterDial includes historical figures and "daily life" personas, providing a much broader range of social interactions. This diversity ensures the model can handle a wide variety of social contexts beyond common fictional archetypes.

Results and Discussion

Human evaluations indicate that CharacterGLM-66B is a top-tier role-playing model, achieving an overall score of 4.21/5.0, surpassing GPT-4 (4.15) and GPT-3.5 (3.49). It particularly excels in human-likeness and engagement, making it ideal for companionship scenarios.

Long-Turn Consistency

A key finding is the model's ability to resist character drift. While many models perform well in short interactions (1-5 turns), their performance often degrades as the conversation continues. CharacterGLM maintains a significant advantage in character consistency even after 11+ turns, where generic models typically revert to assistant-like behavior.

Win-lose rate advantages over time, showing CharacterGLM's sustained performance compared to baselines as dialogue length increases.

Conclusion

CharacterGLM demonstrates that high-quality, manually curated data combined with a social-trait-focused training pipeline can produce AI characters with high social intelligence and consistency. While the manual construction of such datasets is labor-intensive, the resulting improvements in long-term character stability represent a significant step forward for character-based dialogue systems.

Summary updated

BibTeX
@inproceedings{zhou2024characterglm,
  author = {Jinfeng Zhou and Zhuang Chen and Dazhen Wan and Bosi Wen and Yi Song and Jifan Yu and Yongkang Huang and Pei Ke and Guanqun Bi and Libiao Peng and Jiaming Yang and Xiyao Xiao and Sahand Sabour and Xiaohan Zhang and Wenjing Hou and Yijia Zhang and Yuxiao Dong and Hongning Wang and Jie Tang and Minlie Huang},
  title = {{CharacterGLM: Customizing Social Characters with Large Language Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-industry.107},
}
Figure