Table of Contents
Fetching ...

Deriving Character Logic from Storyline as Codified Decision Trees

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

TL;DR

This paper tackles the brittleness and non-executability of traditional RP character profiles by introducing Codified Decision Trees (CDT), a data-driven framework that induces executable, situation-specific profiles from large-scale narrative data. CDT learns a hierarchical tree where internal nodes encode validated scene predicates and leaves store grounded behavioral statements, enabling deterministic retrieval of context-appropriate rules via CDT traversal. It couples recursive hypothesis-validation with clustering-based rule mining to produce compact, interpretable profiles that can be converted to textual wiki-like representations and generalized to open-domain interactions. Empirical results across fine-grained Fandom and Bandori benchmarks show CDT and its lightweight variant CDT-Lite outperform baselines and even human-written profiles, with strong data-scaling, relation modeling, and multi-modal extension potential, indicating practical impact for reliable, controllable RP systems.

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 data-driven framework that induces an executable and interpretable decision structure from large-scale 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.

Deriving Character Logic from Storyline as Codified Decision Trees

TL;DR

This paper tackles the brittleness and non-executability of traditional RP character profiles by introducing Codified Decision Trees (CDT), a data-driven framework that induces executable, situation-specific profiles from large-scale narrative data. CDT learns a hierarchical tree where internal nodes encode validated scene predicates and leaves store grounded behavioral statements, enabling deterministic retrieval of context-appropriate rules via CDT traversal. It couples recursive hypothesis-validation with clustering-based rule mining to produce compact, interpretable profiles that can be converted to textual wiki-like representations and generalized to open-domain interactions. Empirical results across fine-grained Fandom and Bandori benchmarks show CDT and its lightweight variant CDT-Lite outperform baselines and even human-written profiles, with strong data-scaling, relation modeling, and multi-modal extension potential, indicating practical impact for reliable, controllable RP systems.

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 data-driven framework that induces an executable and interpretable decision structure from large-scale 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 characters across artifacts, indicating that codified and validated behavioral representations lead to more reliable agent grounding.
Paper Structure (56 sections, 14 figures, 17 tables)

This paper contains 56 sections, 14 figures, 17 tables.

Figures (14)

  • Figure 1: Grounding RP by Codified Decision Tree.
  • Figure 2: The workflow of codified decision tree (CDT).
  • Figure 3: Performance scales up with training data.
  • Figure 4: The comparison between grounding methods with matching scores. (CDT represents CDT-Lite)
  • Figure 5: Comparison on open-ended RP by Human and LLM judgment. (CDT represents CDT-Lite)
  • ...and 9 more figures