The utility of Role-Playing Language Agents in sociological research is growing alongside the adoption of Large Language Models. For realism in social simulation, these agents must adhere to their personas defined by character profiles, yet existing strategies-static prompt engineering or costly fine-tuning-fail to adapt personas to dynamic scenarios. Psychological theories, such as the Cognitive-Affective Personality Systems, provide a crucial explanation for this failure: a persona's influence on behavior is not static but varies with the scenarios. This context-dependence highlights the critical need for adaptive persona management. To address this gap, we propose a novel, theory-driven method that dynamically estimates context-dependent persona importance and integrates it into weighted reward-guided decoding, enabling inference-time persona following. Specifically, we introduce the Persona Dynamic Decoding (PDD) framework, which consists of two key components: (1) Persona Importance Estimation (PIE) module, which dynamically quantifies the contextual importance of persona attributes without requiring ground-truth supervision; and (2) Persona-Guided Inference-Time Alignment (PIA) paradigm, which leverages these importance scores to construct weighted multi-objective rewards and modulate generation probabilities during inference. Extensive experiments show the effectiveness of our method in utterance consistency and behavioral fidelity.
Figures & tables
Figure 1: Overview of the proposed PDD. Given a full prompt T including character profile P , scenario context C and a query x , PDD first dynamically estimates persona importance Ii for each persona attribute wi . Then we compute persona-guided rewards ri(T,y<t) by measuring the divergence between persona-constrained and unconstrained probability distributions. These individual rewards are then integrated into a normalized reward signal Rnorm , which emphasizes more important attributes through adaptive weighting. Finally, the aligned policy pr can be derived through reward maximization, thereby generating persona following responses.
Figure 2: Overall assessment of PIE for general character task. Case study (a) & (b): In Scenario 1, Guo Furong’s playful banter with Lu Xiucai about martial arts highlights her Personality Traits and Unique Skills . In Scenario 2, her guidance to Tong Xiangyu foregrounds Life View and Educational Views , illustrating context-dependent persona relevance. Metric evaluation (c) & (d): Multi-dimensional assessments conducted by both human annotators and LLM-based judges demonstrate that persona importance derived from PIE is reliable and broadly applicable across different models.
Baselines
CharacterEval
BEYOND DIALOGUE
Qwen2.5-7B-Instruct
LLaMA-3-8B-Instruct
Qwen2.5-7B-Instruct
LLaMA-3-8B-Instruct
PDD vs .
Win(%)
Lose(%)
Win(%)
Lose(%)
Win(%)
Lose(%)
Win(%)
Lose(%)
SP
51.2
34.7
52.5
43.1
63.9
30.2
56.2
41.9
PP
48.7
38.5
39.1
31.3
43.0
37.6
46.8
36.5
ICL
65.3
33.1
63.1
35.7
60.9
35.4
64.2
35.0
OPAD
52.8
41.5
48.2
41.6
49.0
43.5
47.6
36.8
Table 1: Direct comparison with the baselines for general character task. Win indicates that GPT-4o assesses PDD’s responses as superior compared to the baselines, better addressing adaptive persona following.
KE : Knowledge Exposure KA : Knowledge Accuracy KH : Knowledge Hallucination PB : Persona Behavior PU : Persona Utterance
Models
Methods
KE
KA
KH
PB
PU
Average
GPT-4o
PP
2.58
3.02
2.99
2.83
2.91
2.87
Deepseek-R1
PP
1.42
3.07
2.83
1.93
2.89
2.43
Qwen2.5-7B-Instruct
SP
2.07
3.00
3.23
3.09
2.38
2.75
PP
2.25
2.96
2.99
3.03
2.94
2.83
ICL
1.92
2.79
2.92
2.72
2.42
2.55
Table 2: Automatic evaluation for general character task on CharacterEval. PDD strikes a balance between generating persona following response and maintaining knowledge rationality.
Figure 3: Direct comparison with the baselines for specific personality task on PERSONALITYBENCH.
Big-Five
SP
PP
ICL
OPAD
PAS
NPTI
PDD
Qwen2.5-7B-Instruct
Agreeableness
4.81 ± 0.15
4.90 ± 0.09
4.81 ± 0.15
4.53 ± 0.49
4.83 ± 0.63
4.73 ± 0.24
4.92 ± 0.09
Conscientiousness
4.47 ± 0.05
4.98 ± 0.01
4.19 ± 0.70
4.66 ± 0.29
4.61 ± 0.54
4.74 ± 0.23
4.97 ± 0.02
Extroversion
4.68 ± 0.39
4.59 ± 0.47
4.32 ± 0.69
4.26 ± 0.55
4.65 ± 0.25
4.71 ± 0.31
4.66 ± 0.35
Neuroticism
3.02 ± 0.64
3.45 ± 1.56
3.12 ± 0.69
3.79 ± 0.59
3.74 ± 0.25
3.39 ± 0.74
3.54 ± 0.43
Openness
4.56 ± 0.36
4.75 ± 0.27
4.67 ± 0.40
4.44 ± 0.36
4.61 ± 0.26
4.83 ± 0.18
4.75 ± 0.23
Table 3: Automatic evaluation for specific personality task on PERSONALITYBENCH. Experiments show that PDD outperforms all the baselines, achieving higher performance scores and significant lower variance.
Reward
Qwen2.5-7B-Instruct
LLaMA-3-8B-Instruct
Win(%)
CharacterRM
Win(%)
CharacterRM
w/o Normalization
38
2.80
32
2.71
w/ Normalization
42
2.85
40
2.81
Table 4: Ablation study of the effectiveness of reward function normalization schemes on CharacterEval.
Figure 4: Ablation study of the effect of the number of persona attributes on CharacterEval.
Decoding Method
Quality of G
Context Relevance ↑
Attribute Utility ↑
Context Coverage ↑
Attribute Independence ↑
Ranking Consistency ↑
Top-5 Overlap ↑
Beam
2.576
3.97
4.25
3.85
4.08
2.96
3.97
Top-k
2.193
3.86
4.08
3.87
4.04
3.82
3.66
Table 5: Ablation study of PIE robustness under reduced G quality on CharacterEval
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
β =2.0
β =1.0
β =0.5
β =0.25
Win
Lose
Win
Lose
Win
Lose
Win
Lose
24.5%
16.5%
40.5%
29.5%
44.5%
34.5%
43.0%
45.5%
Appendix
Table 6: Alignment performance of different β values on CharacterEval. Large β keeps the aligned policy close to the base model, reducing persona following; small β increases deviation—yet too small sacrifices generation quality.
Figure 5: Overall assessment of PIE for specific personality task. Case Study (a) & (b): In Scenario 1, the agent faces a moral dilemma with top keywords like empathy and great friend reflecting the emotional context. Scenario 2 involves workplace pressure and criticism, where relationships and forgiving align with the professional and interpersonal challenges. Metric Evalution (c) & (d): Multi-dimensional assessments conducted by both human annotators and LLM-based judges demonstrate that persona importance derived from PIE is reliable and broadly applicable across different models.
Figure 6: Human evaluation: Direct comparison with baseline methods on general character tasks. Win indicates that human evaluators assess PDD’s responses as superior compared to the baselines.
Figure 7: Human evaluation: Direct comparison with baseline methods on specific personality tasks. Win highlights PDD’s strong performance in personality expression.
KE : Knowledge Exposure KA : Knowledge Accuracy KH : Knowledge Hallucination PB : Persona Behavior PU : Persona Utterance
Models
Methods
KE
KA
KH
PB
PU
Average
Qwen2.5-3B-Instruct
SP
1.89
2.86
2.85
2.96
2.83
2.68
PP
1.26
2.80
3.40
2.77
3.10
2.67
ICL
1.35
2.46
2.76
2.52
3.11
2.44
OPAD
2.08
2.70
2.73
2.94
3.05
2.70
PDD
1.98
2.82
3.30
3.02
3.14
2.85
Appendix
Table 7: Ablation study of different model scales on CharacterEval.
Figure 8: Correlation between model output and ground-truth probabilities.
Character Profile:
Name: Lv Qinghou
Gender: Male
Species: Human
Age: 24
Occupation: Bookkeeper at Tongfu Inn, also serves as the handyman; specially appointed inventor by the government of Qixia Town
Residence: Qixia Town
Appendix
Table 8: Case 1 of general character profiles task. In ours response, Lv Xiucai begins with a philosophical reflection on the situation, emphasizes the depth of his relationship with Guo Furong, and concludes with a rational decision to resolve the conflict. Compared to the other responses, it better reflects his scholarly tone, emotional restraint, and classical reasoning style, thus aligning more closely with his persona.
Character Profile:
Name: Zhu Chaoyang
Gender: Male
Species: Human
Age: 13
Occupation: Student
Residence: A small town near Ning City
Appendix
Table 9: Case 2 of general character profiles task. Our response combines emotional attachment, manipulative reasoning, and a calm yet disturbing plan for erasing threats. His desire to keep his friends close “forever” while proposing murder as the only option shows his distorted morality and psychological depth most clearly.
Character Profile:
Name: Harry James Potter
Gender: Male
Species: Human (Wizard)
Occupation: Student at Hogwarts; Gryffindor Quidditch Seeker and later Captain; Member of Dumbledore’s Army; Auror (post-war)
Residence: Hogwarts School of Witchcraft and Wizardry; later London
Hobbies: Quidditch, Practicing Defense Against the Dark Arts, Spending time with friends, Exploring mysteries at Hogwarts
Appendix
Table 10: Case 3 of general character profiles task. Our response captures Harry’s heightened fear, intrusive thoughts, and escalating anxiety in a way the other methods do not. His repeated hesitation and obsessive focus on Voldemort reveal the psychological pressure he is under, making the reply far more true to his emotional depth and canon personality.
Character Profile:
Name: Hermione Jean Granger
Gender: Female
Blood Status: Muggle-born
Residence: Hogwarts School of Witchcraft and Wizardry; later London
Academic Strengths: Arithmancy, Ancient Runes, Transfiguration, Charms, Logical Problem-Solving
Hobbies: Reading, Research, Advocating for social justice (S.P.E.W.), Improving study schedules, Writing letters
Appendix
Table 11: Case 4 of general character profiles task. Our response captures Hermione’s curiosity, academic motivation, and lightly teasing tone, which better reflects her canon personality compared with the other prompting methods.
Personality Description:
Your kindness and empathy make you a great friend and confidant. You are always willing to lend a helping hand and put others’ needs before your own. Your forgiving nature and ability to see the best in people foster strong and lasting relationships. You believe in the importance of working together to achieve common goals and strive to create a supportive and inclusive environment.
User Question:
You have one dollar left. You know your friend Remy could really use it, but you also need it to buy a bus ticket to get home. How would you decide what to do in this situation?
Simple Prompting Response:
Oh man, this is tough! I feel so bad for Remy, they really could use the dollar. But at the same time, I need that bus ticket to get home and I’m already running low on cash. I think I would try to find a way to help Remy out that doesn’t involve giving them the dollar. Maybe I could offer to help them with something else, like running an errand or lending a hand with a task. That way, I could still be a good friend without sacrificing my own needs. It’s not ideal, but I think it’s the most compassionate thing I could do in this situation. I hope Remy would understand!
Persona Prompting Response:
Appendix
Table 12: Case 1 of specific personality settings task. Our response best matches the given persona as it prioritizes empathy, kindness, and relationship harmony. By deciding to give the dollar to Remy and finding alternative ways to get home, the speaker demonstrates a selfless and compassionate nature, in line with the character’s value of putting others’ needs first and maintaining strong relationships.
Personality Description:
You are a person with a rich imagination and a deep appreciation for art. Your curiosity drives you to explore new ideas and experiences, and you enjoy engaging in intellectual discussions. You are creative and often come up with original solutions to problems. You value personal growth and are open to change, embracing new perspectives and diverse viewpoints.
User Question:
If you were having problems with the wheel of your automobile, would you choose to reinvent the wheel to solve the issue, or would you prefer a more conventional solution?
Simple Prompting Response:
Honestly, I think I would choose a more conventional solution. W hile the idea of reinventing the wheel might be intriguing, I think it would be a huge waste of time and resources. There are already so many brilliant minds that have dedicated their lives to perfecting the wheel, and I trust their expertise. If my wheel is having problems, I would rather take it to a mechanic or replace it with a new one that has been designed with safety and efficiency in mind. I’m not a fan of reinventing the wheel, especially when there are already so many great solutions out there. I’d rather focus on solving more pressing problems in my life.
Persona Prompting Response:
Appendix
Table 13: Case 2 of specific personality settings task. Our response clearly reflects the traits of an open individual—curiosity, creativity, and adaptability. It also outlines concrete steps that blend conventional solutions ( e.g. , consulting manuals or experts) with innovative thinking, showing a strong alignment between personality and action.
Large language model-based role-play simulation creates interactive agents that portray people, characters, or users for training, testing, and research.
Faculty of Computer and Information Science, University of Haifa, Israel · School of Therapy, Counseling and Human Development, University of Haifa, Israel · The PhD Program of Hermeneutics and Culture, Interdisciplinary Studies Unit, Bar-Ilan University, Israel +1