H-RPA: A Unified Framework for Hallucination-Reasoning Role-Playing Agent

(* indicates equal contribution, † means corresponding author)
1Tsinghua Shenzhen International Graduate School, Tsinghua University
2University of Arizona

We propose H-RPA, a unified framework that integrates Chain-of-Thought reasoning to mitigate hallucinations in role-playing agents, structured into a coherent three-stage architecture: perception, planning, and action.

Abstract

Role-playing with large language models (LLMs) have gained significant attention due to their potential in simulation, and dialogue systems. However, existing methods primarily rely on single-stage fine-tuning or retrieval-augmented generation, which over-depends on the model's one-stage output capability and dataset quality, lacking systematic reasoning to address hallucination issues caused by complex character scenarios (e.g., temporal inconsistencies or factual errors). To address these issues, we propose an agent framework, H-RPA (Hallucination-Reasoning Role-Playing Agent), which integrates Chain-of-Thought (CoT) reasoning to mitigate hallucinations and structures the role-playing process into a coherent three-stage model architecture: perception, planning, and action. Specifically, in the perception stage, the agent retrieves character-related knowledge via a RAG module to form a reasoning foundation. In the reasoning stage, Role-Aware CoT process analyzes entities, events, and their spatiotemporal relationships, ensuring both optimal knowledge use and logical consistency. Finally, in the action stage, the agent generates responses that reflect the character's tone and style. Experimental results show that our framework outperforms existing methods on the role-playing benchmark dataset, offering a unified solution for controlled character generation.

Framework Overview

H-RPA Framework Overview

Overview of our Hallucination-Reasoning Role-Playing Agent (H-RPA) Framework. H-RPA consists of three stages: Perception, Reasoning, and Action. The upper part illustrates the typical workflow of existing role-playing agents, which often lack explicit hallucination mitigation.

Case Study

Role-Aware CoT reasoning process

Role-Aware CoT reasoning process in H-RPA. The left panel illustrates the workflow of H-RPA: it receives an instruction and user query, retrieves relevant role knowledge. The core Role-Aware CoT reasoning performs four steps: Question Restatement, Entity Confirmation, Logical Reasoning, and Answer Analysis. Finally, text style transfer tailors the response to the character's unique style.