Manuscript Offprint
arXiv:2611.01778MemRole: From Memories to Decisions for Long-Horizon Reasoning in Role-Playing Agents
Abstract
LLM-based role-playing agents are fluent at imitating a character's style, yet struggle to make role-consistent decisions over long narrative horizons. Such decisions are shaped by experiences spanning many prior scenes, which are often partial and may point in different directions. Existing methods inject cross-scene memories as context, but do not reason about how past events shape a character's current motivations and behavior. We propose MEM-ROLE, a framework that makes this memory-to-decision process explicit. It introduces Long-Horizon Memory Thinking (LHMT), a reasoning schema that decomposes hidden reasoning into context understanding, memory activation, and response strategy planning, trained on a novel-derived dataset whose character-grounded, timeline-constrained memory pools limit each character to what it could plausibly know at the current narrative point. Beyond supervised fine-tuning, we propose Self-Refining On-Policy Self-Distillation (SR-OPSD): the model critiques its own rollouts against the reference under a data-driven rubric, and a critique-conditioned teacher view of the same model distills token-level guidance back into the policy. MEMROLE-32B improves over its backbone by 15.2 points on memory-grounded role-playing, performs on par with frontier LLMs such as GPT-5.4, and achieves the best character-motivation recognition accuracy on CroSS-MR.
1 Introduction
The recent progress of role-playing agents (RPAs) has benefited substantially from the rapid development of large language models (LLMs), enabling them to emulate a character's speaking style, personality traits, and background knowledge with increasing fluency (Shao et al., 2023; Zhou et al.,
From surface response to memory-grounded reasoning
Scene: Harry cornered by Rita Skeeter with her auto-quill writing exaggerate content.....
Rita Skeeter: Why did you decide to enter the tournament, Harry?

Harry: <think>LHMT reasoning...</think>(looks up reluctantly) I didn't. I don't know how my name got into the Goblet of Fire. I didn't put it in there.
What reasoning supports this response?
LHMT: Three-Stage Memory-Grounded Reasoning
Context Understanding
Harry pressed by Rita's leading question, honesty vs sensationalism.
Memory Activation
Activated: M2, M3 → support denial;
M5 → constrains (keep short, avoid Rita material).
Pattern: complementary → reluctant concise denial.
Response Strategy Planning
State fact, reluctant tone, no details to twist.
Figure 1: Illustration of Long-Horizon Memory Thinking (LHMT), which transforms cross-scene memories into a role-consistent response through three structured stages.
2024; Wang et al., 2025a). Yet fluency is not fidelity. What ultimately distinguishes a character is not how they talk in a single turn, but the decisions they make—and a character's decisions are rarely determined by the immediate context alone (McAdams, 2011; Conway and Pleydell-Pearce, 2000). They are shaped by experiences that span many prior scenes: past humiliations, broken promises, shifting loyalties. A choice that looks abrupt or even shocking in the moment is in fact driven by this long-horizon memory, which renders it coherent and, in hindsight, even inevitable.
We refer to this ability as long-horizon reasoning in role-playing: reasoning over how memories spanning many prior scenes, often partial and not always mutually reinforcing, drive a character's decisions in the present. At consequential moments,
Equal contribution. Corresponding author.
Code, model checkpoints, and datasets will be made publicly available promptly upon acceptance.
such memory shapes not only what a character decides, the externally observable action or stance, but also the motivations and emotions that, though unobservable, are carried into that decision (Pillemer, 2003; Graesser et al., 1994). Yet most existing methods supply cross-scene memory through retrieval-augmented generation, surfacing relevant past snippets as supplementary background to reinforce consistency rather than reasoning about how those events drive the current decision (Wang et al., 2024; Ahn et al., 2024; Cheng et al., 2026; Zhang et al., 2026; Xiao et al., 2026). Approaches that go further still fall short: some tie memory to the immediate turn (Liu et al., 2025), while others, closest to our setting, reduce role-playing to a multiple-choice benchmark that scores a character's choice but leaves the underlying motivations and emotions unexamined (Xu et al., 2025).
Yet fully recovering this implicit long-horizon reasoning from novels is difficult, demanding a thorough understanding of a character's traits, their accumulated memory, and the surrounding situation. The same history of slights and broken promises may settle into silent resentment in one character yet escalate into a decisive, irreversible act in another, and the memories behind such a choice do not always point the same way: they may reinforce one another, cut against one another, or bear on the decision in different respects. Supervised fine-tuning can only imitate a single reference trajectory, and its training signal never lands on the model's own generations, leaving the failure modes specific to its own reasoning unaddressed (Chu et al., 2025). Reinforcement learning offers an alternative, but our setting provides little to reward reliably: open-ended role-play admits no verifiable answer, and an identical surface decision may follow from a weighing of past memories or merely coincide with it.
The key missing supervision is therefore not whether an agent can access memory, but how it should transform memory into a decision. Modeling this transformation requires addressing two challenges at once: first, the model must learn a reasoning schema that explains how accumulated, often conflicting memories shape the character's current motivations, constraints, and behavioral tendencies; second, training must provide supervision over this intermediate reasoning process rather than only judging the final response.
To address these challenges, we propose MEM-ROLE, a two-stage framework that makes the memory-to-decision process explicit and improves it through critique-guided on-policy self-distillation. First, supervised cold-start training teaches Long-Horizon Memory Thinking (LHMT), a three-stage schema of context understanding, memory activation, and response strategy planning (Figure 1) that makes explicit how past memories shape the current decision rather than serving merely as static context. Second, Self-Refining On-Policy Self-Distillation (SR-OPSD) provides adaptive reasoning-level supervision: the model critiques its own on-policy rollouts with a data-driven rubric, and a critique-conditioned teacher view distills token-level guidance back into the student. In this way, MEMROLE supervises the intermediate memory-to-decision process directly, without reducing feedback to a scalar objective over the final response. The reference enters only through the critique, never as an imitation target.
To validate MEMROLE, we construct MEMROLE-DATASET, a decision-centered role-playing dataset built from high-quality novels. We segment each novel into scenes and build, for each major character, a memory pool of prior-scene nodes rewritten from their perspective. Anchored to the scene's position on the narrative timeline, each pool contains only past scenes the character could plausibly know, separating what they know from what they do not. Trained on this data, MEMROLE substantially improves memory-grounded role-playing over strong role-playing baselines while remaining competitive with frontier LLMs.
Our contributions are threefold. (1) We propose MEMROLE, a framework that reasons over long-horizon memories to make role-consistent decisions, combining LHMT with a two-stage training procedure of SFT followed by SR-OPSD. (2) We construct MEMROLE-DATASET, a decision-centered role-playing dataset with character-grounded, timeline-constrained memory pools. (3) Controlled ablations show that every LHMT stage and every component of SR-OPSD contributes, with the largest gains concentrated in memory activation and in the data-driven rubric.
Memory for Role-Playing Agents To sustain consistency across scenes, prior work equips role-playing agents with character memories, typically by retrieving past snippets and injecting them as supplementary context (Wang et al., 2024; Ahn et al., 2024; Cheng et al., 2026; Ji et al., 2026). Existing methods typically treat memory as a flat collection for context injection, rather than a logical basis for reasoning about the character's state. We instead build per-character, timeline-constrained memory pools and train the model to reason explicitly over how these memories shape a character's present decision.
On-Policy Distillation Knowledge distillation transfers capabilities from teacher to student models, and recent on-policy variants supervise the student on its own generated trajectories to mitigate the train-test distribution mismatch (Gu et al., 2024; Agarwal et al., 2024; Song and Zheng, 2026). A closely related line internalizes reasoning through information-asymmetric self-distillation, where one model acts as both student and teacher and the asymmetry arises from differing input contexts rather than parameters (Zhao et al., 2026; He et al., 2026). We adapt this paradigm to long-horizon memory reasoning: rather than exposing reference solutions directly, we condition the teacher view on per-rollout critiques distilled from the reference, yielding fine-grained supervision for memory-guided role-playing decisions.
3 MEMROLE Dataset
3.1 Why the MEMROLE Dataset Is Needed
Long-horizon memory reasoning imposes three requirements on the underlying data, none of which is jointly satisfied by existing role-playing corpora (Table 4). First, memory must be cross-scene and traceable: a character's present decision is driven by events from many prior scenes, so memory cannot be reduced to a static profile (Wang et al., 2024; Lu et al., 2024) or to the local surrounding context (Wang et al., 2025a; Du et al., 2026). Second, scenes must be decision-centered: studying how memory becomes decision requires turns where a character makes consequential, character-driven choices, taking a stance, selecting an action, resolving a value conflict, or reaching a turning point, rather than turns dominated by incidental exchange. Third, memory must respect the character's epistemic boundary: a character can only reason from what it could plausibly know at the current narrative point, a constraint absent from prior datasets that retrieve by surface relevance (Wang et al., 2025a) or align responses with a static character graph (Cheng et al., 2026).
As summarized in Table 4, prior datasets satisfy at most one of these requirements; profile- and attribute-alignment corpora align with static character dimensions rather than reasoning over how past events shape present choices, and decision-oriented benchmarks (Xu et al., 2025) evaluate the final choice while supervising neither memory nor reasoning. Other lines are orthogonal to our goal: large-scale synthetic corpora (He et al., 2025; Yang et al., 2024) prioritize role coverage over traceable narrative memory, while general-domain and multi-agent frameworks (Gao et al., 2025; Xu et al., 2026b) target hallucination control and scene orchestration rather than memory-driven decision-making.
3.2 Data Curation
MEMROLE is constructed from high-quality novels through a multi-stage pipeline (Figure 2, left) that yields scene-focal character instances, each pairing a decision-dense scene with the focal character's profile and a per-character, timeline-anchored memory pool; the training target is the LHMT trace followed by the visible response. We first segment each novel into chapters and scenes and extract structured scene information, dialogue, and character-centric metadata; all interaction turns are extracted from the original text rather than freely generated, preserving narrative authenticity. Two design choices make the resulting instances decision-bearing rather than incidental: decision-density filtering and decision-outcome masking.
Decision-density filtering. To ensure that every instance carries a genuine decision signal, we use
MemRole : From Memories to Decisions for Long-Horizon Reasoning in Role-Playing Agents

