Skip to main content
QUICK REVIEW

[Paper Review] PaD: Program-aided Distillation Can Teach Small Models Reasoning Better than Chain-of-thought Fine-tuning

Xuekai Zhu, Biqing Qi|arXiv (Cornell University)|May 23, 2023
Topic ModelingComputer Science5 citations
TL;DR

This paper proposes Program-aided Distillation (PaD), a method that enhances small models' reasoning capabilities by generating and filtering program-aided reasoning data from large language models (LLMs), using an interpreter for automatic error checking. PaD enables a 0.06B parameter model to outperform larger models like LLaMA-13B and PaLM-60B on GSM8K, achieving a 10% accuracy gain with 10× fewer parameters and 3× less data.

ABSTRACT

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.

Motivation & Objective

  • To address the challenge of transferring reasoning capabilities from large language models (LLMs) to smaller, deployable models efficiently.
  • To overcome the issue of hallucinated, faulty reasoning steps in chain-of-thought (CoT) data, which degrade small model performance.
  • To improve data efficiency and training effectiveness for small models by leveraging program-aided reasoning and automated error checking.
  • To enable model specialization—equipping small models with strong reasoning skills while minimizing trade-offs in general capabilities.

Proposed method

  • Synthesize reasoning data by prompting LLMs to generate Python-like programs that represent step-by-step reasoning for arithmetic problems.
  • Use a separate Python interpreter to automatically validate reasoning programs by compiling and executing them, filtering out incorrect or syntactically invalid samples.
  • Decouple reasoning from computation by delegating numerical calculations to the interpreter, ensuring correctness of final answers.
  • Fine-tune small models on the filtered, executable program-aided reasoning data to learn structured, verifiable reasoning patterns.
  • Apply data pruning techniques (faithful, GraNd, entropy) to evaluate and rank training sample importance, demonstrating high data efficiency.
  • Use gpt-3.5-turbo to generate high-quality synthetic data, validated via metrics like faithfulness, logicality, and informativeness.

Experimental results

Research questions

  • RQ1Can program-aided reasoning data generation and automated error checking improve the reasoning performance of small models compared to standard chain-of-thought fine-tuning?
  • RQ2Does PaD enable smaller models to surpass larger LLMs in reasoning benchmarks like GSM8K while using significantly fewer parameters and data?
  • RQ3How does PaD compare in data efficiency and model specialization trade-offs relative to baseline distillation and fine-tuning methods?
  • RQ4To what extent does synthetic program-aided data maintain semantic consistency, logicality, and informativeness compared to human-written or CoT-generated data?

Key findings

  • A 0.06B parameter model trained with PaD outperforms LLaMA-13B and PaLM-60B on the GSM8K benchmark, achieving state-of-the-art performance for small models.
  • PaD improves reasoning accuracy by 10% over prior baselines while using only 1/10th the model size and 1/3 the training data.
  • The method maintains high data efficiency: using 90% of the most important training samples (ranked by faithfulness) achieves performance equivalent to the full dataset.
  • Synthetic data from gpt-3.5-turbo achieves 75% accuracy on GSM8K test and train sets, with less than 10% syntax errors, and high faithfulness in reasoning steps.
  • PaD reduces the risk of faulty reasoning by filtering out incorrect or non-compilable programs via interpreter-based validation.
  • Despite performance gains in reasoning, the specialized small models show a measurable decline in general abilities (e.g., on BBH), confirming the trade-off of model specialization.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.