Psychologically-Aware Retrieval-Augmented Generation for Coherent Role-Playing in LLMs
摘要
Endowing Large Language Models (LLMs) with proficient role-playing capabilities has been widely studied due to the wide range of applications, including virtual assistants, digital companions, interactive storytelling, and so on. Existing approaches to enhancing role-playing capabilities in LLMs primarily fall into two categories: fine-tuning with character-specific datasets and in-context learning. While fine-tuning achieves strong role consistency, it lacks flexibility and generalization across diverse characters. In contrast, in-context learning—based on static prompts or retrieval-augmented generation (RAG) often focuses on semantic similarity but fails to capture the deeper psychological dimensions essential for authentic and coherent role-playing. To address this, we propose Self-Determination Theory based Retrieval Augmented Generation (SDT-RAG), a novel framework that integrates multi-dimensional psychological analysis into the retrieval and response generation process. Inspired by Self-Determination Theory (SDT), we design an SDT-based encoder module that models motivation, intrinsic requirement, and emotion, alongside a multi-perspective retrieval module and a fusion module, creating a unified framework that enhances role-related content selection beyond semantic relevance. Extensive experiments on CharacterEval and INCHARACTER benchmarks demonstrate that SDT-RAG significantly outperforms previous state-of-the-art methods across multiple dimensions, including conversational ability, role-playing attractiveness, character consistency, and MBTI.