[论文解读] PaD: Program-aided Distillation Can Teach Small Models Reasoning Better than Chain-of-thought Fine-tuning
本文提出程序辅助蒸馏(PaD),一种通过大型语言模型(LLMs)生成并过滤程序辅助推理数据来增强小型模型推理能力的方法,利用解释器实现自动错误检测。PaD 使一个 0.06B 参数的模型在 GSM8K 上超越 LLaMA-13B 和 PaLM-60B,实现 10% 的准确率提升,参数量减少 10 倍,训练数据减少 3 倍。
While large language models (LLMs) excel in various natural language processing tasks, their huge size and the inaccessibility of parameters present challenges for practical deployment. Previous studies try to distill task-specific ability from LLMs to smaller models, using data synthesis and chain-of-thought (CoT) fine-tuning. However, synthetic CoT data often contains faulty reasoning, which deteriorates the quality of distillation, especially in reasoning capabilities. In this work, we propose Program-aided Distillation (PaD), which introduces reasoning programs to suppress the errors in distilled data, and thus achieves better distillation quality for reasoning tasks. In PaD, we utilize the reasoning program to substitute the CoT, allowing automated error checking of synthetic data. Further, through error injecting and further training, the small distilling model could iteratively self-refine the reasoning. Moreover, we conduct a step-wise beam search by step-by-step verifying to acquire more exact reasoning chains. We evaluate PaD on arithmetic reasoning, symbolic reasoning, and general ability. Experimental results demonstrate that smaller models using PaD can not only outperform certain LLMs~(e.g., LLaMA-1 13B) but also achieve strong improvement over baselines with a significantly smaller scale of parameters and data. The source code is publicly available at https://github.com/Xuekai-Zhu/pad.
研究动机与目标
- 为高效地将大型语言模型(LLMs)的推理能力迁移至更小、可部署的小型模型提供解决方案。
- 解决链式思维(CoT)数据中幻觉化、有缺陷的推理步骤问题,此类问题会降低小型模型的性能。
- 通过利用程序辅助推理和自动错误检查,提升小型模型的数据效率和训练效果。
- 实现模型专业化——使小型模型具备强大的推理能力,同时最小化在通用能力上的权衡。
提出的方法
- 通过提示 LLM 生成类似 Python 的程序,表示算术问题的逐步推理过程,从而合成推理数据。
- 使用独立的 Python 解释器通过编译和执行自动验证推理程序,过滤掉错误或语法无效的样本。
- 通过将数值计算委托给解释器,实现推理与计算的解耦,确保最终答案的正确性。
- 在经过筛选的、可执行的程序辅助推理数据上微调小型模型,使其学习结构化、可验证的推理模式。
- 应用数据剪枝技术(忠实度、GraNd、熵)评估并排序训练样本的重要性,证明了高数据效率。
- 使用 gpt-3.5-turbo 生成高质量合成数据,并通过忠实度、逻辑性及信息量等指标进行验证。
实验结果
研究问题
- RQ1与标准链式思维微调相比,程序辅助推理数据生成与自动错误检查是否能提升小型模型的推理性能?
- RQ2PaD 是否能使更小的模型在 GSM8K 等推理基准测试中超越更大的 LLM,同时显著减少参数量和数据量?
- RQ3与基线蒸馏和微调方法相比,PaD 在数据效率与模型专业化权衡方面表现如何?
- RQ4与人工编写的或 CoT 生成的数据相比,合成的程序辅助数据在语义一致性、逻辑性和信息量方面保持程度如何?
主要发现
- 使用 PaD 训练的 0.06B 参数模型在 GSM8K 基准测试中表现优于 LLaMA-13B 和 PaLM-60B,达到小型模型的最先进性能。
- 与先前基线相比,PaD 将推理准确率提升 10%,同时模型参数量仅为十分之一,训练数据仅为三分之一。
- 该方法保持了高数据效率:仅使用排名靠前的 90% 最重要训练样本(按忠实度排序)即可达到与完整数据集相当的性能。
- gpt-3.5-turbo 生成的合成数据在 GSM8K 测试集和训练集上达到 75% 的准确率,语法错误低于 10%,且推理步骤具有高忠实度。
- 通过解释器驱动的验证,PaD 有效降低了错误推理的风险,过滤掉错误或不可编译的程序。
- 尽管推理能力显著提升,但经过专业化的微型模型在通用能力(如 BBH 上)表现出可测量的下降,证实了模型专业化带来的权衡。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。