Elamur Research⌕
☰
home / papers / 2026 / Deriving Character Logic from Storyline as Codified Decision Trees

Deriving Character Logic from Storyline as Codified Decision Trees

Paper · 2026 · Letian Peng, Kun Zhou, Longfei Yun et al.

Summary

Role-playing (RP) agents built on LLMs usually rely on free-text character profiles. These profiles are hard to verify, cannot be executed, and tend to mix behaviors from different situations, so agents act inconsistently. The authors propose Codified Decision Trees (CDT), which learn a character's behavioral logic directly from storyline (scene, action) pairs.

The method works in three steps:

  • Similar pairs are clustered with text embeddings.
  • An LLM proposes "if condition then behavior" triggers for each cluster.
  • Each trigger is checked against the full data. Reliable triggers become tree nodes, weak ones are dropped, and partially valid ones are refined into subtrees.

At inference, a new scene is routed through the tree by answering yes/no questions at each branch. Only the statements on the visited path are given to the RP model as grounding.

The authors evaluate CDT on an extended Fandom benchmark and a new Bandori benchmark covering 85 characters from 16 artifacts. CDT beats fine-tuning, retrieval-based in-context learning, earlier profiling methods, and even human-written profiles. This suggests that structured, data-validated profiles give more reliable and inspectable character grounding.

Key points

  • Datasets: the fine-grained Fandom benchmark has 45 characters and 20,778 scene–action pairs. The Bandori benchmark adds 40 characters and 7,866 pairs, plus 77,182 extra event-story conversation pairs from "BanG Dream!".
  • Evaluation: gains appear across all judged dimensions (intent, emotion, content, stance, causality), with the largest improvements in intent and causality.
  • Cross-story test: CDTs were trained only on the opening half of each band's main storyline. On 100 sampled wild event-story pairs per band member, they still beat vanilla prompting and human profiles for all eight bands.
  • Analysis: CDTs converted into wiki-style text profiles still outperform human-written ones. More training data yields stronger CDTs. Goal-driven relation-specific trees (+GD) improve results for all nine tested character pairs.
  • Resources: code and data are released at github.com/KomeijiForce/Codified_Decision_Tree.
  • Limitations: CDT is built offline and stays static, and it does not use canonical persona information.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

 Institutions

 Fields, topics and concepts

📚 Shelves 2The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 works

Cite

Cite as Letian Peng, Kun Zhou, Longfei Yun, Yupeng Hou and Jingbo Shang. 2026. Deriving Character Logic from Storyline as Codified Decision Trees. Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2026.acl-long.568

