mlsanityData to 14 Oct 2026

Codifying Character Logic in Role-Playing

arXiv 2505.07705 ↗First posted 12 May 2025cs.CLcited by 5

Not on the map. Why?

Abstract (arXiv)

This paper introduces Codified Profiles for role-playing, a novel approach that represents character logic as structured, executable functions for behavioral decision-making. Each profile defines a set of functions parse_by_scene(scene) that outputs a list of logic-grounded assertions triggered_statements, using both explicit control structures (e.g., if-then-else) and condition checks like check_condition(scene, question), where each question is a semantically meaningful prompt about the scene (e.g., "Is the character in danger?") discriminated by the role-playing LLM as true, false, or unknown. This explicit representation offers three key advantages over traditional prompt-based profiles, which append character descriptions directly into text prompts: (1) Persistence, by enforcing complete and consistent execution of character logic, rather than relying on the model's implicit reasoning; (2) Updatability, through systematic inspection and revision of behavioral logic, which is difficult to track or debug in prompt-only approaches; (3) Controllable Randomness, by supporting stochastic behavior directly within the logic, enabling fine-grained variability that prompting alone struggles to achieve. To validate these advantages, we introduce a new benchmark constructed from 83 characters and 5,141 scenes curated from Fandom, using NLI-based scoring to compare character responses against ground-truth actions. Our experiments demonstrate the significant benefits of codified profiles in improving persistence, updatability, and behavioral diversity. Notably, by offloading a significant portion of reasoning to preprocessing, codified profiles enable even 1B-parameter models to perform high-quality role-playing, providing a scalable and efficient foundation for local deployment of role-play agents.

Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 28 of its 44 references that are in the map. First posted on arXiv 12 May 2025.

Builds on

28 of 44 references.

References · 28

  1. 2023GPT-4 Technical Reportcited by 18,396
  2. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  3. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  4. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
  5. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
  6. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,824
  7. 2015A large annotated corpus for learning natural language inferencecited by 1,847
  8. 2021DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharingcited by 1,254
  9. 2022LaMDA: Language Models for Dialog Applicationscited by 1,220
  10. 2023LaMP: When Large Language Models Meet Personalizationcited by 437
  11. 2023Character-LLM: A Trainable Agent for Role-Playingcited by 339
  12. 2024From Persona to Personalization: A Survey on Role-Playing Language Agentscited by 212
16 more
  1. 2023InCharacter: Evaluating Personality Fidelity in Role-Playing Agents through Psychological Interviewscited by 179
  2. 2023RoleLLM: Benchmarking, Eliciting, and Enhancing Role-Playing Abilities of Large Language Modelscited by 175
  3. 2024Large Language Models and Games: A Survey and Roadmapcited by 93
  4. 2024Bias in Large Language Models: Origin, Evaluation, and Mitigationcited by 77
  5. 2023ChatHaruhi: Reviving Anime Character in Reality via Large Language Modelcited by 59
  6. 2021"Let Your Characters Tell Their Story": A Dataset for Character-Centric Narrative Understandingcited by 48
  7. 2024The Oscars of AI Theater: A Survey on Role-Playing with Language Modelscited by 48
  8. 2024Evaluating Character Understanding of Large Language Models via Character Profiling from Fictional Workscited by 38
  9. 2022End-to-end Spoken Conversational Question Answering: Task, Dataset and Modelcited by 37
  10. 2024Compress to Impress: Unleashing the Potential of Compressive Memory in Real-World Long-Term Conversationscited by 36
  11. 2023RECAP: Retrieval-Enhanced Context-Aware Prefix Encoder for Personalized Dialogue Response Generationcited by 25
  12. 2024Cognitive Personalized Search Integrating Large Language Models with an Efficient Memory Mechanismcited by 22
  13. 2024Mitigating Hallucination in Fictional Character Role-Playcited by 18
  14. 2024Quantifying and Optimizing Global Faithfulness in Persona-driven Role-playingcited by 17
  15. 2024Do LLMs Play Dice? Exploring Probability Distribution Sampling in Large Language Models for Behavioral Simulationcited by 14
  16. 2025RPGBENCH: Evaluating Large Language Models as Role-Playing Game Enginescited by 12

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 5.

5 papers.