通过分步生成意图,让大模型输出更多样且高质量的文本。
Intent Factored Generation: Unleashing the Diversity in Your Language Model
- 先采样语义密集的意图(如关键词),再基于意图生成回答。
- 在数学和代码任务中,pass@k指标提升,推理效果更好。
- 适合需要多样化回复的对话系统、指令微调等场景。
固定提示下获取多个语义上多样且高质量的文本,仍是大语言模型的开放挑战。现有方法多仅在词元层面进行改写,导致推理任务探索不足,对话内容重复乏味。为此,我们提出意图因子化生成(IFG),将采样过程分为两步:首先采样一个语义密集的意图(如摘要或关键词),其次在原始提示和该意图共同条件下生成最终响应。此方法可在意图生成阶段使用更高温度以促进概念多样性,而在最终生成阶段使用较低温度以保证连贯性与自洽性。此外,我们在链式思维推理中发现,先让模型显式陈述每一步意图再生成,可显著提升表现。实验表明,IFG在多种任务中有效:在数学与代码任务中提升了pass@k及基于验证器反馈的强化学习性能;在指令微调中,结合直接偏好优化,实现对话多样性提升而奖励不降。我们还构建并开源了一个包含读者评论与新闻文章的新数据集,在通用语言建模任务中实现了更高多样性与保持生成质量。总之,本方法仅需调整提示与温度,即可轻松集成至各类算法中,广泛提升应用效果。
原文摘要 · Abstract (English)
Obtaining multiple meaningfully diverse, high quality samples from Large Language Models for a fixed prompt remains an open challenge. Current methods for increasing diversity often only operate at the token-level, paraphrasing the same response. This is problematic because it leads to poor exploration on reasoning problems and to unengaging, repetitive conversational agents. To address this we propose Intent Factored Generation (IFG), factorising the sampling process into two stages. First, we sample a semantically dense intent, e.g., a summary or keywords. Second, we sample the final response conditioning on both the original prompt and the intent from the first stage. This allows us to use a higher temperature during the intent step to promote conceptual diversity, and a lower temperature during the final generation to ensure the outputs are coherent and self-consistent. Additionally, we find that prompting the model to explicitly state its intent for each step of the chain-of-thought before generating the step is beneficial for reasoning tasks. We demonstrate our method's effectiveness across a diverse set of tasks. We show this method improves both pass@k and Reinforcement Learning from Verifier Feedback on maths and code tasks. For instruction-tuning, we combine IFG with Direct Preference Optimisation to increase conversational diversity without sacrificing reward. Finally, we achieve higher diversity while maintaining the quality of generations on a general language modelling task, using a new dataset of reader comments and news articles that we collect and open-source. In summary, we present a simple method of increasing the sample diversity of LLMs while maintaining performance. This method can be implemented by changing the prompt and varying the temperature during generation, making it easy to integrate into many algorithms for gains across various applications.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。