Skip to main content
QUICK REVIEW

[Paper Review] Teaching Small Language Models to Reason

Lucie Charlotte Magister, Jonathan Mallinson|arXiv (Cornell University)|Dec 16, 2022
Topic ModelingComputer Science7 citations
TL;DR

This paper proposes knowledge distillation from large language models (LLMs) to small models via fine-tuning on chain-of-thought (CoT) outputs, significantly improving reasoning performance on arithmetic, commonsense, and symbolic reasoning tasks. Finetuning T5 XXL on CoT data from PaLM 540B and GPT-3 175B boosts accuracy on GSM8K from 8.11% to 21.99% and 18.42%, respectively, demonstrating that reasoning capabilities can be transferred to smaller models.

ABSTRACT

Chain of thought prompting successfully improves the reasoning capabilities of large language models, achieving state of the art results on a range of datasets. However, these reasoning capabilities only appear to emerge in models with a size of over 100 billion parameters. In this paper, we explore the transfer of such reasoning capabilities to models with less than 100 billion parameters via knowledge distillation. Specifically, we finetune a student model on the chain of thought outputs generated by a larger teacher model. Our experiments show that the proposed method improves task performance across arithmetic, commonsense and symbolic reasoning datasets. For example, the accuracy of T5 XXL on GSM8K improves from 8.11% to 21.99% when finetuned on PaLM-540B generated chains of thought.

Motivation & Objective

  • To investigate whether reasoning capabilities of large language models (LLMs) can be transferred to smaller models through knowledge distillation.
  • To evaluate the impact of student model size and dataset size on reasoning performance after CoT distillation.
  • To determine whether providing the target answer in the few-shot prompt improves CoT quality for distillation.
  • To demonstrate that fine-tuning small models on high-quality CoT outputs from LLMs improves task accuracy across multiple reasoning benchmarks.

Proposed method

  • Generate chain-of-thought (CoT) reasoning steps for existing datasets using large teacher models (PaLM 540B and GPT-3 175B) via few-shot prompting with 8 exemplars.
  • Modify the few-shot prompt to include the target answer after the question, improving CoT quality by enabling error correction in reasoning.
  • Filter out incorrect CoT examples by comparing reasoning outputs to the ground-truth answer, ensuring only high-quality data is used for distillation.
  • Fine-tune smaller student models (T5 XXL, XL, base) using teacher forcing, where the input is the question and the target is the CoT followed by the answer.
  • Use the same prompt format during inference, so the student generates CoT without requiring prompting during inference.
  • Evaluate performance on arithmetic, commonsense, and symbolic reasoning datasets using standard accuracy metrics.

Experimental results

Research questions

  • RQ1Can reasoning capabilities from large language models be effectively transferred to smaller models via knowledge distillation?
  • RQ2How does the size of the student model affect performance after CoT distillation?
  • RQ3What is the impact of dataset size on the effectiveness of CoT distillation?
  • RQ4Does including the target answer in the few-shot prompt improve the quality of generated CoTs and downstream performance?
  • RQ5How does the choice of teacher model (PaLM 540B vs. GPT-3 175B) affect distillation performance?

Key findings

  • Finetuning T5 XXL on CoT data generated by PaLM 540B increases accuracy on GSM8K from 8.11% to 21.99%.
  • Finetuning T5 XXL on CoT data from GPT-3 175B improves GSM8K accuracy to 18.42%.
  • T5 base, with 44 times fewer parameters than T5 XXL, achieves comparable performance to the baseline T5 XXL when fine-tuned on CoT data.
  • Even T5 small outperforms the baseline T5 XXL when provided with an external calculator, indicating strong reasoning transfer.
  • The method is 6x more data efficient: training on only 20% of GSM8K data achieves 11.22% accuracy, compared to 8.11% for the baseline.
  • Performance gains are most pronounced on arithmetic reasoning tasks, with more limited gains on StrategyQA, likely due to factual knowledge limitations in smaller models.

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.