Enhancing Persona Following at Decoding Time via Dynamic Importance Estimation for Role-Playing Agents
Organizations: University of Science and Technology of China
Abstract
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
| 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 |
| 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 | |
| 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 |
| 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 |
| Decoding Method | Quality of | 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 |
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% |
| 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 | |
| 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 |
| Character Profile: |
| Name: Zhu Chaoyang |
| Gender: Male |
| Species: Human |
| Age: 13 |
| Occupation: Student |
| Residence: A small town near Ning City |
| 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 |
| 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 |
| 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: |
| 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: |
Large Language Model-Based Role-Play Simulation
Large language model-based role-play simulation creates interactive agents that portray people, characters, or users for training, testing, and research.
See all 106 papers