Figure 2: Overview of our framework. Left (Data Construction): The pipeline for constructing the MEMROLE dataset, involving chapter-scene segmentation, decision-dense scene filtering, and character-grounded memory pool creation. Middle (Training): A two-stage optimization procedure comprising SFT warm-up on validated reasoning traces and SR-OPSD refinement (bottom), which aligns the model with critique-aware teacher distributions. Right (Evaluation): Simulated role-playing and multi-dimensional evaluation on the MEMROLE Test benchmark.
an LLM to score whether the focal character makes explicit, character-driven decisions in a scene, and retain only samples above a decision-density threshold. This prioritizes scenes with stance-taking, refusals, commitments, and narrative turning points over filler dialogue.
Decision-outcome masking. Role-playing setups commonly place a scene introduction and character motivation in the system prompt, which often already disclose the focal character's eventual choice and the scene's outcome. A model can then reproduce the behavior from the prompt rather than reason toward it. To ensure the response is genuinely inferred rather than recoverable from the prompt, we clean the model-visible context so that it retains only the situational conditions and other characters' triggering behaviors, while removing any content that reveals the focal character's decision, its motivation-as-given, or the resulting outcome.
Additional details on the dataset and its construction pipeline are provided in Appendix A.
3.3 Memory Pool Construction
The memory pool is the core data structure of MEM-ROLE. For each scene-focal character pair, we
construct a dedicated pool of nodes, where each node corresponds to a prior scene that may shape the focal character's current motivations, beliefs, relationships, or behavioral tendencies. Each node is an LLM-generated, character-perspective summary linked to its source scene_id, so that every memory is traceable to the original narrative and reflects what that character experienced rather than an omniscient account.
Candidate scoping. To keep the pool within the character's epistemic boundary, candidate scenes must satisfy two constraints: temporal validity—the scene occurs before the current scene, preventing future-knowledge leakage; and character grounding—the focal character is physically present, not merely mentioned by others. Together these ensure the pool contains only information the character could plausibly know at the current narrative stage.
Memory selection. Within the scoped candidates, we select nodes via a two-step LLM-assisted process: a coarse ranking that produces an initial relevant list, followed by a fine ranking based on pairwise comparisons. To let the pool grow with the candidate set while avoiding inflation, we retain the top- candidates under a dynamic cap:
where is a base size guaranteeing enough memories for small candidate sets and is a sub-linear growth rate that lets the pool expand slowly as candidates accumulate. A sensitivity analysis of the retrieval budget is provided in Appendix E.5.
3.4 Dataset Statistics
MEMROLE comprises 75 novels, 2,000 character profiles, 14,844 scenes, and 181,137 role-playing dialogue turns (Table 5). To prevent narrative leakage, we split at the book level so that all scenes from the same novel fall into the same split. On average, each turn activates 0.721 memories; among turns with activated memories, 65.03% integrate multiple memories whose effects are aligned, opposed, or mixed (Table 7), highlighting the need for multi-memory integration beyond single-event retrieval.
4 Method
4.1 Long-Horizon Memory Thinking
MEMROLE addresses this need with Long-Horizon Memory Thinking (LHMT), a decision-oriented reasoning schema that makes the memory-to-decision process explicit. As shown in Figure 2(left), LHMT decomposes long-horizon memory reasoning into three ordered components: context understanding, memory activation, and response strategy planning, which are written as natural-language paragraphs in an auxiliary <think> block before the visible character response.
Context Understanding. This stage analyzes the character's current state, the interactional demands of the dialogue, and the character-profile information relevant to the current turn, thereby clarifying what the response needs to accomplish.
Memory Activation. This stage determines whether the current turn needs to consult the memory pool. If so, the model selects memories relevant to the current decision and reasons about how they shape the character's motivations, constraints, and behavioral tendencies. When multiple memories are relevant, the model further integrates their aligned, conflicting, or complementary effects to derive a memory-grounded decision tendency for the current turn.
Response Strategy Planning. Given input , where is the dialogue context, the character profile, and the memory pool of character in scene , the model generates , i.e., an LHMT trace followed by the visible response .
4.2 Self-Refining On-Policy Self-Distillation for LHMT
SFT warm-up with synthesized LHMT traces. Since LHMT traces are not available in the original novel corpus, we synthesize them with a generator-validation distillation pipeline (Figure 2, left). For each focal-character turn, a generator LLM produces a candidate LHMT trace grounded in the dialogue context, role prompt, memory pool, and original response , without copying the response into the trace.
A validator LLM filters candidates with a validation checklist covering structural validity, memory grounding, memory-need consistency, and leakage risks. Validated traces are used for supervised warm-up, with further details in Appendix B.
We first perform supervised fine-tuning on a mixture of LHMT-augmented role-playing trajectories and general instruction-tuning data, as detailed in Appendix C.1. For an LHMT-supervised example with input and target output , the objective is the standard next-token negative log-likelihood:
We denote the resulting model as . In SR-OPSD, we initialize the trainable policy from and keep another copy of frozen as the critique model and teacher view. We empirically validate this choice against alternative critique models in Appendix C.5.
Data-driven Rubric Construction. SR-OPSD uses a critique rubric to diagnose weaknesses in the policy's own generations. Rather than manually specifying the rubric, we induce it from the empirical error patterns of the SFT warm-up model (Figure 2, middle). Specifically, we sample rollouts from and compare each rollout with its reference output to collect a weakness corpus .
The weakness corpus is then consolidated through an offline hierarchical summarization process into a global pool of critique dimensions:
where each denotes a recurring weakness dimension. The rubric remains fixed during SR-OPSD training, while the critique model dynamically selects and instantiated the relevant dimensions for each on-policy rollout. Details are provided in Appendix C.7.
Critique-aware Rollout Diagnosis. Let denote the LHMT-supervised training set used for SR-OPSD. In each training iteration, given , the policy first samples an on-policy trajectory:
where is the generated LHMT trace and is the generated role-playing response. The frozen then receives and, guided by , generates a structured critique that identifies the rubric dimensions in which deviates from . Details are provided in Appendix C.8.
Asymmetric Self-Distillation. SR-OPSD performs information-asymmetric self-distillation on the policy model's own rollout (Figure 2, middle). The student view predicts each next token using only the original input and the on-policy prefix :
In contrast, the teacher view uses the same on-policy prefix but additionally conditions on the structured critique as privileged context:
We then minimize the token-level KL divergence on the policy model's own rollout:
At inference time, the model uses only the original input , without access to or the critique model. The complete SR-OPSD training procedure is provided in Appendix C.4.
5 Experiments
5.1 Experimental Setup
Models. We compare MEMROLE with strong commercial LLMs, open-source general LLMs, and role-playing baselines. MEMROLE is fine-tuned from Qwen3-8B and Qwen3-32B (Yang et al., 2025). We use Gemini-3-Pro-Preview as the environment model for generating interactive contexts and as the next-speaker prediction (NSP) model.
Metrics. Following CoSER (Wang et al., 2025a), we use GPT-5.5 to evaluate simulated role-playing conversations across four general role-playing dimensions: Storyline Consistency (SC), Anthropomorphism (AN), Character Fidelity (CF), and Storyline Quality (SQ). To better assess long-horizon memory reasoning, we further introduce two MEMROLE-specific metrics: Memory Activation Quality (MAQ) and Reasoning Consistency (RC) (Figure 2, right). Memory Activation Quality evaluates activation accuracy, activation sufficiency, and usage appropriateness, while Reasoning Consistency evaluates causal consistency, behavioral continuity, and motivational rationality. For LifeChoice and Cross-MR, we report accuracy. Detailed rubrics are provided in Appendix D.
Benchmarks. We evaluate models on four complementary benchmarks. MEMROLE Test evaluates long-horizon memory-grounded role-playing, while CoSER (Wang et al., 2025a) evaluates general role-playing quality in established-character simulations. For MEMROLE Test and CoSER, we evaluate 200 conversations containing 20 interaction turns. Following the evaluation protocol of CoSER (Wang et al., 2025a), we score only the externally observable responses in these open-ended conversations, excluding reasoning traces. To provide complementary and more objective evaluations of character decision-making, we further include two multiple-choice benchmarks. LifeChoice (Xu et al., 2024) evaluates persona-consistent decision-making on 1,000 multiple-choice instances, while CroSS-MR (Yuan et al., 2024) evaluates character-motivation recognition on all 445 instances. Detailed dataset statistics and evaluation rubrics are provided in Appendices A and D, respectively.
| Model | MemRole Test | Life Choice | Cross-MR | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| SC | AN | CF | SQ | MAQ | RC | Avg. | ACC | +motivation | ACC | |
| Claude-4.6-Opus | 75.26 | 63.11 | 69.84 | 73.77 | 72.95 | 80.02 | 72.49 | 85.14 | 98.43 | 65.18 |
| Gemini-3-Pro | 74.33 | 45.98 | 63.57 | 77.22 | 64.53 | 73.86 | 66.58 | 78.77 | 97.41 | 63.54 |
| DeepSeek-v4-Pro | 66.37 | 59.76 | 61.14 | 70.96 | 69.78 | 70.33 | 66.39 | 74.58 | 97.32 | 63.77 |
| GPT-5.4 | 64.76 | 55.28 | 57.95 | 70.78 | 65.89 | 72.01 | 64.45 | 73.69 | 97.35 | 67.12 |
| MemRole-32B | 61.12 | 51.97 | 56.73 | 70.82 | 72.98 | 71.87 | 64.25 | 79.11 | 97.72 | 69.83 |
| Doubao-seed-2.0-Pro | 51.09 | 63.35 | 43.97 | 76.13 | 48.54 | 66.12 | 58.20 | 81.24 | 98.03 | 61.64 |
| Gemini-2.5-Pro | 57.77 | 41.98 | 53.72 | 75.76 | 47.95 | 68.13 | 57.55 | 78.02 | 96.69 | 57.96 |
| Grok-4.2 | 48.04 | 47.66 | 44.89 | 70.43 | 70.88 | 49.96 | 55.31 | 78.82 | 97.79 | 59.33 |
| DeepSeek-v3.2 | 51.73 | 44.03 | 43.59 | 62.21 | 58.49 | 62.36 | 53.74 | 72.84 | 93.57 | 52.12 |
| GLM-5 | 42.34 | 50.27 | 37.15 | 74.48 | 52.26 | 62.38 | 53.15 | 81.46 | 98.47 | 51.05 |
| HER-RL | 55.13 | 45.17 | 42.64 | 62.83 | 53.93 | 57.34 | 52.84 | 76.78 | 93.39 | 45.27 |
| MemRole-8B | 55.75 | 44.31 | 39.97 | 66.84 | 52.98 | 56.66 | 52.75 | 75.17 | 92.53 | 53.69 |
| CoSER-70B | 49.72 | 51.88 | 47.67 | 60.93 | 47.62 | 51.44 | 51.54 | 79.34 | 97.66 | 63.87 |
| Qwen3-32B | 49.36 | 47.91 | 43.62 | 53.11 | 45.93 | 54.38 | 49.05 | 71.68 | 94.74 | 49.61 |
| MiniMax-M2.5 | 45.95 | 48.75 | 31.22 | 48.79 | 41.19 | 56.23 | 45.36 | 73.52 | 94.01 | 53.33 |
| LLaMA-3.1-70B | 39.68 | 40.80 | 39.97 | 59.82 | 44.45 | 41.04 | 44.29 | 79.87 | 95.97 | 61.27 |
| CoSER-8B | 40.56 | 42.87 | 34.76 | 55.51 | 39.77 | 41.17 | 42.44 | 68.11 | 90.82 | 44.92 |
| Qwen3-8B | 41.31 | 40.09 | 37.16 | 51.21 | 42.03 | 42.38 | 42.36 | 69.86 | 88.93 | 41.36 |
| CharacterGLM-6B | 37.74 | 43.12 | 31.75 | 49.01 | 33.86 | 34.75 | 38.37 | 63.37 | 86.14 | 30.12 |
Table 1: Results of different LLMs on MEMROLE Test, Life Choice, and Cross-MR (0–100, higher is better). MEMROLE Test evaluates Storyline Consistency (SC), Anthropomorphism (AN), Character Fidelity (CF), Storyline Quality (SQ), Memory Activation Quality (MAQ), and Reasoning Consistency (RC). Life Choice evaluates persona-consistent decision-making with given motivation, while Cross-MR evaluates character-motivation recognition accuracy.
5.2 Main Results
As shown in Table 1, MEMROLE substantially improves memory-grounded role-playing over its backbone models and prior role-playing baselines. MEMROLE-32B achieves an average score of 64.25 on MEMROLE Test, outperforming Qwen3-32B by 15.20 points and obtaining the highest MAQ score among all evaluated models. MEMROLE-8B also improves over Qwen3-8B by 10.39 points and surpasses both CoSER-8B and CoSER-70B, showing that the gains are not merely due to model scale.
On CoSER, MEMROLE-32B achieves competitive overall performance and the highest Storyline Quality score in our CoSER evaluation; full results are reported in Appendix E.1. On LifeChoice, MEMROLE-32B remains competitive, indicating that the proposed memory-reasoning training preserves general persona-driven decision-making ability. On CroSS-MR, MEMROLE-32B achieves the highest accuracy of 69.83, outperforming Qwen3-32B by 20.22 points.
We further assess evaluation robustness through alternative-judge scoring and pairwise comparisons with randomized response order. Both analyses yield broadly consistent comparative conclusions (Appendices E.2 and E.3).
5.3 Human Evaluation
We recruit 20 evaluators familiar with narrative role-playing to assess anonymized responses from six representative LLMs on 100 randomly selected MEMROLE test samples using a 1–10 scale. As shown in Table 13, MEMROLE-32B achieves the highest human score (7.02) and pairwise win rate (72.3%), outperforming Qwen3-32B, HER-RL, and CoSER-70B. MEMROLE-8B also outperforms Qwen3-8B. We further assess human-automatic alignment on 300 responses and 300 LHMT traces using case-level agreement, Cohen’s , and Spearman’s . The results show strong agreement for both responses (89.4%, , ) and LHMT traces (90.2%, , ). Detailed results are provided in Appendix D.3
5.4 Ablation Study
Effect of LHMT components. We ablate each LHMT component to assess its contribution. As shown in Table 2, removing any component degrades performance. Removing memory activation causes the largest Memory drop (-10.1), highlighting its central role in long-horizon grounding. Removing response strategy planning mainly hurts Dialogue (-5.2), while removing context understanding leads to smaller but consistent drops (-3.2 / - 3.9), suggesting that it provides useful
| Setting | Dialogue | Memory |
|---|---|---|
| MemRole-8B (Full) | 51.7 | 54.8 |
| Effect of LHMT components | ||
| w/o Context Understanding | 48.5 | 50.9 |
| w/o Memory Activation | 48.6 | 44.7 |
| w/o Response Strategy Planning | 46.5 | 52.3 |
| Effect of training stages | ||
| SFT only () | 46.8 | 47.2 |
| Standard OPSD (Zhao et al., 2026) | 48.3 | 48.6 |
| SR-OPSD w/o rubric | 49.4 | 50.8 |
Table 2: Ablation study on the MEMROLE test split using the 8B backbone. Dialogue averages SC, AN, CF, and SQ; Memory averages MAQ and RC. Higher is better.
scaffolding for later reasoning.
Effect of SR-OPSD training. The training-stage ablations show that each part of SR-OPSD contributes to performance. Standard OPSD, which directly conditions the teacher on the full reference, provides modest gains over SFT (+1.5/+1.4). Replacing direct reference conditioning with rollout-specific critiques further improves performance (+1.1/+2.2), and the data-driven rubric yields the final gain (+2.3/+4.0), indicating that rubric-guided critiques provide more targeted supervision for memory-to-decision reasoning.
5.5 Analysis of LHMT Reasoning
We analyze LHMT in terms of schema effectiveness, supervision-trace validity, and the quality of model-generated reasoning traces.
Effectiveness of the LHMT Schema. We evaluate LHMT at both prompting and training levels. For prompting, we conduct a zero-shot experiment on frozen Qwen3 models, comparing Direct Response (no explicit reasoning), Generic CoT (free-form step-by-step reasoning), and LHMT Prompting (three-stage structured reasoning). As shown in Table 3(a), LHMT performs comparably to Generic CoT on 8B but shows a greater advantage on 32B. For training, we compare Direct-response SFT, Generic-CoT SFT, and LHMT SFT under matched settings, using identical instances, target responses, data mixtures, and optimization configurations. Generic-CoT traces use the same teacher and generation setup as LHMT traces, differing only in reasoning structure. Table 3(b) shows that Generic-CoT SFT improves over Direct-response SFT by 1.56, 1.67, and 2.33 points in Dialogue Avg., MAQ, and RC, respectively. LHMT SFT yields further gains of 1.06, 1.71, and 1.49 points, respectively. Additional results across Dense RAG
| (a) Prompting-level comparison | ||||
|---|---|---|---|---|
| Model | Reasoning Mode | Dialogue Avg. | MAQ | RC |
| Qwen3-8B | Direct Response | 42.44 | 42.03 | 42.38 |
| Generic CoT | 43.93 | 44.26 | 43.11 | |
| LHMT Prompting | 43.87 | 44.78 | 44.34 | |
| Qwen3-32B | Direct Response | 48.50 | 45.93 | 54.38 |
| Generic CoT | 49.85 | 48.46 | 58.81 | |
| LHMT Prompting | 52.03 | 51.58 | 59.05 | |
| (b) Training-level comparison | ||||
| Backbone | Supervision Format | Dialogue Avg. | MAQ | RC |
| Qwen3-8B | Direct-response SFT | 44.17 | 42.84 | 44.36 |
| Generic-CoT SFT | 45.73 | 44.51 | 46.69 | |
| LHMT SFT | 46.79 | 46.22 | 48.18 | |
Table 3: Prompting- and training-level effectiveness of LHMT. Dialogue Avg. denotes the average of SC, AN, CF, and SQ. Higher is better.
and GraphRAG are provided in Appendix E.4.
Quality of Supervision Traces. To assess whether LHMT traces reflect narrative-supported decisions rather than plausible post-hoc explanations, we sample 2,000 instances from the training set containing explicit decision evidence, such as internal monologues or stated motivations. Given the current context, candidate memories, their source passages, and the LHMT trace, an automatic judge evaluates Context Faithfulness, Memory Grounding, and Plan Coherence, with acceptance rates of 90.4%, 93.4%, and 88.9%, respectively. A trace is considered fully valid only when all three dimensions meet the quality criteria without contradicting the character's explicit thoughts, knowledge, or narrative timeline. Overall, 84.4% of the traces meet this standard. Human validation of the judge is reported in Appendix D.3.
Quality of Generated Traces. We evaluate LHMT trace quality along three dimensions: Context Faithfulness, Memory Grounding, and Plan Coherence, using the same 300 test turns for all models. All three dimensions improve from Base + LHMT prompt through SFT warm-up to SR-OPSD. Memory Grounding remains the weakest after SFT but improves the most under SR-OPSD, becoming comparable to the other two. This suggests that critique-aware refinement particularly strengthens memory-to-decision reasoning, consistent with the largest degradation observed when ablating memory activation (Appendix E.6).
6 Conclusion
We presented MemRole, which trains role-playing agents to reason from long-horizon memories to role-consistent decisions by combining the LHMT schema with critique-guided on-policy self-distillation (SR-OPSD), together with a dataset of character-grounded, timeline-constrained memory pools. Experiments and ablations show consistent gains over backbones and role-playing baselines, highlighting the value of supervising intermediate memory reasoning.
Limitations
MEMROLE has two main limitations. First, LHMT trace synthesis, critique-rubric construction, and automatic evaluation rely on LLM assistance. We mitigate potential noise with structured prompts, independent validation, and human expert calibration, while stronger validators or broader human auditing could further improve robustness. Second, MEMROLE studies reasoning over pre-existing narrative memories from novels, which provides a controlled setting for memory-to-decision modeling. Extending the framework to online memory acquisition and revision during user interaction remains future work.
Ethics Statement
This work studies long-horizon memory reasoning for fictional role-playing agents. The dataset is constructed from literary narratives and centers on fictional characters, scenes, and character memories; it does not use private user conversations, personally identifiable information, or real-person profiling. Because the source novels may contain copyrighted text and socially biased or sensitive portrayals, we will not redistribute raw copyrighted content. Instead, we will release only copyright-compliant derived resources, such as annotations, prompts, statistics, and model outputs, for research purposes. We also acknowledge that stronger role-playing agents may be misused for deceptive impersonation, emotionally manipulative interaction, or unsafe fictional simulation. Therefore, systems based on this work should be deployed with clear AI disclosure, content safeguards, and appropriate human oversight. This work is intended for research on fictional narrative reasoning, not for simulating real individuals without consent or making decisions that affect real people.
References
Rishabh Agarwal, Nino Vieillard, Yongchao Zhou, Piotr Stanczyk, Sabela Ramos Garea, Matthieu Geist, and Olivier Bachem. 2024. On-policy distillation of language models: Learning from self-generated mistakes. In International Conference on Learning Representations, volume 2024, pages 21246–21263.
Jaewoo Ahn, Taehyun Lee, Junyoung Lim, Jin-Hwa Kim, Sangdoo Yun, Hwaran Lee, and Gunhee Kim. 2024. TimeChara: Evaluating point-in-time character hallucination of role-playing large language models. In Findings of the Association for Computational Linguistics: ACL 2024, pages 3291–3325, Bangkok, Thailand. Association for Computational Linguistics.
Xilong Cheng, Yunxiao Qin, Yuting Tan, Zhengnan Li, Ye Wang, Hongjiang Xiao, and Yuan Zhang. 2026. Psymem: Fine-grained psychological alignment and explicit memory control for advanced role-playing llms. Transactions of the Association for Computational Linguistics, 14:510–529.
Tianzhe Chu, Yuexiang Zhai, Jihan Yang, Shengbang Tong, Saining Xie, Dale Schuurmans, Quoc V Le, Sergey Levine, and Yi Ma. 2025. Sft memorizes, rl generalizes: A comparative study of foundation model post-training. arXiv preprint arXiv:2501.17161.
Martin A Conway and Christopher W Pleydell-Pearce. 2000. The construction of autobiographical memories in the self-memory system. Psychological review, 107(2):261.
Chengyu Du, Xintao Wang, Aili Chen, Weiyuan Li, Rui Xu, Junteng Liu, Zishan Huang, Rong Tian, Zijun Sun, Yuhao Li, and 1 others. 2026. Her: Human-like reasoning and reinforcement learning for llm role-playing. arXiv preprint arXiv:2601.21459.
Zhenpeng Gao, Xiaofen Xin, and Xiangmin Xu. 2025. Tailorrpa: A retrieval-based framework for eliciting personalized and coherent role-playing agents in general domain. In Findings of the Association for Computational Linguistics: EMNLP 2025, pages 5381–5412.
Arthur C Graesser, Murray Singer, and Tom Trabasso. 1994. Constructing inferences during narrative text comprehension. Psychological review, 101(3):371.
Yuxian Gu, Li Dong, Furu Wei, and Minlie Huang. 2024. Minillm: Knowledge distillation of large language models. In The twelfth international conference on learning representations.
Kai He, Yucheng Huang, Wenqing Wang, Delong Ran, Dongming Sheng, Junxuan Huang, Qika Lin, Jiaxing Xu, Wenqiang Liu, and Mengling Feng. 2025. Crab: A novel configurable role-playing llm with assessing benchmark. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 15030–15052.
Yinghui He, Simran Kaur, Adithya Bhaskar, Yongjin Yang, Jiarui Liu, Narutatsu Ri, Liam Fowl, Abhishek Panigrahi, Danqi Chen, and Sanjeev Arora. 2026. Self-distillation zero: Self-revision turns binary rewards into dense supervision. arXiv preprint arXiv:2604.12002.
Jingbo Ji, Lingyi Li, Xilong Cheng, Yuhao Zhou, Wenji Zhang, Yuting Tan, and Yunxiao Qin. 2026. Ripplemem: From isolated retrieval to associative recollection for long-term agent memory. arXiv preprint arXiv:2608.13334.
Chonghua Liao, Ke Wang, Yuchuan Wu, Fei Huang, and Yongbin Li. 2025. Moa: Multi-objective alignment for role-playing agents. arXiv preprint arXiv:2512.09756.
Cheng Liu, Yifei Lu, Fanghua Ye, Jian Li, Xingyu Chen, Feiliang Ren, Zhaopeng Tu, and Xiaolong Li. 2025. Cogdual: Enhancing dual cognition of llms via reinforcement learning with implicit rule-based rewards. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 27295–27324.
Keming Lu, Bowen Yu, Chang Zhou, and Jingren Zhou. 2024. Large language models are superpositions of all characters: Attaining arbitrary role-play via self-alignment. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 7828–7840.
Dan P McAdams. 2011. Narrative identity. In Handbook of identity theory and research, pages 99–115. Springer.
David Pillemer. 2003. Directive functions of autobiographical memory: The guiding power of the specific episode. Memory, 11(2):193–202.
Yunfan Shao, Linyang Li, Junqi Dai, and Xipeng Qiu. 2023. Character-llm: A trainable agent for role-playing. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 13153–13187.
Mingyang Song and Mao Zheng. 2026. A survey of on-policy distillation for large language models. arXiv preprint arXiv:2604.00626.
Noah Wang, Zy Peng, Haoran Que, Jiaheng Liu, Wangchunshu Zhou, Yuhan Wu, Hongcheng Guo, Ruitong Gan, Zehao Ni, Jian Yang, and 1 others. 2024. Rolellm: Benchmarking, eliciting, and enhancing role-playing abilities of large language models. In Findings of the Association for Computational Linguistics: ACL 2024, pages 14743–14777.
Xintao Wang, Heng Wang, Yifei Zhang, Xinfeng Yuan, Rui Xu, Jen-tse Huang, Siyu Yuan, Haoran Guo, Jiangjie Chen, Shuchang Zhou, and 1 others. 2025a. Coser: Coordinating llm-based persona simulation of established roles. In Forty-second International Conference on Machine Learning.
Zongsheng Wang, Kaili Sun, Bowen Wu, Qun Yu, Ying Li, and Baoxun Wang. 2025b. Raiden-r1: Improving role-awareness of llms via grpo with verifiable reward. arXiv preprint arXiv:2505.10218.
Zhihao Xiao, Mengting Li, Xintao Wang, Linfeng Li, Limin Shui, Mengqi Ji, and Borui Cai. 2026. Dream: Llm-based dynamic role-playing via event-aware memory graph. In Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining V.2, KDD '26, page 5686–5697, New York, NY, USA. Association for Computing Machinery.
Rui Xu, Xintao Wang, Jiangjie Chen, Siyu Yuan, Xinfeng Yuan, Jiaqing Liang, Zulong Chen, Xiaoqing Dong, and Yanghua Xiao. 2024. Character is destiny: Can role-playing language agents make person-adriven decisions. Preprint.
Rui Xu, Xintao Wang, Jiangjie Chen, Siyu Yuan, Xinfeng Yuan, Jiaqing Liang, Zulong Chen, Xiaoqingdong, and Yanghua Xiao. 2025. Character is destiny: Can persona-assigned language models make personal choices? In Findings of the Association for Computational Linguistics: EMNLP 2025, pages 15038–15059, Suzhou, China. Association for Computational Linguistics.
Zhenhua Xu, Dongsheng Chen, Jian Li, Yitong Lin, Zhebo Wang, Jiafu Wu, Yizhang Jin, Chengjie Wang, Meng Han, and Yabiao Wang. 2026a. Improving general role-playing agents via psychology-grounded reasoning and role-aware policy optimization. arXiv preprint arXiv:2606.27025.
Zhenhua Xu, Dongsheng Chen, Shuo Wang, Jian Li, Chengjie Wang, Meng Han, and Yabiao Wang. 2026b. Adamarp: An adaptive multi-agent interaction framework for general immersive role-playing. arXiv preprint arXiv:2601.11007.
An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, and 1 others. 2025. Qwen3 technical report. arXiv preprint arXiv:2505.09388.
Bohao Yang, Dong Liu, Chenghao Xiao, Kun Zhao, Chen Tang, Chao Li, Lin Yuan, Guang Yang, and Chenghua Lin. 2024. Crafting customisable characters with llms: A persona-driven role-playing agent framework. arXiv preprint arXiv:2406.17962.
Xinfeng Yuan, Siyu Yuan, Yuhan Cui, Tianhe Lin, Xintao Wang, Rui Xu, Jiangjie Chen, and Deqing Yang. 2024. Evaluating character understanding of large language models via character profiling from fictional works. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 8015–8036.
Wenji Zhang, Xilong Cheng, Yunxiao Qin, Mai Tu, Tongye Zhu, Yuhao Zhou, JingBo Ji, Yuting Tan, Duoyin Li, Hongjiang Xiao, and 1 others. 2026.
Psymembehav: Psychology-informed and memory-grounded two-level identity-to-action reasoning for social-media behavior simulation. arXiv preprint arXiv:2610.14570.
Siyan Zhao, Zhihui Xie, Mengchen Liu, Jing Huang, Guan Pang, Feiyu Chen, and Aditya Grover. 2026. Self-distilled reasoner: On-policy self-distillation for large language models. arXiv preprint arXiv:2601.18734.
Jinfeng Zhou, Zhuang Chen, Dazhen Wan, Bosi Wen, Yi Song, Jifan Yu, Yongkang Huang, Pei Ke, Guan-qun Bi, Libiao Peng, and 1 others. 2024. Character-glm: Customizing social characters with large language models. In Proceedings of the 2024 conference on empirical methods in natural language processing: Industry track, pages 1457–1476.
A Dataset
A.1 Comparison with Existing Datasets
Table 4 compares MEMROLE-DATASET with representative role-playing datasets in terms of memory representation, knowledge-boundary constraints, decision focus, and reasoning supervision.
A.2 Dataset Overview
MEMROLE is a long-horizon memory-based role-playing dataset constructed from raw novel corpora. As shown in Table 5, the final dataset contains 75 novels, 2,000 character profiles, 14,844 scenes, and 181,137 role-playing dialogue turns. Each scene contains an average of 12.20 dialogue turns, and each turn activates 0.721 memories on average. Each sample is centered on a focal character in a specific scene and includes the current dialogue context, the original character response, the character profile, and a long-horizon memory pool.
We split the dataset at the book level to prevent narrative leakage between training and test sets. The final split contains 64 training novels and 11 test novels, with all scenes, characters, and dialogue samples from the same novel assigned to the same split.
We further report memory-use statistics. Table 6 shows the distribution of the number of activated memories per role-playing turn.
Among turns with activated memories, we additionally analyze their effect patterns. Table 7 reports the corresponding distribution.
A.3 Dataset Construction Pipeline
We curate MEMROLE through a multi-stage extractive pipeline that goes from raw novel text to a structured, queryable representation. The details are as follows.
Source Selection. To ensure narrative quality and character depth, we start from the top 1,000 books in Goodreads' "Best Books Ever" list and use an LLM-based screening process to select novels better suited for long-horizon role-playing decision modeling. We prioritize books with sustained character arcs, decision-rich interactions, and cross-scene causal chains.
After this screening process, we obtain 75 novels for dataset construction. The selected novels cover a broad range of genres, including fantasy, historical fiction, science fiction, romance, mystery, literary fiction, adventure, young adult fiction, dystopian fiction, and gothic fiction. This genre coverage introduces diverse narrative styles, social settings, interpersonal conflicts, and character decision patterns, making MEMROLE suitable for studying long-horizon role-playing behavior across varied story worlds.
Chapter and Scene Segmentation. We first segment each book into chapter-level chunks based on its chapter structure. Chapter boundaries are jointly identified by rules and LLMs, and then globally adjudicated to produce a unified chapter list with chapter-level summaries. Within each chapter, we use LLMs to extract candidate scenes and their metadata, followed by global adjudication to obtain non-overlapping scene segments that fully cover the chapter.
Data Extraction. We use LLMs to extract structured information from each scene, including location, in-story time, atmosphere, relevant characters, preceding context, scene summary, scene outcome, and dialogue content. Following the message representation in CoSER, we further organize dialogue content into three types of information: character speech, actions, and thoughts.
To filter decision-dense samples, we compute heuristic indicators such as dialogue density, action/thought ratios, and the number of interaction turns, and assign each scene an interaction-type label accordingly. We then combine these labels with the LLM-assessed role-playing value to select high-quality scenes with sufficient character interaction, explicit behavioral choices, and strong plot-advancing effects.
Character Data Organization. Based on the extracted scenes and dialogues, we construct a character profile for each major character. We first perform alias resolution with LLMs, mapping different character mentions to a canonical name. Each character profile is then organized into three core components: a static profile, including personality traits, core values, speech style, and behavioral patterns; relationships, recording relation types, relationship trajectories, and the scene_ids of several key scenes; and a dynamic character arc, which partitions the character's narrative trajectory into 3–7 stages.
Each stage is associated with a scene_id range, a set of key turning-point scene_ids, and a state snapshot describing the character's situation, goals, known plot facts, and important relationship states.
| Dataset | Source | Memory Representation | Knowledge-boundary Constraint | Decision Focus | Reasoning Supervision |
|---|---|---|---|---|---|
| RoleLLM (Wang et al., 2024) | Scripts / GPT-gen. | Profile + synthetic QA | – | ✗ | None |
| DITTO (Lu et al., 2024) | Wikidata (self-aligned) | Model-internal knowledge | – | ✗ | None |
| CoSER (Wang et al., 2025a) | Novels | Conversations / plots / exp. | ✗ | ✗ | None |
| HER (Du et al., 2026) | Novels (CoSER-derived) | Dialogue history + scenario | ✗ | ✗ | Dual-layer thinking |
| PsyMem (Cheng et al., 2026) | Novels | Character / event graph | ✗ | ✗ | None |
| LifeChoice (Xu et al., 2025) | Novels | Preceding context | Partial | Choice-level | None |
| MEMROLE-DATASET | Novels | Per-character, perspective-rewritten, timeline-anchored pool | ✓ | ✓ | LHMT memory-to-decision trace |
Table 4: Comparison between MEMROLE and representative role-playing datasets. Knowledge-boundary Constraint denotes whether memory is restricted to what the focal character could plausibly know at the current narrative point, via temporal validity (only prior scenes) and character grounding (the focal character must be present, not merely mentioned). CoSER additionally supports optional retrieval over its book-derived data; LifeChoice provides partial preceding context but no character-grounded memory pool. “–” means the dataset has no cross-scene memory for the constraint to apply.
| Split | Novels | Characters | Scenes | Turns | Turns/Scene | Memories/Turn |
|---|---|---|---|---|---|---|
| Train | 64 | 1,755 | 13,172 | 161,027 | 12.22 | 0.722 |
| Test | 11 | 245 | 1,672 | 20,110 | 12.03 | 0.710 |
| Total | 75 | 2,000 | 14,844 | 181,137 | 12.20 | 0.721 |
Table 5: Overview and book-level train/test split statistics of MEMROLE.
| Activated Memories | Count | Percentage |
|---|---|---|
| 0 | 113,687 | 62.8% |
| 1 | 23,590 | 13.0% |
| 2 | 28,432 | 15.7% |
| 3+ | 15,428 | 8.5% |
| Total | 181,137 | 100.0% |
Table 6: Distribution of activated memories per role-playing dialogue turn in MEMROLE.
| Memory Effect Pattern | Count | Percentage |
|---|---|---|
| single | 23,590 | 34.97% |
| aligned | 35,424 | 52.52% |
| opposed | 3,683 | 5.46% |
| mixed | 4,753 | 7.05% |
| Total | 67,450 | 100.00% |
Table 7: Distribution of memory-effect patterns among turns with activated memories in MEMROLE.
during that stage. This stage-wise structure makes character memory queryable: given any decision point, we can trace back to the preceding character stages and further locate relevant scenes for memory retrieval.
A.4 Example Instance
Table 8 shows a representative test-set instance with dense memory activation. This example is selected from Stones from the River, where the current role-playing turn activates nine past-scene memories.
B LHMT Trace Construction Details
B.1 Reasoning Data Synthesis for LLM Role-play
Since LHMT traces do not explicitly appear in the original novel corpus, we construct a generator-validation distillation pipeline to synthesize high-quality auxiliary reasoning traces for role-play training. The pipeline preserves the original character response while using it as a grounding signal for trace construction. Specifically, a generator LLM first produces a candidate LHMT trace, and a validator LLM then checks the candidate against a set of validation rules summarized from failed generations and manually inspected error cases. According to the validation result, the candidate is either accepted, revised with feedback, or discarded.
Stage 1: Candidate trace synthesis. For each focal-character turn , we keep the original target response unchanged and ask the generator LLM to synthesize an auxiliary LHMT trace conditioned on . The resulting training output is written as
Here, follows the three-paragraph LHMT format defined in Section 4.1. The target response is provided to the generator only as a grounding signal, so that the generated trace can be aligned with the observed character behavior. It is not copied
| Stones from the River | (From Test Set) | |
|---|---|---|
| Character | Trudi Montag | |
| Topic | Comforting Konrad before his wartime relocation. | |
| Plot Summary | Leo Montag prepares a rare formal dinner for Trudi, Eva, Frau Neimann, and Konrad during wartime scarcity. During the meal, he reveals that Konrad and his mother must leave that night for a safer hiding place. Trudi has known this news in advance but has hidden it from Konrad to avoid frightening him. As the departure approaches, she uses the invented story of the Island of the Little People to comfort him while privately struggling with grief, anger, and attachment. | |
| Scenario | The scene takes place in Leo Montag's home, including the kitchen and attached pay-library. The atmosphere is bittersweet and tense: the dinner is warm and carefully prepared, but it is also a farewell. Konrad asks why the imagined island in Trudi's story has changed and why its beautiful world has collapsed. The question forces Trudi to respond without exposing the real danger behind his relocation or the violence that makes it necessary. | |
| Character Profile | Trudi MontagTrudi is a Burgdorf pay-library keeper whose role combines storytelling, radical kindness, and protective care for vulnerable people. Her months of caring for Konrad have formed a strong maternal attachment, but she must suppress her grief to protect him emotionally. | |
| Konrad NeimannKonrad is a young Jewish boy hidden in the Montag home with his mother. He relies on Trudi's stories for comfort and asks direct questions when he senses that adults are concealing painful truths. | ||
| Activated Memories | Memory 1: Story frameworkTrudi recalls the origin of the magical-island story, which gives her a familiar imaginative frame for comforting Konrad without naming the danger directly. | |
| Memories 2–4: Protective careThese memories cover Trudi's first discovery of Konrad and his mother hiding from Nazi persecution, her decision to shelter them, and her repeated use of stories and games to calm Konrad during their stay. | ||
| Memories 5–9: Wartime dangerThese memories remind Trudi that hidden fugitives face mortal danger if discovered. Their aligned effect pushes her to withhold the full factual truth, suppress her own grief, and respond in a way that protects Konrad's emotional safety. | ||
| History Dialogue | Trudi Montag: Let me tell you what it was like before people were hunted. There was an island where the streets were washed by warm rain, the sun was always out, and no one knew hunger. | |
| Konrad Neimann: Why can't we go there? | ||
| Trudi Montag: The island of the little people. A magic island where no one is taller than you and me. | ||
| Konrad Neimann: But why did you leave such a place? | ||
| Trudi Montag: Because the waterfalls dried up. Birds dropped from the sky. Everything withered.Konrad Neimann: Why?Trudi Montag: [I don't want to let Konrad go. I've never loved a child this way, I want to claim him as mine, shield him from anyone who would take him. But he's not mine.] (fuses her gaze to the boy's, trying to imprint herself on his memory) [You will always remember me. You will.] | ||
Table 8: A representative MEMROLE instance with dense memory activation.
verbatim into the trace, nor is the trace allowed to reveal surface wording from .
Stage 2: Validator-guided verification and retry. After a candidate trace is generated, we use a validator LLM to assess whether it satisfies the required LHMT properties. The validation criteria are derived from common failure patterns observed in preliminary generations and are further refined through manual inspection. The validator checks whether the trace: (i) follows the required LHMT structure; (ii) grounds its reasoning in the role prompt, dialogue context, and available memory pool; (iii) correctly determines whether memory activation is needed and which memories should be activated; (iv) distinguishes stable character-profile knowledge from episodic scene memory; and (v) avoids leaking future information or copying surface expressions from the target response.
The validator returns one of three decisions:
PASS, REVISE, or REJECT. A candidate marked as PASS is retained as the final trace. For REVISE, the validator provides a concise description of the weaknesses, and the generator is prompted again with the original input, the previous candidate, and the validator feedback to regenerate the trace. For REJECT, the candidate is treated as invalid and resampled. This generate-validate-retry process is repeated until the candidate passes validation or reaches the maximum number of attempts. In our implementation, we allow at most three generation attempts for each turn; samples that still fail validation after the final attempt are dropped from the supervised warm-up data.
Stage 3: Sequential trace integration. The synthesis process proceeds sequentially within each multi-turn dialogue. When constructing the trace for the -th focal-character turn, the generator can additionally condition on previously validated traces from earlier turns in the same dialogue. This helps maintain consistency in multi-turn reasoning, especially for memory activation and character-state tracking. This sequential construction context is used only during data synthesis. In the final training and inference settings, the model is not given hidden reasoning traces from previous turns as visible dialogue history. Finally, each validated trace is inserted immediately before its corresponding target response , yielding training trajectories with explicit LHMT supervision.
B.2 LHMT Trace Generation and Validation Prompts
This appendix presents the reference prompts used in our LHMT trace construction pipeline. The generation prompt, shown in Table 20, asks the teacher LLM to prepend an auxiliary LHMT trace to the original role-playing response. The validation prompt is split into two parts for readability: Table 21 lists the validation criteria, and Table 22 specifies the structured JSON output used to guide revision or retry before adding the trace to the supervised warm-up data.
C Training and Implementation Details
C.1 SFT Data Mixture
During supervised warm-up, we train on a mixture of LHMT-augmented role-playing trajectories and general instruction-tuning data. The LHMT-augmented trajectories provide direct supervision for learning the memory-to-decision rea-
soning format, while the general data helps preserve the model's general reasoning and instruction-following capabilities.
Specifically, the final SFT mixture contains 50% LHMT-augmented trajectories and 50% Tulu instruction-tuning data.
C.2 SFT Training Setup
We initialize the base policy from the corresponding backbone model and fine-tune it on the SFT mixture described in Appendix C.1. For LHMT-supervised examples, the target sequence contains both the auxiliary LHMT trace and the visible response; for general data, it follows the original response format. All models are trained with the standard next-token prediction objective.
We use LoRA for efficient fine-tuning, with rank , , dropout 0.05, and adapters applied to all linear modules. The main hyperparameters for Qwen3-8B are listed in Table 9.
| Hyperparameter | Value |
|---|---|
| Backbone model | Qwen3-8B |
| Maximum sequence length | 8192 |
| Learning rate | 1.0e-4 |
| Batch size (Global) | 128 |
| Number of epochs | 8 |
| Optimizer | AdamW (DeepSpeed ZeRO-3) |
| Warmup ratio | 10% |
| Weight decay | 0.01 |
| Precision | bfloat16 (bf16) |
Table 9: Main hyperparameters for supervised warm-up.
C.3 SR-OPSD Implementation
After supervised warm-up, we denote the resulting model as . In SR-OPSD, the trainable policy is initialized from , while another copy of is kept frozen as the critique model and teacher view. At each step, samples an on-policy trajectory from the original input.
The frozen critique model receives and generates a structured critique . The reference output is used only for critique construction and is not directly exposed to the teacher view. The teacher view conditions on as privileged context, while the student view receives only and its own rollout prefix. We optimize the student with token-level KL divergence on the policy's own rollout.
The critique is used only during training and is not available during inference. The main SR-OPSD hyperparameters are shown in Table 10.
| Hyperparameter | Value |
|---|---|
| Initial policy | |
| Critique / teacher model | Frozen |
| Rollout sampling temperature | 1.0 |
| Maximum rollout length | 2048 |
| Learning rate | 1.0e-5 |
| Batch size (Global) | 128 |
| Number of SR-OPSD steps | 100 |
Table 10: Main hyperparameters for SR-OPSD.
Algorithm 1 SR-OPSD Training (Phase 2)
Require: SFT warm-up model (frozen), rubric , training data
Ensure: Trained policy
1: Initialize
2: for each training step do
3: Sample , where and
4: on-policy LHMT trajectory
5: critique by frozen ; only for critique construction
6: for each token position do
7: teacher: frozen with critique
8: student: trainable , no critique
9: end for
10:
11: Update via
12: end for
13: return
C.4 SR-OPSD Training Algorithm
C.5 Validation of the Critique Model
In the default SR-OPSD configuration, the frozen SFT model serves as both the critique model and the teacher view. To evaluate its suitability for critique generation, we conduct a controlled experiment under the MEMROLE-8B setting. We keep the student initialization, teacher view, SR-OPSD training data, and optimization settings fixed, and vary only the frozen model used to generate critiques.
We compare four critique models: the Qwen3-8B backbone, an SFT model trained without the general-data mixture, the frozen used in our default configuration, and Qwen3-32B. In all variants, the teacher view and student initialization remain unchanged.
As shown in Table 11, the frozen outperforms Qwen3-8B and the variant without general-data mixing, while Qwen3-32B provides only modest further gains. These results support using the frozen as an effective and efficient critique model.
| Critique Model | Dialogue | Memory |
|---|---|---|
| Qwen3-8B | 51.3 | 54.1 |
| w/o general-data mixture | 49.4 | 51.9 |
| Frozen | 51.7 | 54.8 |
| Qwen3-32B | 52.2 | 55.4 |
Table 11: Effect of different critique models under the MEMROLE-8B setting. Dialogue averages SC, AN, CF, and SQ; Memory averages MAQ and RC. All other settings are fixed.
C.6 Inference
At inference time, the model receives only the standard role-playing input, including the current dialogue context, character profile, and long-horizon memory pool. Training-only components, including reference responses, validators, the critique model, and critique texts, are excluded.
For generation, we use nucleus sampling with a temperature of 0.75, a top- value of 0.9, and a repetition penalty of 1.05. We set the maximum number of newly generated tokens to 4,096, allowing the model to generate the auxiliary LHMT trace before the visible response. Unless otherwise specified, we remove the auxiliary LHMT trace and evaluate only the final visible role-playing response.
C.7 Data-driven Rubric Construction
This section details the rubric construction procedure summarized in Section 4.2. We construct the rubric in two stages: collecting empirical weaknesses from 's rollouts and consolidating these weaknesses through hierarchical summarization into a global pool of critique dimensions.
Stage 1: Weakness corpus collection. We sample turn-level rollouts from the SFT warm-up model on a reserved subset of the LHMT training split. Each rollout corresponds to one focal-character turn, where generates a complete output given the input . To cover diverse failure modes, we stratify sampling by memory-activation count. For each rollout paired with its reference output , we prompt GPT-5.5 to compare the two and extract a structured weakness list . Each contains free-form weakness descriptions with severity labels, specific failures, and abstract improvement directions. These categories are not predefined; they are later consolidated into the final critique dimensions.
Stage 2: Hierarchical summarization. We consolidate the raw weakness corpus into a structured rubric through a two-step hierarchical summarization process. At the block level, the weakness corpus is divided into smaller subsets, and GPT-5.5 summarizes each subset into candidate weakness dimensions with brief definitions and empirical support counts. These support counts are used only to guide consolidation, not as training-time loss weights. At the global level, GPT-5.5 merges semantically overlapping candidates, removes overly specific dimensions, and retains dimensions that recur across different subsets.
The final rubric is denoted as
where each represents a recurring weakness dimension. In our implementation, the final rubric contains dimensions covering memory use, character consistency, and reasoning quality. The full list of dimensions, with definitions and example failure cases, is provided in Table 12.
C.8 SR-OPSD Critique Prompt
Table 23 presents the critique-generation prompt used in SR-OPSD. The prompt compares an on-policy model rollout with a privileged reference and produces structured critiques for self-distillation.
D Evaluation Details
D.1 Baseline Details
We compare MEMROLE with three categories of baselines, following the model list in Table 1.
Closed-source general LLMs. We include strong API-based frontier models, including GPT-5.4¹, Grok-4.2², Claude-4.6-Opus³, Gemini-2.5-Pro⁴, Gemini-3-Pro⁵, MiniMax-M2.5⁶, and Doubao-seed-2.0-Pro⁷. These models serve as strong general-purpose baselines and test whether frontier instruction-following and reasoning abilities are sufficient for long-horizon memory-grounded role-playing.
Open-weight general LLMs. We include LLaMA-3.1-70B⁸, GLM-5⁹, DeepSeek-v3.2¹⁰, and DeepSeek-v4-Pro¹¹. These models are not specifically trained with MEMROLE supervision and therefore measure the base capability of general LLMs on memory-grounded role-playing and character decision consistency.
Role-playing baselines. We include CoSER-8B¹² and CoSER-70B¹³ as established-character role-playing baselines, HER-RL¹⁴ as a reasoning-enhanced role-playing baseline, and CharacterGLM-6B¹⁵ as a character-oriented dialogue baseline. These models provide direct comparisons with specialized role-playing agents.
MEMROLE models. We train MEMROLE-8B and MEMROLE-32B on Qwen3 backbones, using Qwen3-8B¹⁶ and Qwen3-32B¹⁷, respectively. Unless otherwise specified, MEMROLE models are first trained with SFT on validated LHMT trajectories and then optimized with SR-OPSD as described in Section 4.2.
D.2 Scoring Rubrics
Following the methodology of CoSER (Wang et al., 2025a), we use an LLM-based judge to evaluate open-ended role-playing conversations on MEM-ROLE Test and CoSER. Each dimension is scored on a 0–100 scale, where higher scores indicate better role-playing quality. The evaluation covers four CoSER-style dimensions:
Storyline Consistency. This dimension assesses whether the simulated conversation is consistent with the original narrative context. It focuses on whether the model’s responses, including emotions, attitudes, and behaviors, remain faithful to the ongoing storyline.
Anthropomorphism. This dimension assesses whether the role-playing agent behaves in a human-like manner. It considers self-identity, emotional depth, persona coherence, and social interaction.
¹https://openai.com/index/introducing-gpt-5-4/ ²https://docs.x.ai/docs/models?cluster=us-east-1 ³https://www.anthropic.com/news/claud-eopus-4-6 ⁴https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025/ ⁵https://storage.googleapis.com/deepmind-media/Model-Cards/Gemini-3-Pro-Model-Card.pdf ⁶https://www.minimax.io/news/minimax-m25 ⁷https://seed.bytedance.com/en/seed2
⁸https://arxiv.org/abs/2407.21783 ⁹https://glm5.ai/ ¹⁰https://huggingface.co/deepseek-ai/DeepSeek-V3.2 ¹¹https://huggingface.co/deepseek-ai/DeepSeek-V4-Pro ¹²https://huggingface.co/Neph0s/CoSER-Llama-3.1-8B ¹³https://huggingface.co/Neph0s/CoSER-Llama-3.1-70B ¹⁴https://huggingface.co/ChengyuDu0123/HER-32B ¹⁵https://huggingface.co/thu-coai/CharacterGLM-6B ¹⁶https://huggingface.co/Qwen/Qwen3-8B ¹⁷https://huggingface.co/Qwen/Qwen3-32B
| Category | Rubric dimension | Definition | Typical failure |
|---|---|---|---|
| Memory | Memory-need misjudgment | Fails to correctly decide whether the current turn requires consulting the memory pool. | Uses memory when the current context is sufficient, or ignores memory when past events are needed. |
| Memory | Missing relevant memory | Fails to activate a memory that is necessary for explaining the character’s current decision. | Omits a prior confrontation or promise that should constrain the response. |
| Memory | Irrelevant memory injection | Activates memory entries that are unrelated to the current decision or unsupported by the input. | Grounds the response in an unrelated past scene. |
| Memory | Multi-memory effect integration error | Fails to integrate aligned, conflicting, or complementary effects across multiple activated memories. | Treats conflicting memories as independently supportive, or ignores their combined effect. |
| Character | Motivation misalignment | Misidentifies the character’s current motivation, constraint, or behavioral tendency. | Makes a cautious character act boldly without contextual support. |
| Character | Character voice inconsistency | Produces a response whose style, register, emotional tone, or manner of expression is inconsistent with the character. | Uses overly modern, generic, or emotionally mismatched phrasing. |
| Character | Relationship or stance inconsistency | Fails to preserve the character’s current relationship state or stance toward other characters. | Responds warmly to a character they currently distrust. |
| Character | Information-disclosure error | Reveals, withholds, or frames information in a way inconsistent with the character’s knowledge, intent, or social situation. | Exposes a secret or hidden plan that the character should avoid revealing. |
| Reasoning | Shallow context understanding | Misreads the immediate dialogue pressure, scene dynamics, character relationships, or response need. | Treats a tense confrontation as a casual factual exchange. |
| Reasoning | Response strategy planning error | Fails to plan the appropriate response stance, form, tone, or information-disclosure boundary. | Chooses the wrong response form, such as direct confession when restraint is needed. |
| Reasoning | Trace-response inconsistency | The visible response does not faithfully execute the plan stated in the LHMT trace. | The trace plans restrained denial, but the response becomes openly confrontational. |
| Reasoning | Premature or unsupported plot reasoning | Introduces future knowledge, retrospective interpretation, or unsupported plot information unavailable at the current turn. | Mentions an outcome or hidden fact that the character could not yet know. |
Table 12: Final critique dimensions used in SR-OPSD. The rubric contains 12 recurring weakness dimensions induced from empirical errors of the SFT warm-up model, grouped into memory-related, character-related, and reasoning-related categories.
Character Fidelity. This dimension assesses how well the model reflects the target character. It focuses on whether the generated responses are consistent with the character’s personality, linguistic style, knowledge, relationships, and behavioral patterns.
Storyline Quality. This dimension assesses the overall naturalness and quality of the simulated conversation. It focuses on narrative flow, logical consistency, and whether the dialogue develops coherently.
For LifeChoice, we evaluate whether the model selects the decision consistent with the ground-truth character choice. We report accuracy as the primary metric.
D.3 Human Evaluation
Tables 13 and 14 report the detailed human evaluation results and human-automatic evaluation alignment, respectively.
| Model | Avg. Human Score | Win Rate (%) |
|---|---|---|
| Qwen3-8B | 4.57 | 31.4 |
| Qwen3-32B | 5.21 | 38.5 |
| CoSER-70B | 6.05 | 42.1 |
| MemRole-8B | 6.34 | 50.1 |
| HER-RL | 6.78 | 65.6 |
| MemRole-32B | 7.02 | 72.3 |
Table 13: Human evaluation on the MEMROLE test set. Avg. Human Score is the mean 1–10 rating, and Win Rate is the pairwise preference rate.
| Target | Samples | Agreement | ||
|---|---|---|---|---|
| Responses | 300 | 89.4% | 0.77 | 0.81 |
| LHMT Traces | 300 | 90.2% | 0.80 | 0.83 |
Table 14: Human expert validation of automatic evaluation. Agreement denotes case-level agreement; measures chance-corrected agreement; denotes Spearman rank correlation between human and automatic scores.
E Additional Results
E.1 Full Results on the CoSER Benchmark
Table 15 reports the complete evaluation results on the CoSER benchmark across four role-playing dimensions. The results compare MEMROLE with both frontier general-purpose LLMs and specialized role-playing models, showing that MEMROLE-32B remains competitive overall and achieves the highest Storyline Quality score.
| Model | CoSER Benchmark | ||||
|---|---|---|---|---|---|
| Avg | SC | AN | CF | SQ | |
| Claude-4.6-Opus | 62.10 | 62.71 | 64.21 | 58.33 | 63.14 |
| Gemini-3-Pro | 61.92 | 65.85 | 61.42 | 58.14 | 62.27 |
| GPT-5.4 | 60.41 | 62.95 | 53.21 | 60.13 | 65.35 |
| Gemini-2.5-Pro | 61.19 | 61.05 | 62.83 | 57.41 | 63.45 |
| MemRole-32B | 60.02 | 60.50 | 53.20 | 56.57 | 69.79 |
| DeepSeek-v3.2 | 57.92 | 53.85 | 56.07 | 57.45 | 64.31 |
| MiniMax-M2.5 | 57.21 | 60.03 | 50.12 | 49.30 | 69.37 |
| HER-RL | 53.09 | 54.33 | 47.27 | 52.64 | 58.12 |
| CoSER-70B | 36.21 | 36.08 | 31.16 | 32.28 | 45.31 |
| MemRole-8B | 34.54 | 36.10 | 29.53 | 30.42 | 42.10 |
| Qwen3-32B | 24.21 | 30.09 | 19.68 | 15.52 | 31.56 |
Table 15: Comprehensive evaluation results on the CoSER benchmark. Avg denotes the average over Storyline Consistency (SC), Anthropomorphism (AN), Character Fidelity (CF), and Storyline Quality (SQ). Higher is better.
E.2 Evaluation with Different LLM Judges
To examine whether our conclusions depend on the preferences of a single LLM judge, we re-score the same model outputs using GPT-5.5, Claude-4.6-Opus, and DeepSeek-V3.2. All judges receive identical evaluation inputs and follow the same scoring rubric and evaluation protocol. Table 16 reports the average scores assigned by the three judges.
Although the judges differ in their absolute scoring scales, they produce broadly consistent comparative results. In particular, MEMROLE-32B consistently outperforms the representative role-playing baselines under all three judges. Its advantage over HER-RL is 11.41 points under GPT-5.5, 11.42 points under Claude-4.6-Opus, and 13.08 points under DeepSeek-V3.2. MEMROLE-8B also remains competitive with HER-RL, slightly trailing it under GPT-5.5 but outperforming it under the other two judges. These results indicate that the observed gains are robust to judge choice rather than being an artifact of the preferences of a single evaluation model.
| Model | GPT-5.5 (Original) | Claude 4.6 Opus | DeepSeek V3.2 |
|---|---|---|---|
| Claude-4.6-Opus | 72.49 | 72.03 | 79.38 |
| MEMROLE-32B | 64.25 | 62.74 | 70.36 |
| HER-RL | 52.84 | 51.32 | 57.28 |
| MEMROLE-8B | 52.75 | 52.06 | 59.11 |
| MiniMax-M2.5 | 45.36 | 44.65 | 50.03 |
Table 16: Average scores assigned by different LLM judges on MEMROLE Test. All judges use the same evaluation inputs, rubric, and scoring protocol. Higher is better.
E.3 Pairwise Preference Evaluation
We further conduct pairwise preference evaluation across all test scenarios. For each comparison, the response order is randomly shuffled to mitigate position bias, and DeepSeek-V3.2 is used as an independent judge. Table 17 reports the win rates of each model against GPT-4o and GPT-5.
The pairwise results are broadly consistent with the score-based evaluation. MEMROLE-32B achieves higher win rates than the representative role-playing baselines against both reference models. MEMROLE-8B also remains competitive with HER-RL, slightly trailing it against GPT-4o while outperforming it against GPT-5. These results provide complementary evidence that the observed advantages are not specific to the point-based scoring protocol.
| Model | Win Rate vs. GPT-4o (%) | Win Rate vs. GPT-5 (%) |
|---|---|---|
| Claude-4.6-Opus | 61.5 | 54.0 |
| MEMROLE-32B | 56.5 | 49.0 |
| HER-RL | 46.5 | 38.5 |
| MEMROLE-8B | 46.0 | 41.0 |
| MiniMax-M2.5 | 38.0 | 29.5 |
Table 17: Pairwise preference results against GPT-4o and GPT-5 on MEMROLE Test. Response order is randomly shuffled, and DeepSeek-V3.2 is used as the independent judge. Higher is better.
E.4 Generalization across Memory Backends
To examine whether LHMT is tied to the specialized memory representation used in MEM-ROLE, we evaluate its generalization across different memory backends. Specifically, we replace the character-grounded memory pool with two commonly used retrieval architectures: Dense RAG and GraphRAG.
For Dense RAG, we segment the character-accessible prior scenes into textual chunks and retrieve evidence relevant to the current scene and dialogue context. For GraphRAG, we organize the same historical narrative into a graph containing character, event, and relationship information, and retrieve relevant nodes and their textualized local neighborhoods. The MEMROLE backend uses the character-perspective, timeline-constrained memory nodes described in Section 3.3.
For a fair comparison, all backends use the same historical corpus, test instances, backbone model, evidence-token budget, and decoding configuration, and access only character-available information prior to the current scene.
For each memory backend, we compare three inference modes: Direct Response, which directly generates the role-playing response from the retrieved evidence; Generic CoT, which performs free-form step-by-step reasoning before generating the response; and LHMT Prompting, which organizes the reasoning process into context understanding, memory activation, and response strategy planning. The backbone remains frozen in all settings, and only the reasoning instruction is changed.
As shown in Table 18, LHMT Prompting consistently improves memory reasoning across alternative backends. Compared with Generic CoT, it improves Dialogue Avg. by 0.22 and 0.26 points, MAQ by 0.73 and 0.74 points, and RC by 0.92 and 0.96 points under Dense RAG and GraphRAG, respectively. With the MEMROLE Pool, LHMT achieves comparable dialogue quality while improving MAQ and RC by 0.52 and 1.23 points. These results suggest that LHMT provides a robust memory-to-decision reasoning interface across both textual and graph-based retrieval architectures.
| Backend | Reasoning | Dialogue Avg. | MAQ | RC |
|---|---|---|---|---|
| Dense RAG | Direct Response | 41.26 | 40.74 | 41.12 |
| Generic CoT | 42.35 | 42.08 | 41.96 | |
| LHMT Prompting | 42.57 | 42.81 | 42.88 | |
| GraphRAG | Direct Response | 41.83 | 41.25 | 41.71 |
| Generic CoT | 43.02 | 42.97 | 42.64 | |
| LHMT Prompting | 43.28 | 43.71 | 43.60 | |
| MEMROLE Pool | Direct Response | 42.44 | 42.03 | 42.38 |
| Generic CoT | 43.93 | 44.26 | 43.11 | |
| LHMT Prompting | 43.87 | 44.78 | 44.34 |
Table 18: Generalization of LHMT across memory backends on MEMROLE Test. All variants use the same frozen backbone and inference configuration. Dialogue Avg. averages SC, AN, CF, and SQ. Higher is better.
E.5 Analysis of Memory Retrieval
By default, MEMROLE dynamically determines the number of retrieved memories for each scene-character instance using an adaptive memory cap. To evaluate the model's sensitivity to the retrieval budget, we fix the model, test instances, and retrieval ranking, and vary only the maximum number of retrieved memories K visible to the model. When fewer than K valid memories are available, all available memories are used.
As shown in Figure 3, performance improves substantially as K increases from 0 to 5, with Dialogue Avg. increasing by 3.18 points, after which the gains begin to plateau. Compared with K = 5, increasing the budget to K = 10 yields only modest improvements of 0.61, 1.14, and 0.32 points in Dialogue Avg., MAQ, and RC, respectively. Further increasing K to 20 reduces Dialogue Avg., MAQ, and RC by 0.81, 0.26, and 1.11 points, respectively. Dialogue Avg. denotes the average of SC, AN, CF, and SQ.
These results suggest that a small set of top-ranked memories captures most of the information relevant to character decisions, whereas a larger

