无需重训练,解码时实现多性格文本生成。
Multi-Personality Generation of LLMs at Decoding-time
- 利用单维度模型隐含密度比,实现多性格灵活控制。
- 提出滑动窗口批处理拒绝采样,计算开销降低且生成质量高。
- 适用于角色扮演与性格化生成,适合需要多样输出的场景。
大语言模型的多性格生成是核心挑战。现有基于重训练的方法成本高、扩展性差,而解码阶段方法常依赖外部模型或启发式规则,灵活性与鲁棒性受限。本文提出一种新的解码时多性格生成(MPG)框架,通过单维度模型中隐含的密度比,将任务转化为从目标策略中采样,实现无需多维模型或额外训练的灵活控制。为高效实现,设计了基于推测的分块拒绝采样(SCR),以块为单位生成并行验证,通过滑动窗口内估计阈值显著降低计算开销。在MBTI性格和角色扮演任务上的实验表明,该方法性能提升达16%-18%。代码与数据已公开于 https://github.com/Libra117/MPG。
原文摘要 · Abstract (English)
Multi-personality generation for LLMs, enabling simultaneous embodiment of multiple personalization attributes, is a fundamental challenge. Existing retraining-based approaches are costly and poorly scalable, while decoding-time methods often rely on external models or heuristics, limiting flexibility and robustness. In this paper, we propose a novel Multi-Personality Generation (MPG) framework under the decoding-time combination paradigm. It flexibly controls multi-personality without relying on scarce multi-dimensional models or extra training, leveraging implicit density ratios in single-dimensional models as a "free lunch" to reformulate the task as sampling from a target strategy aggregating these ratios. To implement MPG efficiently, we design Speculative Chunk-level based Rejection sampling (SCR), which generates responses in chunks and parallelly validates them via estimated thresholds within a sliding window. This significantly reduces computational overhead while maintaining high-quality generation. Experiments on MBTI personality and Role-Playing demonstrate the effectiveness of MPG, showing improvements up to 16%-18%. Code and data are available at https://github.com/Libra117/MPG .
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。