Training Chain-of-Thought via Latent-Variable Inference
作者: Du Phan, Matthew D. Hoffman, David Dohan, Sholto Douglas, Tuan Anh Le, Aaron Parisi, Pavel Sountsov, Charles Sutton, Sharad Vikram, Rif A. Saurous
分类: cs.LG, cs.AI, cs.CL
发布日期: 2023-11-28
备注: 23 pages, 37th Conference on Neural Information Processing Systems (NeurIPS 2023)
💡 一句话要点
提出通过潜变量推断训练链式思维以提升LLM性能
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 链式思维 潜变量推断 马尔可夫链蒙特卡洛 期望最大化 大型语言模型 监督微调 推理能力 模型优化
📋 核心要点
- 现有方法在结合链式思维与监督微调时,需要对详细推理进行监督,人工生成成本高昂。
- 本文提出了一种新的微调策略,通过最大化生成正确答案的边际对数似然,避免了对详细推理的直接监督。
- 实验结果表明,所提MCMC-EM微调技术在GSM8K和BIG-Bench Hard任务上显著提高了模型的准确性。
📝 摘要(中文)
大型语言模型(LLMs)在使用“链式思维”(CoT)提示逐步解决问题时,能够更准确和可解释地得出答案。通过监督微调,可以提高LLMs在特定任务上的表现,但简单地将CoT与监督微调结合需要对正确答案及其详细推理进行监督,这种推理的人工生成成本高昂。为此,本文提出了一种微调策略,旨在最大化生成正确答案的边际对数似然,近似平均所有可能的推理。核心挑战在于从条件于正确答案的推理后验中进行采样,本文采用了一种简单的马尔可夫链蒙特卡洛(MCMC)期望最大化(EM)算法,结合了自学习推理器(STaR)、记忆化的觉醒-睡眠、马尔可夫评分爬升和持久对比散度等方法。应用该技术于GSM8K和BIG-Bench Hard任务,结果表明该MCMC-EM微调技术通常比STaR或提示微调方法在持出样本上的准确率更高。
🔬 方法详解
问题定义:本文旨在解决大型语言模型在结合链式思维与监督微调时,需对详细推理进行监督的问题。现有方法在这一过程中面临高昂的人工成本和复杂性。
核心思路:论文提出通过最大化生成正确答案的边际对数似然,来近似平均所有可能的推理,从而避免对每个推理的详细监督。该方法利用马尔可夫链蒙特卡洛(MCMC)技术进行推理后验的采样。
技术框架:整体流程包括使用MCMC算法进行推理后验的采样,结合期望最大化(EM)方法进行参数优化。主要模块包括推理生成、后验采样和模型更新。
关键创新:最重要的创新在于引入了一种新的控制变量技术,使得随着模型的改进,梯度估计的方差趋近于零。这一设计显著提升了微调的稳定性和效率。
关键设计:在参数设置上,采用了基于MCMC的采样策略,并结合了多种优化技术,如记忆化的觉醒-睡眠和持久对比散度,以提高模型的学习效果。
🖼️ 关键图片
📊 实验亮点
实验结果显示,所提出的MCMC-EM微调技术在GSM8K和BIG-Bench Hard任务上,模型的准确率普遍高于STaR和其他提示微调方法,具体提升幅度未明确给出,但整体表现显著优于基线。
🎯 应用场景
该研究的潜在应用领域包括教育、自动问答系统和智能助手等,能够帮助提升大型语言模型在复杂推理任务中的表现。未来,该方法可能推动更多基于推理的AI应用的发展,提升其在实际场景中的可用性和可靠性。
📄 摘要(原文)
Large language models (LLMs) solve problems more accurately and interpretably when instructed to work out the answer step by step using a ``chain-of-thought'' (CoT) prompt. One can also improve LLMs' performance on a specific task by supervised fine-tuning, i.e., by using gradient ascent on some tunable parameters to maximize the average log-likelihood of correct answers from a labeled training set. Naively combining CoT with supervised tuning requires supervision not just of the correct answers, but also of detailed rationales that lead to those answers; these rationales are expensive to produce by hand. Instead, we propose a fine-tuning strategy that tries to maximize the \emph{marginal} log-likelihood of generating a correct answer using CoT prompting, approximately averaging over all possible rationales. The core challenge is sampling from the posterior over rationales conditioned on the correct answer; we address it using a simple Markov-chain Monte Carlo (MCMC) expectation-maximization (EM) algorithm inspired by the self-taught reasoner (STaR), memoized wake-sleep, Markovian score climbing, and persistent contrastive divergence. This algorithm also admits a novel control-variate technique that drives the variance of our gradient estimates to zero as the model improves. Applying our technique to GSM8K and the tasks in BIG-Bench Hard, we find that this MCMC-EM fine-tuning technique typically improves the model's accuracy on held-out examples more than STaR or prompt-tuning with or without CoT.