Table of Contents
Fetching ...

PsyMem: Fine-grained psychological alignment and Explicit Memory Control for Advanced Role-Playing LLMs

Xilong Cheng, Yunxiao Qin, Yuting Tan, Zhengnan Li, Ye Wang, Hongjiang Xiao, Yuan Zhang

TL;DR

The paper addresses the reliability gaps in LLM-based role-playing by enhancing both character attribute control and memory management. It introduces PsyMem, a framework that combines fine-grained psychological attributes with explicit memory alignment, supported by a graph-structured memory and a large novel-derived dataset. Through a two-stage, memory-aware training regimen and synthetic role-playing data, PsyMem-Qwen achieves state-of-the-art fidelity and human-likeness on role-playing tasks, outperforming strong baselines. The work advances trustworthy social simulation and human–AI interaction by enabling consistent, memory-grounded character portrayal in LLMs.

Abstract

Existing LLM-based role-playing methods often rely on superficial textual descriptions or simplistic metrics, inadequately modeling both intrinsic and extrinsic character dimensions. Additionally, they typically simulate character memory with implicit model knowledge or basic retrieval augment generation without explicit memory alignment, compromising memory consistency. The two issues weaken reliability of role-playing LLMs in several applications, such as trustworthy social simulation. To address these limitations, we propose PsyMem, a novel framework integrating fine-grained psychological attributes and explicit memory control for role-playing. PsyMem supplements textual descriptions with 26 psychological indicators to detailed model character. Additionally, PsyMem implements memory alignment training, explicitly trains the model to align character's response with memory, thereby enabling dynamic memory-controlled responding during inference. By training Qwen2.5-7B-Instruct on our specially designed dataset (including 5,414 characters and 38,962 dialogues extracted from novels), the resulting model, termed as PsyMem-Qwen, outperforms baseline models in role-playing, achieving the best performance in human-likeness and character fidelity.

PsyMem: Fine-grained psychological alignment and Explicit Memory Control for Advanced Role-Playing LLMs

TL;DR

The paper addresses the reliability gaps in LLM-based role-playing by enhancing both character attribute control and memory management. It introduces PsyMem, a framework that combines fine-grained psychological attributes with explicit memory alignment, supported by a graph-structured memory and a large novel-derived dataset. Through a two-stage, memory-aware training regimen and synthetic role-playing data, PsyMem-Qwen achieves state-of-the-art fidelity and human-likeness on role-playing tasks, outperforming strong baselines. The work advances trustworthy social simulation and human–AI interaction by enabling consistent, memory-grounded character portrayal in LLMs.

Abstract

Existing LLM-based role-playing methods often rely on superficial textual descriptions or simplistic metrics, inadequately modeling both intrinsic and extrinsic character dimensions. Additionally, they typically simulate character memory with implicit model knowledge or basic retrieval augment generation without explicit memory alignment, compromising memory consistency. The two issues weaken reliability of role-playing LLMs in several applications, such as trustworthy social simulation. To address these limitations, we propose PsyMem, a novel framework integrating fine-grained psychological attributes and explicit memory control for role-playing. PsyMem supplements textual descriptions with 26 psychological indicators to detailed model character. Additionally, PsyMem implements memory alignment training, explicitly trains the model to align character's response with memory, thereby enabling dynamic memory-controlled responding during inference. By training Qwen2.5-7B-Instruct on our specially designed dataset (including 5,414 characters and 38,962 dialogues extracted from novels), the resulting model, termed as PsyMem-Qwen, outperforms baseline models in role-playing, achieving the best performance in human-likeness and character fidelity.
Paper Structure (35 sections, 7 equations, 5 figures, 8 tables)

This paper contains 35 sections, 7 equations, 5 figures, 8 tables.

Figures (5)

  • Figure 1: The performance comparison is conducted on two subsets: “Ordinary,” consisting of 20 randomly selected characters from our test set, and “Famous,” consisting of 20 well-known characters. The average attribute scores are calculated as the mean of the quantized scores across the 20 characters in each subset.
  • Figure 2: The genre distribution in the dataset.
  • Figure 3: (a): The fine-grained character attributes designed in this work. (b): The two stages training of role-playing LLM. First, the model learns basic role-playing without character memory. In the second stage, we dynamically retrieves memory relevant to the current query and dialogue context from graph-structured character memory. We then integrate character profile, retrieved memories, dialogue history, and current input to enhance role-playing precision, training the model to align responses with both fine-grained character profile and contextual memory. (c):We assess the role-playing LLM by first generating a multi-turn dialogue (up to 15 turns) between two designated roles, followed by three rounds of scoring with GPT-4o based on a quantitative rubric, and report the mean score.
  • Figure 4: Comparing Original and Synthetic Role-Playing data ($\text{D}_{\text{RP}} ^{\text{synth}}$). PD: Performance by Dataset Size.
  • Figure 5: Ablation study of each dimensions. Per.: Personality, Val.: Values, SL$^{*}$: Social & Leadership, BD$^{*}$: Behavioral Decision, Mem.: Memory.