Figure 3: Sensitivity of MEMROLE-8B to the maximum number of retrieved memories. Dialogue Avg. denotes the mean of SC, AN, CF, and SQ. Most of the gain is obtained by , after which performance plateaus; increasing to 20 degrades all three metrics.
| Model | Context | Memory | Plan |
|---|---|---|---|
| Base + LHMT prompt | 2.68 | 2.12 | 2.49 |
| SFT warm-up | 3.49 | 2.88 | 3.10 |
| SR-OPSD | 4.12 | 4.04 | 4.18 |
Table 19: LHMT trace quality judged by GPT-5.5 on a 0–5 scale. Results are reported on the 8B backbone. Higher is better.
retrieval budget may introduce weakly relevant evidence. This finding is consistent with our adaptive memory-cap design: the base parameter is set to to capture most of the performance gains, while the cap grows sub-linearly with the number of valid candidates, allowing the retrieval budget to expand moderately for instances with richer relevant histories.
E.6 Quality of Generated LHMT Traces
Table 19 reports the quality of model-generated LHMT traces across the three reasoning dimensions.
E.7 Training Dynamics
Figure 4 shows that SR-OPSD rapidly improves over the SFT baseline within the first 30 training steps and then remains consistently higher throughout training. The curve stabilizes after about 50–60 steps with moderate variance across three runs, suggesting that SR-OPSD provides stable gains without severe training collapse.