@inproceedings{peng2026deriving,
  title = {{Deriving Character Logic from Storyline as Codified Decision Trees}},
  author = {Letian Peng, Kun Zhou, Longfei Yun, Yupeng Hou and Jingbo Shang},
  booktitle = {Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
  year = {2026},
  doi = {10.18653/v1/2026.acl-long.568},
  url = {https://doi.org/10.18653/v1/2026.acl-long.568}
}

References

40 references, 15 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. Jiangjie Chen, Xintao Wang, Rui Xu, Siyu Yuan, Yikai Zhang, Wei Shi, Jian Xie, Shuang Li, Ruihan Yang, Tinghui Zhu, Aili Chen, Nianqi Li, Lida Chen, Caiyu Hu, Siye Wu, Scott Ren, Ziquan Fu, and Yanghua Xiao. 2024. From persona to personalization: A survey on role-playing language agents. Preprint, a…
  2. Jiangjie Chen, Xintao Wang, Rui Xu, Siyu Yuan, Yikai Zhang, Wei Shi, Jian Xie, Shuang Li, Ruihan Yang, Tinghui Zhu, et al. From persona to personalization: A survey on role-playing language agents. Transactions on Machine Learning Research.
  3. Xilong Cheng, Yunxiao Qin, Yuting Tan, Zhengnan Li, Ye Wang, Hongjiang Xiao, and Yuan Zhang. 2025. Psymem: Fine-grained psychological alignment and explicit memory control for advanced role-playing llms. arXiv preprint arXiv:2505.12814. find
  4. Xiangyu Robin Gan, Yuxin Ray Song, Nick Walker, and Maya Cakmak. 2024. Can large language models help developers with robotic finite state machine modification? arXiv preprint arXiv:2412.05625. — [arXiv:2412.05625](https://arxiv.org/abs/2412.05625) find
  5. Luyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon, Pengfei Liu, Yiming Yang, Jamie Callan, and Graham Neubig. 2023. Pal: Program-aided language models. In International Conference on Machine Learning, pages 10764–10799. PMLR. find
  6. Tianyu Gao, Xingcheng Yao, and Danqi Chen. 2021. Simcse: Simple contrastive learning of sentence embeddings. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, EMNLP 2021, Virtual Event / Punta Cana, Dominican Republic, 7-11 November, 2021, pages 6894– 6910. A…
  7. Alexander Gurung and Mirella Lapata. 2025. Learning to reason for long-form story generation. CoRR, abs/2503.22828. — [arXiv:2503.22828](https://arxiv.org/abs/2503.22828) find
  8. Pengcheng He, Jianfeng Gao, and Weizhu Chen. 2021. Debertav3: Improving deberta using electra-style pre-training with gradient-disentangled embedding sharing. arXiv preprint arXiv:2111.09543.
  9. Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. 2022. Lora: Low-rank adaptation of large language models. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net.
  10. Shilong Li, Yancheng He, Hangyu Guo, Xingyuan Bu, Ge Bai, Jie Liu, Jiaheng Liu, Xingwei Qu, Yangguang Li, Wanli Ouyang, et al. 2024. Graphreader: Building graph-based agent to enhance long-context abilities of large language models. In Findings of the Association for Computational Linguistics: EMNLP… find
  11. Yujia Li, David Choi, Junyoung Chung, Nate Kushman, Julian Schrittwieser, Rémi Leblond, Tom Eccles, James Keeling, Felix Gimeno, Agustin Dal Lago, et al. 2022. Competition-level code generation with alphacode. Science, 378(6624):1092–1097.
  12. Jacky Liang, Wenlong Huang, Fei Xia, Peng Xu, Karol Hausman, Brian Ichter, Pete Florence, and Andy Zeng. 2022. Code as policies: Language model programs for embodied control. arXiv preprint arXiv:2209.07753. find
  13. Zeyang Liu, Xinrui Yang, Shiguang Sun, Long Qian, Lipeng Wan, Xingyu Chen, and Xuguang Lan. 2024. Grounded answers for multi-agent decision-making problem through generative world model. Advances in Neural Information Processing Systems, 37:46622– 46652. find
  14. Ilya Loshchilov and Frank Hutter. 2019. Decoupled weight decay regularization. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net. find
  15. Zekun Moore Wang, Zhongyuan Peng, Haoran Que, Jiaheng Liu, Wangchunshu Zhou, Yuhan Wu, Hongcheng Guo, Ruitong Gan, Zehao Ni, Jian Yang, et al. 2024. Rolellm: benchmarking, eliciting, and enhancing role-playing abilities of large language models. Findings of the Association for Computational Linguist…
  16. Letian Peng and Jingbo Shang. 2024. Quantifying and optimizing global faithfulness in persona-driven role-playing. In Advances in Neural Information Processing Systems 38: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver, BC, Canada, December 10 - 15, 2024. 12… find
  17. Letian Peng and Jingbo Shang. 2025. Codifying character logic in role-playing. In Proceedings of the Thirty-Ninth Annual Conference on Neural Information Processing Systems (NeurIPS 2025) Poster Session. Poster presentation, NeurIPS 2025. find
  18. Letian Peng, Yuwei Zhang, Zilong Wang, Jayanth Srinivasa, Gaowen Liu, Zihan Wang, and Jingbo Shang. 2024. Answer is all you need: Instruction-following text embedding via answering the question. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Lon… find
  19. Yiting Ran, Xintao Wang, Tian Qiu, Jiaqing Liang, Yanghua Xiao, and Deqing Yang. 2025. BOOK-WORLD: from novels to interactive agent societies for story creation. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), ACL 2025, Vienna, Aust… find
  20. Mark Riedl and Vadim Bulitko. 2012. Interactive narrative: A novel application of artificial intelligence for computer games. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 26, pages 2160–2165. find
  21. Yunfan Shao, Linyang Li, Junqi Dai, and Xipeng Qiu. 2023a. Character-llm: A trainable agent for role-playing. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 13153–13187.
  22. Yunfan Shao, Linyang Li, Junqi Dai, and Xipeng Qiu. 2023b. Character-llm: A trainable agent for role-playing. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, EMNLP 2023, Singapore, December 6-10, 2023, pages 13153–13187. Association for Computational Lingui…
  23. Libo Sun, Siyuan Wang, Xuanjing Huang, and Zhongyu Wei. 2024. Identity-driven hierarchical role-playing agents. arXiv preprint arXiv:2407.19412. — [arXiv:2407.19412](https://arxiv.org/abs/2407.19412) find
  24. Yihong Tang, Kehai Chen, Muyun Yang, Zhengyu Niu, Jing Li, Tiejun Zhao, and Min Zhang. 2025. Thinking in character: Advancing role-playing agents with role-aware reasoning. arXiv preprint arXiv:2506.01748. — [arXiv:2506.01748](https://arxiv.org/abs/2506.01748) find
  25. Liang Wang, Nan Yang, and Furu Wei. 2024a. Learning to retrieve in-context examples for large language models. In Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1752–1767, St. Julian’s, Malta. Association for…
  26. Xiaochen Wang, Junqing He, Liang Chen, Gholamreza Haffari, Yiru Wang, Zhe Yang, Xiangdi Meng, Kunhao Pan, and Zhifang Sui. 2025a. Sg-fsm: A self-guiding zero-shot prompting paradigm for multi-hop question answering based on finite state machine. In Findings of the Association for Computational Lingu… find
  27. Xiaochen Wang, Junqing He, Yiru Wang, Xiangdi Meng, Kunhao Pan, Zhifang Sui, et al. 2024b. Fsm: A finite state machine based zero-shot prompting paradigm for multi-hop question answering. arXiv preprint arXiv:2407.02964. — [arXiv:2407.02964](https://arxiv.org/abs/2407.02964) find
  28. Xintao Wang, Heng Wang, Yifei Zhang, Xinfeng Yuan, Rui Xu, Jen-tse Huang, Siyu Yuan, Haoran Guo, Jiangjie Chen, Wei Wang, Yanghua Xiao, and Shuchang Zhou. 2025b. Coser: Coordinating llm-based persona simulation of established roles. CoRR, abs/2502.09082. — [arXiv:2502.09082](https://arxiv.org/abs/2502.09082) find
  29. Xintao Wang, Yunze Xiao, Jen-tse Huang, Siyu Yuan, Rui Xu, Haoran Guo, Quan Tu, Yaying Fei, Ziang Leng, Wei Wang, Jiangjie Chen, Cheng Li, and Yanghua Xiao. 2024c. Incharacter: Evaluating personality fidelity in role-playing agents through psychological interviews. In Proceedings of the 62nd Annual…
  30. Jimmy Wu, Rika Antonova, Adam Kan, Marion Lepert, Andy Zeng, Shuran Song, Jeannette Bohg, Szymon Rusinkiewicz, and Thomas Funkhouser. 2023. Tidybot: Personalized robot assistance with large language models. Autonomous Robots, 47(8):1087– 1102. find
  31. Ming Yan, Ruihao Li, Hao Zhang, Hao Wang, Zhi-lan Yang, and Ji Yan. 2023. Larp: Language-agent role play for open-world games. arXiv preprint arXiv:2312.17653. — [arXiv:2312.17653](https://arxiv.org/abs/2312.17653) find
  32. An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, Chujie Zheng, Dayiheng Liu, Fan Zhou, Fei Huang, Feng Hu, Hao Ge, Haoran Wei, Huan Lin, Jialong Tang, Jian Yang, Jianhong Tu, Jianwei Zhang, Jian Yang, Jiaxi Yang, Jingren Zhou, Jun… — Qwen3 Technical Report
  33. Diyi Yang. 2024. Human-ai interaction in the age of large language models. In Proceedings of the AAAI 2024 Spring Symposium Series, Stanford, CA, USA, March 25-27, 2024, pages 66–67. AAAI Press. find
  34. Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. 2023. 12490 11 find
  35. React: Synergizing reasoning and acting in language models. In International Conference on Learning Representations (ICLR).
  36. Jing Ye, Lu Xiang, Yaping Zhang, and Chengqing Zong. 2025. Sweetiechat: A strategy-enhanced role-playing framework for diverse scenarios handling emotional support agent. In Proceedings of the 31st International Conference on Computational Linguistics, COLING 2025, Abu Dhabi, UAE, January 19-24, 202…
  37. Takuma Yoneda, Jiading Fang, Peng Li, Huanyu Zhang, Tianchong Jiang, Shengjie Lin, Ben Picker, David Yunis, Hongyuan Mei, and Matthew R Walter. 2024. Statler: State-maintaining language models for embodied reasoning. In 2024 IEEE International Conference on Robotics and Automation (ICRA), pages 1508… find
  38. Pengfei Yu, Dongming Shen, Silin Meng, Jaewon Lee, Weisu Yin, Andrea Yaoyun Cui, Zhenlin Xu, Yi Zhu, Xingjian Shi, Mu Li, and Alex Smola. 2025. RPG-BENCH: evaluating large language models as role-playing game engines. CoRR, abs/2502.00595. — [arXiv:2502.00595](https://arxiv.org/abs/2502.00595) find
  39. Lin Zhang, Zihan Liu, Yuchen Zhou, Tong Wu, and Jintao Sun. 2024. Grounding large language models in real-world environments using imperfect world models. IJACSA) International Journal of Advanced Computer Science and Applications. find
  40. Yanzhao Zhang, Mingxin Li, Dingkun Long, Xin Zhang, Huan Lin, Baosong Yang, Pengjun Xie, An Yang, Dayiheng Liu, Junyang Lin, Fei Huang, and Jingren Zhou. 2025. Qwen3 embedding: Advancing text embedding and reranking through foundation models. CoRR, abs/2506.05176. 12491 12

Updated

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/peng-2026-deriving-character-logic-storyline-as/