Lune

ACL2026Top-tier venue

Deriving Character Logic from Storyline as Codified Decision Trees

Letian Peng, Kun Zhou, Longfei Yun, Yupeng Hou, Jingbo Shang

Abstract

Role-playing (RP) agents rely on behavioral profiles to act consistently across diverse narrative contexts, yet existing profiles are largely unstructured, non-executable, and weakly validated, leading to brittle agent behavior. We propose Codified Decision Trees (CDT), a datadriven framework that induces an executable and interpretable decision structure from largescale narrative data. CDT represents behavioral profiles as a tree of conditional rules, where internal nodes correspond to validated scene conditions and leaves encode grounded behavioral statements, enabling deterministic retrieval of context-appropriate rules at execution time. The tree is learned by iteratively inducing candidate scene-action rules, validating them against data, and refining them through hierarchical specialization, yielding profiles that support transparent inspection and principled updates. Across multiple benchmarks, CDT substantially outperforms human-written profiles and prior profile induction methods on 85 characters across 16 artifacts, indicating that codified and validated behavioral representations lead to more reliable agent grounding. 1 1 Codes and datasets used in experiments are available at https://github.com/KomeijiForce/Codified_Decision_Tree Node 1-1 (ROOT) -Positive character -Direct expression Node 2-2 -Easily ignited -Active participation Node 2-1 -Popipa member -Vo.&Gt. position Node 2-3 -Poor at study -Always space out  2-2: An exciting plan comes?  2-1: Live or rehearsal?  2-3: In a class scene?  3-1: Others (e.g., Arisa) resist? Node 3-1 -Encourage other members Node 3-2 -Generally don't know the answer  3-2: Questioned by teacher? × (Crashes into the classroom) Hi, Kasumi! I've come up with a super good idea! Let's hold a live on the moon! That's gotta be super happy, right? Yeah ! Hold it, hold it, hold it! Why does moon = happy in your head?! And more importantly, there's no air on the moon! You'd suffocate before even playing a song! Tsurumaki Kokoro/弦巻こころ Ichigaya Arisa/市ヶ谷有咲 Ehh ? But that sounds amazing! Popipa's live on moon, shining under stars, kirakira! Don't worry, Arisa, we'll figure something out! It'll be fun! ♪ Toyama Kasumi/戸山香澄 Codified Decision Tree (CDT) for Toyama Kasumi/戸山香澄

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. CRPO: Character-centric Group Relative Policy Optimization for Role-aware Reasoning in Role-playing AgentsYihong Tang, Kehai Chen, Liang Yue, Benyou Wang et al.ICML 2026

Builds on15

  1. LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
  2. SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 2,496 citations
  3. PAL: Program-aided Language ModelsLuyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon et al.ICML 2023 · 700 citations
  4. DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding SharingPengcheng He, Jianfeng Gao, Weizhu ChenICLR 2023 · 394 citations
  5. Character-LLM: A Trainable Agent for Role-PlayingYunfan Shao, Linyang Li, Junqi Dai, Xipeng QiuEMNLP 2023 · 97 citations

Related papers

  1. Codifying Character Logic in Role-PlayingLetian Peng, Jingbo ShangNeurIPS 2025 · 7 citations
  2. DREAM: LLM-based Dynamic Role-playing via Event-Aware Memory GraphZhihao Xiao, Mengting Li, Xintao Wang, Linfeng Li et al.KDD 2026 · 1 citation
  3. Codified Finite-state Machines for Role-playingLetian Peng, Yupeng Hou, Kun Zhou, Jingbo ShangICLR 2026 · 1 citation
  4. Generative Models for Automatic Medical Decision Rule Extraction from TextYuxin He, Buzhou Tang, Xiaoling WangEMNLP 2024 · 2 citations
  5. NL2CA: Auto-formalizing Cognitive Decision-Making from Natural Language Using an Unsupervised CriticNL2LTL FrameworkZihao Deng, Yijia Li, Renrui Zhang, Peijun YeAAAI 2026
Dusk over the sea between two cliffs drawn in fine vertical lines