arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.05905cs.CL
收藏

编码有限状态机用于角色扮演

Codified Finite-state Machines for Role-playing

University of California, San Diego(加州大学圣地亚哥分校)

Letian Peng, Yupeng Hou, Kun Zhou, Jingbo Shang

AI总结:

本文提出编码有限状态机(CFSMs)和编码概率有限状态机(CPFSMs)框架,通过自动编码文本角色档案生成可解释的状态机,提升角色扮演中的一致性和随机性探索能力。

摘要:

在大型语言模型(LLMs)中建模潜在角色状态对于实现一致且引人入胜的角色扮演(RP)至关重要。然而,现有的基于提示的方法主要捕捉表层行为,往往无法跟踪驱动互动的潜在状态。我们重新审视有限状态机(FSMs),长期以来用于游戏设计中建模状态转换。虽然在小而明确的状态空间中效果显著,但传统的手工编写、基于规则的FSMs在RP的开放语义空间中难以适应。为了解决这一问题,我们引入了编码有限状态机(CFSMs),这是一种框架,利用LLM进行编码,将文本角色档案自动编码为FSMs。CFSMs直接从档案中提取关键状态和转换,生成可解释的结构,以确保角色一致性。为进一步捕捉不确定性和变异性,我们将CFSMs扩展为编码概率有限状态机(CPFSMs),其中转换被建模为状态上的概率分布。通过合成评估和已建立的艺术品中的真实世界RP场景,我们证明CFSM和CPFSM在结构任务和开放的随机状态探索中均优于一般应用的基线。

英文摘要:

Modeling latent character states is crucial for consistent and engaging role-playing (RP) with large language models (LLMs). Yet, existing prompting-based approaches mainly capture surface actions, often failing to track the latent states that drive interaction. We revisit finite-state machines (FSMs), long used in game design to model state transitions. While effective in small, well-specified state spaces, traditional hand-crafted, rule-based FSMs struggle to adapt to the open-ended semantic space of RP. To address this, we introduce Codified Finite-State Machines (CFSMs), a framework that automatically codifies textual character profiles into FSMs using LLM-based coding. CFSMs extract key states and transitions directly from the profile, producing interpretable structures that enforce character consistency. To further capture uncertainty and variability, we extend CFSMs into Codified Probabilistic Finite-State Machines (CPFSMs), where transitions are modeled as probability distributions over states. Through both synthetic evaluations and real-world RP scenarios in established artifacts, we demonstrate that CFSM and CPFSM outperform generally applied baselines, verifying effectiveness not only in structured tasks but also in open-ended stochastic state exploration.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