arXiv:2507.16799cs.CL2025-07

无需训练,通过测试时匹配实现角色性格、记忆与语言风格解耦

Test-Time-Matching: Decouple Personality, Memory, and Linguistic Style in LLM-based Role-Playing Language Agent

  • 用三阶段生成流程自动分离角色的性格、记忆和语言风格
  • 人类评估显示对话表达生动且风格一致,表现优于现有方法
  • 适合需要快速部署角色扮演的交互系统开发者

大型语言模型(LLMs)的快速发展使基于角色的语言代理在各类应用中展现出巨大潜力。然而,仅依赖提示和上下文信息往往难以实现对特定角色(尤其是知名虚构或公众人物)的深度沉浸式表现。而基于微调的方法受限于数据收集困难和训练资源消耗,难以广泛推广。为此,我们提出测试时匹配(Test-Time-Matching, TTM)框架,一种无需训练的角色扮演方法,通过测试时扩展与上下文工程实现。TTM利用语言模型自动将角色特征解耦为性格、记忆和语言风格,并采用结构化的三阶段生成流程进行可控角色扮演。该方法不仅实现高保真角色表现,还支持不同语言风格间的无缝组合,甚至在性格与记忆上的灵活变化。通过人工评估验证,结果表明本方法在生成富有表现力且风格一致的角色对话方面表现优异。

原文摘要 · Abstract (English)

The rapid advancement of large language models (LLMs) has enabled role-playing language agents to demonstrate significant potential in various applications. However, relying solely on prompts and contextual inputs often proves insufficient for achieving deep immersion in specific roles, particularly well-known fictional or public figures. On the other hand, fine-tuning-based approaches face limitations due to the challenges associated with data collection and the computational resources required for training, thereby restricting their broader applicability. To address these issues, we propose Test-Time-Matching (TTM), a training-free role-playing framework through test-time scaling and context engineering. TTM uses LLM agents to automatically decouple a character's features into personality, memory, and linguistic style. Our framework involves a structured, three-stage generation pipeline that utilizes these features for controlled role-playing. It achieves high-fidelity role-playing performance, also enables seamless combinations across diverse linguistic styles and even variations in personality and memory. We evaluate our framework through human assessment, and the results demonstrate that our method achieves the outstanding performance in generating expressive and stylistically consistent character dialogues.

角色扮演LLM解耦生成测试时扩展

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。