Lune

NeurIPS2025顶会

Codifying Character Logic in Role-Playing

Letian Peng, Jingbo Shang

摘要

This paper introduces Codified Profiles for role-playing, a novel approach that represents character logic as structured, executable functions for behavioral decisionmaking. Converted by large language model (LLM) from textual profiles, each codified profile defines a set of functions parse_by_scene(scene) that output multiple logic-grounded assertions according to scene, using both explicit control structures (e.g., if-then-else) and flexible check_condition(scene, question) functions where each question is a semantically meaningful prompt about the scene (e.g., "Is the character in danger?") discriminated by the roleplaying LLM as true, false, or unknown. This explicit representation offers three key advantages over traditional prompt-based textual 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 natural language inference (NLI)-based scoring to compare character responses against ground-truths. 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 an efficient, lightweight foundation for local deployment of role-play agents. 2

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 3 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Dense Passage Retrieval for Open-Domain Question Answering 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks 引用了 Dense Passage Retrieval for Open-Domain Question Answering
  • Reflexion: language agents with verbal reinforcement learning 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • CRPO: Character-centric Group Relative Policy Optimization for Role-aware Reasoning in Role-playing Agents 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • CRPO: Character-centric Group Relative Policy Optimization for Role-aware Reasoning in Role-playing Agents 引用了 Deriving Character Logic from Storyline as Codified Decision Trees
  • Codified Finite-state Machines for Role-playing 引用了 Reflexion: language agents with verbal reinforcement learning
  • Codified Finite-state Machines for Role-playing 引用了 DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing
  • Deriving Character Logic from Storyline as Codified Decision Trees 引用了 DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper3

  1. Deriving Character Logic from Storyline as Codified Decision TreesLetian Peng, Kun Zhou, Longfei Yun, Yupeng Hou 等ACL 2026 · 3 次引用
  2. Codified Finite-state Machines for Role-playingLetian Peng, Yupeng Hou, Kun Zhou, Jingbo ShangICLR 2026 · 1 次引用
  3. CRPO: Character-centric Group Relative Policy Optimization for Role-aware Reasoning in Role-playing AgentsYihong Tang, Kehai Chen, Liang Yue, Benyou Wang 等ICML 2026

它引用的 Paper17

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  2. Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni 等NeurIPS 2020 · 19,162 次引用
  3. Reflexion: language agents with verbal reinforcement learningNoah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan 等NeurIPS 2023 · 5,828 次引用
  4. DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding SharingPengcheng He, Jianfeng Gao, Weizhu ChenICLR 2023 · 394 次引用
  5. Dense Passage Retrieval for Open-Domain Question AnsweringVladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis 等EMNLP 2020 · 142 次引用

相关 Paper

  1. Beyond Dialogue: A Profile-Dialogue Alignment Framework Towards General Role-Playing Language ModelYeyong Yu, Runsheng Yu, Haojie Wei, Zhanqiu Zhang 等ACL 2025 · 13 次引用
  2. RoleLLM: Benchmarking, Eliciting, and Enhancing Role-Playing Abilities of Large Language ModelsNoah Wang, Zhongyuan Peng, Haoran Que, Jiaheng Liu 等ACL Findings 2024 · 120 次引用
  3. R-CHAR: A Metacognition-Driven Framework for Role-Playing in Large Language ModelsHaiming Qin, Jiwei Zhang, Wei Zhang, Kezhong Lu 等EMNLP 2025
  4. Memory-Driven Role-Playing: Evaluation and Enhancement of Persona Knowledge Utilization in LLMsKai Wang, Haoyang You, Yang Zhang, Zhongjie WangACL Findings 2026
  5. Mitigating Hallucination in Fictional Character Role-PlayNafis Sadeq, Zhouhang Xie, Byungkyu Kang, Prarit Lamba 等EMNLP Findings 2024 · 6 次引用
黄昏的海面,两侧是细线勾勒的悬崖