Figure 4: SR-OPSD training dynamics on MEMROLE, evaluated every 10 training steps. Each point reports the mean over 3 independent runs; the shaded region denotes the standard deviation.
A reference prompt for LHMT trace generation.
You are a CoT generator for a ShareGPT role-playing dataset.
Given the reference context and the original assistant target, generate a hidden <think> analysis and then append the original assistant target exactly unchanged.
=== REFERENCE CONTEXT === {reference_content}
=== ORIGINAL ASSISTANT TARGET === {target_assistant_content}
=== PREVIOUS ATTEMPT AND VALIDATOR FEEDBACK (ignore if absent) === {previous_attempt_feedback}
Use previous feedback only to avoid recurring errors. Do not copy failed wording.
The <think> block must contain exactly three natural paragraphs:
Paragraph 1: Analyze the focal character's current situation, immediate interaction pressure, and only the profile traits relevant to this turn.
Paragraph 2: Decide whether the scene memory pool is needed. The scene memory pool refers only to memories listed under Relevant Past Memories, not the character profile. If memory is needed, identify the necessary memory ids, explain why the current context is insufficient, and describe the behavioral pressure of each activated memory. When multiple memories are used, determine whether their effects are aligned, opposed, or mixed, and explain their combined effect. If memory is not needed, explain why the current context and profile are sufficient.
Paragraph 3: Describe the response policy, including the appropriate use of speech, action, or inner thought, the tone, what should be revealed or withheld, and what should be avoided.
Rules:
- Use third-person analysis rather than first-person narration.
- Use exactly three natural paragraphs without headings, bullets, numbered steps, or explicit reasoning tags.
- Ground every claim in the reference context, listed memories, character relationships, or the original target.
- Do not invent facts or use future information unavailable to the character.
- Use the original target only to infer the intended stance and response policy. Do not quote, closely paraphrase, or pre-announce its distinctive wording, actions, or thoughts inside <think>.
- Distinguish stable profile knowledge from episodic scene memories.
- After </think>, append the original assistant target exactly unchanged.
Return only:
<think> Natural paragraph 1.Natural paragraph 2.
Natural paragraph 3. </think> {target_assistant_content}
Table 20: A reference prompt for LHMT trace generation.
A Reference Prompt for LHMT trace Validation (Part 1).
You are a validator for hidden CoT generated for a ShareGPT role-playing memory-activation dataset.
You will receive:
(1) the reference context,
(2) the original assistant target, and
(3) a generated assistant value containing a <think> block followed by the target.
=== REFERENCE CONTEXT === {reference_content_with_memories}
=== ORIGINAL ASSISTANT TARGET === {target_assistant_content}
=== GENERATED ASSISTANT VALUE === {generated_reasoning}
Determine whether the generated <think> is valid supervision for current-turn memory-aware role-playing.
Check the following:
- Structure
– There is exactly one <think> block containing three natural paragraphs.
– The assistant target after </think> exactly matches the original target.
– The reasoning contains no headings, bullets, numbered steps, or explicit reasoning tags.
- Grounding and temporal validity
– Every claim is grounded in the profile, current scenario, dialogue prefix, listed memories, character relationships, or original target.
– The reasoning contains no fabricated facts or future information unavailable to the character at the current turn.
- Memory decision
– Independently determine whether the listed scene memory pool is needed.
– Do not treat character–profile information as scene memory.
– When memory is needed, verify the selected memory ids and explain the behavioral pressure of each memory.
– For multiple activated memories, classify their combined effect as aligned, opposed, or mixed.
– When memory is not needed, verify that the current context and profile are sufficient.
- Target leakage
– The reasoning may use the target to infer the intended stance and response policy, but must not quote, closely paraphrase, or pre-announce its distinctive wording, actions, thoughts, or withheld information.
- Training usefulness
– The reasoning clearly explains the current information need, memory relevance, and response policy.
– It is not generic or merely a restatement of the target.
Table 21: A reference prompt for LHMT trace validation, part 1.
A Reference Prompt for LHMT trace Validation (Part 2).
Return ONLY a JSON object, with no preamble or explanation outside JSON:
{ "pass": true | false, "memory_analysis": { "need_scene_memory_pool": true | false, "memory_ids": ["Memory N", "..."], "profile_needed": true | false, "current_context_sufficient": true | false, "effect_pattern": "none" | "single" | "aligned" | "opposed" | "mixed", "memory_effects": [ { "memory_id": "Memory N", "direction": "supports_response" | "opposes_response" | "constrains_response" | "complicates_response" | "contextualizes_response", "behavioral_pressure": "What this memory pushes the character toward or away from in the current turn." } ], "net_effect": "The combined behavioral effect of the activated memories; empty if no memory is activated." }, "issues": [ { "severity": "critical" | "major" | "minor", "type": "structure" | "target_mismatch" | "source_grounding" | "current_turn_boundary" | "future_knowledge_leakage" | "withheld_information_leakage" | "target_wording_leakage" | "memory_decision" | "memory_effect_analysis" | "profile_memory_confusion" | "answer_leakage" | "training_usefulness", "message": "A concrete description of the problem." } ], "revision_feedback": "Concise and actionable revision guidance; empty if pass is true." }
Always provide your best independent memory analysis, even when pass is false.
Severity:
- critical: invalid structure, target mismatch, unsupported or future information, hidden-information leakage, or an incorrect memory-needed decision;
- major: incorrect or incomplete memory use, profile-memory confusion, target leakage, or an unclear response policy;
- minor: limited style or specificity issues that do not change correctness.
If all checks pass, return pass=true, issues=[] and revision_feedback "".
Table 22: A reference prompt for LHMT trace validation, part 2.
A Reference Prompt for Critique Generation in OPSD.
You are a critique expert for long-horizon memory reasoning in role-playing agents. Your task is to identify weaknesses in a model-generated reasoning trajectory by comparing it with a privileged reference, using a structured multi-dimensional rubric.
=== INPUTS ===
Current input :
- Dialogue context : {dialogue_context}
- Character profile : {character_profile}
- Memory pool : {memory_pool}
Model-generated trajectory :
- LHMT trace : {generated_trace}
- Role-playing response : {generated_response}
Reference trajectory (PRIVILEGED – used for grounding only):
- LHMT trace : {reference_trace}
- Role-playing response : {reference_response}
Rubric : {rubric_dimensions_with_weights}
=== TASK ===
Compare against , guided by rubric , and identify the rubric dimensions where meaningfully deviates from . For each deviation, produce a structured diagnosis with:
- rubric_dimension – which dimension from this deviation belongs to.
- severity – "high" | "medium" | "low", jointly determined by the rubric weight and the magnitude of deviation.
- specific_failure – concrete description of what did wrong (citing 's content is safe; is the student's own rollout).
- improvement_direction – abstract guidance on what the model should do differently, at the level of reasoning pattern, memory usage, or response policy.
- anchor_constraints – character-level invariants extracted from that must be preserved (traits, relational facts, decision stance, tone), expressed abstractly.
Cover (LHMT trace), (visible response), and their correspondence – whether faithfully executes what plans (memories activates should be reflected in ; response policy states should be followed by ). Deviations may occur in context understanding, memory activation, response strategy planning, surface response, or trace-response correspondence.
=== CRITICAL CONSTRAINTS (surface-leakage prevention) ===
The critique will be used as privileged supervision for the student model. The student must not be able to reconstruct 's exact wording. Therefore:
- DO NOT quote, paraphrase, or reproduce 's specific surface wording ('s exact sentences, 's exact phrases, distinctive word choices).
- Refer to ONLY at the level of: (a) reasoning patterns ("the reference activates Memory 2 and reasons about its denial implication"), (b) decision logic ("the reference adopts a reluctant-denial stance"), (c) character-level invariants ("preserve honest-denial pattern, short reply length"), or (d) rubric-dimension properties.
- Quoting is fine – it is the student's own rollout.
- improvement_direction must NEVER contain the specific surface form uses. E.g., "should explicitly activate Memory 2 to ground a short denial" – NOT "should say 'I didn't put my name in the Goblet'".
=== OUTPUT FORMAT ===
Return ONLY a JSON array. No preamble, no markdown fence, no commentary outside the array. If has no significant deviations, return [].
[ { "rubric_dimension": "<dimension name from R>", "severity": "high | medium | low", "specific_failure": "<what did wrong; may cite 's content>", "improvement_direction": "<abstract direction; NO surface wording>", "anchor_constraints": "<abstract character/relational invariants from >" } ]
Order entries by severity (high → low). At most 6 entries; focus on the most consequential deviations.
Table 23: Prompt template for critique generation in OPSD.