用对比稀疏自编码器实现角色性格的精准可控,保持对话一致性。
Facet-Level Persona Control by Trait-Activated Routing with Contrastive SAE for Role-Playing LLMs
- 基于大五人格30维度构建细粒度性格向量,通过对比学习训练
- 在15,000样本数据集上实现各性格维度平衡监督,稳定控制角色行为
- 动态路由模块按性格特质选择向量,适合需要精细人格控制的应用
角色扮演智能体的性格控制通常依赖无需训练的方法,如通过提示或检索增强生成注入人格描述,或通过有监督微调在特定人格语料上训练。尽管微调有效,但需标注数据且换角色需重新训练,灵活性差。而提示和RAG方法虽易应用,但在长对话中易被稀释,导致性格漂移与不一致。为此,我们提出一种对比稀疏自编码器(SAE)框架,学习与大五人格30维度模型对齐的细粒度性格控制向量。构建了一个包含15,000样本、去泄漏的语料库,为每个维度提供均衡监督。学习到的向量嵌入模型残差空间,并由特质激活路由模块动态选择,实现精确可解释的性格引导。在大型语言模型上的实验表明,该方法在情境化设置下维持了稳定的角色忠实度与输出质量,优于对比激活添加(CAA)和仅提示基线。结合SAE+提示配置达到最佳整体表现,验证了对比训练的潜在向量能增强人格控制并保持对话连贯性。数据集已开源:https://github.com/lunat5078/BigFive-Personality-Facets-Dataset
原文摘要 · Abstract (English)
Personality control in Role-Playing Agents (RPAs) is commonly achieved via training-free methods that inject persona descriptions and memory through prompts or retrieval-augmented generation, or via supervised fine-tuning (SFT) on persona-specific corpora. While SFT can be effective, it requires persona-labeled data and retraining for new roles, limiting flexibility. In contrast, prompt- and RAG-based signals are easy to apply but can be diluted in long dialogues, leading to drifting and sometimes inconsistent persona behavior. To address this, we propose a contrastive Sparse AutoEncoder (SAE) framework that learns facet-level personality control vectors aligned with the Big Five 30-facet model. A new 15,000-sample leakage-controlled corpus is constructed to provide balanced supervision for each facet. The learned vectors are integrated into the model's residual space and dynamically selected by a trait-activated routing module, enabling precise and interpretable personality steering. Experiments on Large Language Models (LLMs) show that the proposed method maintains stable character fidelity and output quality across contextualized settings, outperforming Contrastive Activation Addition (CAA) and prompt-only baselines. The combined SAE+Prompt configuration achieves the best overall performance, confirming that contrastively trained latent vectors can enhance persona control while preserving dialogue coherence. Dataset is available at: https://github.com/lunat5078/BigFive-Personality-Facets-Dataset
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。