Cheng-Yu Hsieh$^{1}$ $^{*}$
$^{1}$ University of Washington
Chun-Liang Li$^{2}$
$^{2}$ Google Cloud AI Research
Chih-Kuan Yeh$^{3}$
$^{3}$ Google Research
Hootan Nakhost$^{2}$
$^{2}$ Google Cloud AI Research
Yasuhisa Fujii$^{3}$
$^{3}$ Google Research
Alexander Ratner$^{1}$
$^{1}$ University of Washington
Ranjay Krishna$^{1}$
$^{1}$ University of Washington
Chen-Yu Lee$^{2}$
$^{2}$ Google Cloud AI Research
Tomas Pfister$^{2}$
$^{2}$ Google Cloud AI Research
Deploying large language models (LLMs) is challenging because they are memory inefficient and compute-intensive for practical applications. In reaction, researchers train smaller task-specific models by either finetuning with human labels or distilling using LLM-generated labels. However, finetuning and distillation require large amounts of training data to achieve comparable performance to LLMs. We introduce Distilling step-by-step, a new mechanism that (a) trains smaller models that outperform LLMs, and (b) achieves so by leveraging less training data needed by finetuning or distillation. Our method extracts LLM rationales as additional supervision for training small models within a multi-task framework. We present three findings across 4 NLP benchmarks: First, compared to both finetuning and distillation, our mechanism achieves better performance with much fewer labeled/unlabeled training examples. Second, compared to few-shot prompted LLMs, we achieve better performance using substantially smaller model sizes. Third, we reduce both the model size and the amount of data required to outperform LLMs; our finetuned 770M T5 model outperforms the few-shot prompted 540B PaLM model using only 80% of available data on a benchmark, whereas standard finetuning the same T5 model struggles to match even by using 100% of the dataset.$^{1}$
$^{*}$ Work done while the author was a student researcher at Google Cloud AI Research.
$^{1}$ Source code is available at: https://github.com/google-research/distilling-step-by-step.
Executive Summary: Large language models deliver strong results on many language tasks but are impractical to deploy for most teams because of their enormous size, memory needs, and inference cost. At the same time, the usual ways to create smaller, deployable models—finetuning on human-labeled data or distilling labels from an LLM—still demand large quantities of training examples to reach comparable accuracy.
The work introduces “Distilling step-by-step,” a training method that extracts natural-language reasoning steps (rationales) from an LLM and uses them as extra supervision while training a compact model. The smaller model is trained in a multi-task setup to predict both the final label and the rationale, removing any need for the large model at inference time. Experiments were run on four standard NLP benchmarks (natural-language inference, commonsense QA, and math word problems) using T5 models ranging from 220 million to 11 billion parameters, with the 540-billion-parameter PaLM model as the rationale source. Training-set size, model size, and labeled versus unlabeled data regimes were systematically varied and compared against standard finetuning, standard distillation, and direct few-shot prompting of the LLM.
Across the benchmarks the method consistently matches or exceeds the performance of standard finetuning and distillation while using 50–85 percent fewer examples. The same small models also surpass the 540-billion-parameter PaLM model itself, sometimes by more than 2,000-fold reduction in deployed size. On one benchmark a 770-million-parameter T5 model trained on only 80 percent of the data outperformed PaLM, whereas ordinary finetuning of the identical T5 model could not match PaLM even with the full dataset. When only unlabeled data is available, the approach still reaches or exceeds PaLM performance with an 11-billion-parameter model and further closes remaining gaps more efficiently than standard distillation when extra unlabeled examples are added.
These results indicate that high-accuracy task-specific models can be produced at far lower data-collection and serving cost than either current practice or direct use of frontier LLMs. Organizations facing tight latency, memory, or labeling budgets can therefore obtain better performance with modest infrastructure. Practical next steps are to integrate the method into production pipelines where labeled data are scarce, to test it on additional domains that require complex reasoning, and to evaluate zero-shot rationale generation to reduce the small number of hand-crafted prompt examples currently required. Main caveats are that rationale quality depends on the teacher LLM and that downstream models can inherit biases present in the teacher; both issues warrant continued monitoring rather than immediate broad deployment.
Section Summary: Large language models achieve impressive results but are impractical for most real-world uses because of their enormous size and the huge computing resources they demand. Existing ways to create smaller, cheaper models through fine-tuning or distillation still require substantial amounts of human-labeled or unlabeled data and rarely match the performance of the largest models. The new Distilling step-by-step approach instead has the large model generate both answers and natural-language reasoning steps, then trains compact models on this richer information so they can reach or exceed the large model’s accuracy with far less data and orders of magnitude fewer parameters.
Despite the impressive few-shot ability offered by large language models (LLMs) ([1, 2, 3, 4, 5, 6]), these models are challenging to deploy in real world applications due to their sheer size. Serving a single $175$ billion LLM requires at least $350$ GB GPU memory using specialized infrastructure ([7]). To make matters worse, today's state-of-the-art LLMs are composed of over $500$ B parameters [2], requiring significantly more memory and compute. Such computational requirements are far beyond affordable for most product teams, especially for applications that require low latency performance.
To circumvent these deployment challenges of large models, practitioners often choose to deploy smaller specialized models instead. These smaller models are trained using one of two common paradigms: finetuning or distillation. Finetuning updates a pretrained smaller model (e.g. BERT ([8]) or T5 ([9])) using downstream human annotated data ([10]). Distillation trains the same smaller models with labels generated by a larger LLM ([11, 12, 13, 14]). Unfortunately, these paradigms reduce model size at a cost: to achieve comparable performance to LLMs, finetuning requires expensive human labels, and distillation requires large amounts of unlabeled data which can be hard to obtain ([11, 15]).
In this work, we introduce Distilling step-by-step, a new simple mechanism for training smaller models with less training data. Our mechanism reduces the amount of training data required for both finetuning and distillation of LLMs into smaller model sizes. Core to our mechanism is changing our perspective from viewing LLMs as a source of noisy labels to viewing them as agents that can reason: LLMs can produce natural language rationales justifying their predicted labels ([16, 17]). For example, when asked "Jesse's room is $11$ feet long and $15$ feet wide. If she already has $16$ square feet of carpet. How much more carpet does she need to cover the whole floor?", an LLM can be prompted by chain-of-thought (CoT) technique ([16]) to provide intermediate rationales "Area $=$ length $\times$ width. Jesse’s room has $11\times15$ square feet." that better connects the input to the final answer "$(11 \times 15) - 16$". These rationales can contain relevant task knowledge, such as "Area $=$ length $\times$ width", that may originally require many data for small task-specific models to learn. We thus utilize these extracted rationales as additional, richer information to train small models through a multi-task training setup, with both label prediction and rationale prediction tasks ([9, 18]).
Distilling step-by-step allows us to learn task-specific smaller models that outperform LLMs using over $500\times$ less model parameters, and it does so with far fewer training examples compared to traditional finetuning or distillation (Figure 1). Our results show three promising empirical conclusions across $4$ NLP benchmarks. First, compared to both finetuning and distillation, our resulting models achieve better performance with over $50%$ less training examples on average across datasets (and up to over $85%$ reduction). Second, our models outperform LLMs with much smaller model sizes (up to $2000\times$ smaller), drastically reducing the computation cost required for model deployment. Third, we simultaneously reduce the model size as well as the amount of data required to outperform LLMs. We surpass the performance of $540$ B parameter LLMs using a $770$ M T5 model; this smaller model only uses $80%$ of a labeled dataset that would otherwise be required if using an existing finetuning method. When only unlabeled data is present, our small models still perform on par or better than LLMs. We outperform $540$ B PaLM's performance with only a $11$ B T5 model. We further show that when a smaller model performs worse than an LLM, Distilling step-by-step can more efficiently leverage additional unlabeled data to match the LLM performance compared to the standard distillation approach.

Section Summary: This paper builds on knowledge distillation techniques that transfer capabilities from large teacher models to smaller, more practical student models, often by generating pseudo-labels on unlabeled data, but aims to reduce the usual need for massive datasets by also distilling the teacher's reasoning steps. It draws from earlier work on incorporating human-provided explanations to guide and improve models, while noting that such rationales are costly to obtain, and from recent studies showing that large language models can generate their own high-quality reasoning to boost performance. Unlike concurrent efforts that similarly use model-generated explanations for training, this approach emphasizes fully offline deployment of compact models and includes detailed experiments on data efficiency and scale.
Our work distills task-specific knowledge of LLMs into smaller specialist models by leveraging the emergent reasoning capabilities of today's LLMs. We draw on knowledge distillation research and methods that learn from both human-generated rationales and LLM-generated rationales.
Knowledge distillation from large models.
Knowledge distillation has been successfully used to transfer knowledge from larger, more competent teacher models into smaller student models affordable for practical applications ([19, 20, 21, 22, 23]). It supports learning from limited labeled data, since the larger teacher model is often used to generate a training dataset with noisy pseudo labels ([24, 25, 12, 13, 14, 26]). The one limitation that knowledge distillation often faces is its reliance on large amounts of unlabelled data required to create a useful noisy training dataset. Although prior work has explored using data augmentation techniques to reduce this hunger for data ([11, 15, 27, 28]), we propose an alternative approach: we reduce the need for large unlabeled data by distilling not just labels but also the teacher's rationales.
Learning with human rationales.
While utilizing LLM-generated rationales is a new exciting area of investigation, using human-generated rationales has a rich history ([29]). For instance, human rationales can be used to regularize model behavior ([30]); it can be used as additional inputs to guide a model's predictions ([31]); it can be used to improve overall model performance ([32, 33, 34, 35, 36]); and human rationales can be used as gold standard labels to make models more interpretable by generating similar rationales ([37, 18, 38]). Unfortunately, human rationales are expensive.
Learning with LLM generated rationales.
Today's LLMs are capable of explaining their predictions by generating high-quality reasoning steps ([16, 17]). These reasoning steps have been used to augment input prompts to LLMs, improving their few-shot or zero-shot performance ([16, 17, 39]); reasoning steps have also been used as additional finetuning data "self-improve" LLMs ([40, 41]). Unfortunately, regardless of how LLMs are improved, their large size limits their utility in most test-time applications.
By contrast, we leverage generated rationales as informative supervision to train smaller task-specific models, i.e. models that can be deployed without incurring large computation or memory costs. Several concurrent works have also proposed a similar idea to ours – that of using extracted rationales as supervision ([42, 43, 44, 45]). Amongst them, PINTO ([42]) relies on an LLM to generate rationales at test-time, and thus does not fully solve deployment challenges. Compared with [43] and [44], we go beyond their experiments to provide a granular study by varying training dataset size, exploring downstream model sizes, and demonstrating the effectiveness of our method on fully unlabeled datasets.
Section Summary: The proposed Distilling step-by-step approach uses a large language model to generate both predicted labels and natural-language rationales that explain those predictions for a set of unlabeled examples. These rationales, produced through chain-of-thought prompting, are then combined with the labels to train a smaller model in a multi-task setup that simultaneously learns to output the label and generate the corresponding rationale. By treating rationale generation as auxiliary supervision, the method transfers richer reasoning knowledge from the large model, enabling the smaller one to reach strong performance with far less labeled data and without needing the large model at inference time.
We propose a new paradigm, Distilling step-by-step, that leverages the ability of LLMs to reason about their predictions to train smaller models in a data-efficient way. Our overall framework is illustrated in Figure 2. Our paradigm has two simple steps: First, given an LLM and an unlabeled dataset, we prompt the LLM to generate output labels along with rationales to justify the labels. Rationales are natural language explanations that provide support for the model's predicted label (see Figure 2). Second, we leverage these rationales in addition to the task labels to train smaller downstream models. Intuitively, rationales provide richer, more detailed information about why an input is mapped to a specific output label, and often contain relevant task knowledge that may be hard to infer solely from the original inputs.
Recent studies observe one intriguing emerging property of LLMs: their ability to generate rationales that support their predictions ([16, 17]). While the studies have largely focused on how to elicit such reasoning capability from LLMs ([46, 16, 17]), we use them in training smaller downstream models.
Specifically, we utilize Chain-of-Thought (CoT) prompting ([16]) to elicit and extract rationales from LLMs. As illustrated in Figure 3, given an unlabeled dataset $x_i \in D$, we first curate a prompt template $p$ that articulates how the task should be solved. Each prompt is a triplet $(x^{\mathrm{p}}, r^{\mathrm{p}}, y^{\mathrm{p}})$, where $x^{\mathrm{p}}$ is an example input, $y^{\mathrm{p}}$ is its corresponding label and $r^{\mathrm{p}}$ is a user-provided rationale that explains why $x^{\mathrm{p}}$ can be categorized as $y^{\mathrm{p}}$. We append each input $x_i$ to $p$ and use it as an input to prompt the LLM to generate rationales and labels for each $x_i \in D$. With the demonstrations seen in $p$, the LLM is able to mimic the triplet demonstration to generate the rationale $\hat{r}_i$ and output $\hat{y}_i$ for $x_i$.

We first describe the current framework for learning task-specific models. With this framework in place, we extend it to incorporate rationales into the training process. Formally, we denote a dataset as $\mathcal{D} = {(x_i, y_i)}_{i=1}^N$ where each $x_i$ represents an input and $y_i$ is the corresponding desired output label. While our framework supports inputs and outputs of any modality, our experiments limits $x$ and $y$ to be natural language. This text-to-text framework ([9]) encompasses a variety of NLP tasks: classification, natural language inference, question answering and more.
Standard finetuning and task distillation.
The most common practice to train a task-specific model is to finetune a pretrained model with supervised data ([10]). In the absence of human-annotated labels, task-specific distillation ([20, 11]) uses LLM teachers to generates pseudo noisy training labels, $\hat{y}_i$ in place of $y_i$ ([12, 13, 14]).
For both scenarios, the smaller model $f$ is trained to minimize the label prediction loss:
$ \mathcal{L}{\mathrm{label}} = \frac{1}{N} \sum{i=1}^N \ell(f(x_i), \hat{y}_i),\tag{1} $
where $\ell$ is the cross-entropy loss between the predicted and target tokens. Note that for ease of exposition, we overload $\hat{y}_i$ in Equation 1 to be either human-annotated labels $y_i$ for the standard finetuning case, or LLM-predicted labels $\hat{y}_i$ for the model distillation case.
Multi-task learning with rationales.
To create a more explicit connection between $x_i$ 's to $\hat{y}_i$ 's, we use extracted rationales $\hat{r}_i$ as additional supervision. There are several ways to incorporate rationales into the downstream model's training process. One straightforward approach is feed $\hat{r}_i$ as an additional input—as proposed by other concurrent research ([31, 42]). In other words, the $f(x_i, \hat{r}_i) \rightarrow \hat{y}_i$ is trained with both text and rationale $[x, r]$ as inputs:
$ \mathcal{L} = \frac{1}{N} \sum_{i=1}^N \ell(f(x_i, \hat{r}_i), \hat{y}_i).\tag{2} $
Unfortunately, this design requires an LLM to first generate a rationale before the $f$ can make a prediction. The LLM is still necessary during deployment, limited its deployability.
In this work, instead of using rationales as additional model inputs, we frame learning with rationales as a multi-task problem. Specifically, we train the model $f(x_i) \rightarrow (\hat{y}_i, \hat{r}_i)$ to not only predict the task labels but also generate the corresponding rationales given the text inputs:
$ \mathcal{L} = \mathcal{L}{\mathrm{label}} + \lambda \mathcal{L}{\mathrm{rationale}},\tag{3} $
where $\mathcal{L}{\mathrm{label}}$ is the label prediction loss in Equation 1 and $\mathcal{L}{\mathrm{rationale}}$ is the rationale generation loss:
$ \mathcal{L}{\mathrm{rationale}} = \frac{1}{N} \sum{i=1}^N \ell(f(x_i), \hat{r}_i). $
The rationale generation loss enables the model to learn to generate the intermediate reasoning steps for the prediction, and could therefore guide the model in better predicting the resultant label. This is our proposed Distilling step-by-step. Compared with Equation 2, the rationale $\hat{r}_i$ is not required in the test time, which removes the need for an LLM at test-time.
We prepend "task prefixes" ($\texttt{[label]}$, $\texttt{[rationale]}$) to the input examples and train the smaller model to output $\hat{y}_i$ when $\texttt{[label]}$ is provided and to produce $\hat{r}_i$ with $\texttt{[rationale]}$ ([9]).


Section Summary: The experiments section validates the Distilling step-by-step approach by testing it on several standard NLP benchmarks using a large PaLM model as the teacher and smaller T5 models as the learners. It demonstrates that the method reaches higher accuracy than ordinary finetuning or task distillation while using far fewer labeled or unlabeled examples, and that the resulting compact models can surpass the original large model’s performance at a fraction of the size. Additional analyses explore the lowest data and model sizes needed to beat the teacher and examine how each design choice contributes to these gains.
We empirically validate the effectiveness of Distilling step-by-step. First, we show that when compared to standard finetuning and task distillation approaches, Distilling step-by-step achieves better performance with much fewer number of training examples, substantially improving the data efficiency to learn small task-specific models (Section 4.1). Second, we show that Distilling step-by-step surpasses the performance of LLMs with much smaller model size, drastically lowering the deployment cost compared to LLMs (Section 4.2). Third, we investigate the minimum resources required, w.r.t. both number of training examples and model size, for Distilling step-by-step to outperform LLMs. We show that Distilling step-by-step outperforms LLMs by using less data and smaller model, simultaneously improving both data- and deployability-efficiency (Section 4.3). Finally, we perform ablation studies to understand the influence of different components and design choices in the Distilling step-by-step framework (Section 4.4).
Setup.
In the experiments, we consider the $540$ B PaLM model ([2]) as the LLM. For task-specific downstream models, we use T5 models ([9]) where we initialize the models with pretrained weights obtained from publicly available sources^1. For CoT prompting, we follow [16] when available, and curate our own examples for new datasets. We include more implementation details in Appendix A.1.
Datasets.
We conduct the experiments on $4$ popular benchmark datasets across 3 different NLP tasks: e-SNLI ([34]) and ANLI ([47]) for natural language inference; CQA ([48, 31]) for commonsense question answering; SVAMP ([49]) for arithmetic math word problems. We include more dataset details in Appendix A.2.
We compare Distilling step-by-step to two most common methods in learning task-specific models: (1) $\textsc{Standard finetuning}$ when human-labeled examples are available, and (2) $\textsc{Standard task distillation}$ when only unlabeled examples are available. Specifically, standard finetuning refers to the prevailing pretrain-then-finetune paradigm that finetunes a model with ground-truth labels via standard label supervision ([10]). On the other hand, when only unlabeled examples are available, standard task distillation learns the task-specific model by treating a teacher LLM's predicted labels as ground-truths ([20, 24, 12, 13, 14]).
In the following set of experiments, we fix the task-specific models to be 220M T5-Base models, and compare the task performances achieved by different methods under varying number of available training examples.
Distilling step-by-step outperforms standard finetuning with much less labeled examples.
When finetuned with human-labeled examples, Figure 4 shows that Distilling step-by-step consistently achieves better performance than standard finetuning across varying numbers of labeled examples used. Furthermore, we see that Distilling step-by-step can achieve the same performance as standard finetuning with much less labeled examples. In particular, by using only $12.5%$ of the full e-SNLI dataset, Distilling step-by-step can outperform standard finetuning trained with $100%$ of the full dataset. Similarly, we achieve $75%$, $25%$, and $20%$ reduction in training examples required to outperform standard finetuning on ANLI, CQA, and SVAMP respectively.
Distilling step-by-step outperforms standard distillation with much less unlabeled examples.
When only unlabeled data is available, we compare Distilling step-by-step to standard task distillation. In Figure 5, we observe an overall similar trend to the finetuning setup. Specifically, we see that Distilling step-by-step outperforms standard task distillation on all $4$ datasets under different numbers of unlabeled data used. We as well see that Distilling step-by-step requires much less unlabeled data to outperform standard task distillation. For instance, we need only $12.5%$ of the full unlabeled dataset to outperform the performance achieved by standard task distillation using $100%$ of the training examples on e-SNLI dataset.
In the following set of experiments, we hold the training set size fixed (using $100%$ of the datasets), and compare varying sizes of small T5 models trained with Distilling step-by-step and standard approaches to LLMs. Specifically, we consider $3$ different sizes of T5 models, i.e., 220M T5-Base, 770M T5-Large, and 11B T5-XXL. For LLMs, we include two baseline methods: (1) $\textsc{Few-shot CoT}$ ([16]), and (2) $\textsc{PINTO tuning}$ ([42]). Few-shot CoT directly utilizes CoT demonstrations to prompt the 540B PaLM to generate intermediate steps before predicting the final labels without any further finetuning of the LLM. PINTO tuning refers to our extension of [42] to handle tasks beyond question-answering, which are not studied by [42]. Here, we finetune a 220M T5-Base model on top of the outputs generated from the PaLM model, which can be viewed as a finetuning method for LLMs with additional parameters ([50, 51]).
We present the experimental results under the two broad scenarios of having access to labeled datasets or unlabeled datasets in Figure 6 and Figure 7, respectively. We plot each method by their deployed model sizes for prediction ($x$-axis), and their corresponding task performances ($y$-axis).


Distilling step-by-step improves over standard baselines across varying model sizes used.
In Figure 6 and Figure 7 respectively, we see that Distilling step-by-step consistently improves over standard finetuning and standard distillation across all sizes of T5 models. The improvements are most pronounced on ANLI, where Distilling step-by-step outperforms standard finetuning and distillation by an average of $8%$ and $13%$ on task accuracy respectively.
Distilling step-by-step outperforms LLMs by using much smaller task-specific models.
In Figure 6 when human-labeled datasets are available, Distilling step-by-step can always outperform Few-shot CoT and PINTO tuning on all $4$ datasets considered, by using much smaller T5 models. For instance, we can achieve better performances than 540B PaLM model's Few-shot CoT with $220$ M (over $2000\times$ smaller) T5 model on e-SNLI, $770$ M (over $700\times$ smaller) T5 models on ANLI and SVAMP, and $11$ B (over $45\times$ smaller) T5 model on CQA. These results hold true even by further finetuning the 540B PaLM model on available labeled data with PINTO tuning[^2].
[^2]: We note that PETuning methods may outperform PINTO tuning. However, they require massive resource in both training and deployment, which is not the focus of this work.
In Figure 7, by only utilizing unlabeled examples, Distilling step-by-step also outperforms the teacher LLM on 3 out of 4 datasets. Specifically, Distilling step-by-step surpasses the $540$ B PaLM model's Few-shot CoT performance by using $11$ B T5 with less than $3%$ of PaLM's size. On SVAMP where the distilled model underperforms, we hypothesize that the performance gap is due to the relatively small number of data points in the dataset (i.e., $800$). In reaction, we propose to augment the dataset with additional unlabeled examples to close the performance gap as shown in next.
Unlabeled data augmentation further improves Distilling step-by-step.
We augment the SVAMP training set with unlabeled examples from the ASDiv dataset ([52]). ASDiv dataset contains a total of $2, 305$ examples, where each example is a math word problem similar to the ones in SVAMP. In Figure 7 on SVAMP, we show the performances of Distilling step-by-step and standard task distillation using $11$ B T5 model after augmenting the training set with ASDiv. We see the data augmentation much improves the performance for both Distilling step-by-step and standard task distillation. However, even with the added unlabeled examples, standard task distillation still underperforms Few-shot CoT. On the other hand, Distilling step-by-step is able to much more efficiently exploit the value of the added examples to achieve the same performance level of Few-shot CoT, again, using a T5 model of size less than $3%$ of the $540$ B PaLM.


Here, using the LLM's performance as an anchor point, we explore the most efficient resource requirements in terms of both number of training examples and deployed model size, that Distilling step-by-step and standard finetuning/distillation need to outperform the LLM. We present the results, again under human-labeled setting and unlabeled setting, in Figure 8 and Figure 9 respectively. We visualize the results by plotting different resultant models by (1) the number of training examples used ($x$-axis), (2) the final task performance achieved ($y$-axis), and (3) the size of the model (visualized by the size of the shaded area).
Distilling step-by-step outperforms LLMs with much smaller models by using less data.
On all datasets in Figure 8, we see that Distilling step-by-step outperforms PaLM's Few-shot CoT with much smaller T5 models using only a subset of the available training examples. Specifically, on e-SNLI, Distilling step-by-step can achieve better performance than Few-shot CoT with a model over $2000\times$ smaller (220M T5) and only $0.1%$ of the full dataset. In Figure 9 where only unlabeled datasets are available, we observe the same trend that Distilling step-by-step can, at most time, outperform Few-shot CoT with smaller model as well as less data. For instance, on ANLI, Distilling step-by-step outperforms the LLM with a $45\times$ smaller model and $50%$ of the full unlabeled set.
Standard finetuning and distillation require more data and larger model.
Finally, in Figure 8 and Figure 9, we see that standard finetuning and distillation often need either more data or larger models to match LLM's performance. For instance, on e-SNLI in Figure 8, we observe that Distilling step-by-step outperform the LLM using only $0.1%$ of the dataset while standard finetuning requires more data to match the performance. Furthermore, on ANLI in Figure 8, we observe that Distilling step-by-step can outperform PaLM using $770$ M model with only $80%$ of the training set while standard finetuning struggles to match the LLM even using the full dataset and thus requires larger model to close the performance gap.
So far, we have focused on showing the effectiveness of Distilling step-by-step on reducing the training data required for finetuning or distilling smaller task-specific models. In this section, we perform further studies to understand the influence of different components in the Distilling step-by-step framework. Specifically, we study (1) how different LLMs, from which the rationales are extracted, affect the effectiveness of Distilling step-by-step, and (2) how the multi-task training approach compares to other potential design choices in training small task-specific models with LLM rationales. Here, we fix the small task-specific models to be $220$ M T5 models, and utilize $100%$ of the data on all datasets.
Distilling step-by-step works with different sizes of decently trained LLMs.
In addition to using $540$ B PaLM as the LLM, here we consider a relatively smaller LLM, $20$ B GPT-NeoX model [53], from which we extract rationales for Distilling step-by-step. In Table 1, we see that when coupled with LLMs of different sizes, Distilling step-by-step can still provide performance improvements compared to standard finetuning. However, the performance lift is smaller when rationales are extracted from the $20$ B GPT-NeoX model instead of from the $540$ B PaLM. This can be due to the fact that the larger PaLM model provides higher-quality rationales that are more beneficial for learning the task.
::: {caption="Table 1: Distilling step-by-step works with different sizes of LLMs. When rationales are extracted from a 20 B GPT-NeoX model, Distilling step-by-step is still able to provide performance lift compared to standard finetuning on 220 M T5 models."}

:::
Multi-task training is much more effective than single-task rationale and label joint prediction.
There are different possible ways to train task-specific models with LLM-rationales as output supervisions. One straightforward approach is to concatenate the rationale $\hat{r}_i$ and label $\hat{y}_i$ into a single sequence $[\hat{r}_i, \hat{y}_i]$ and treat the entire sequence as the target output in training small models, as considered in [44, 43]:
$ \mathcal{L}{\mathrm{single}} = \frac{1}{N} \sum{i=1}^N \ell(f(x_i), [\hat{r}_i, \hat{y}_i]). $
In Table 2, we compare this single-task training approach to our proposed multi-task training approach for utilizing LLM-rationales. We see that not only multi-task training consistently leads to better performance, single-task training with LLM-rationales can at times leads to worse performance than standard finetuning, e.g., on ANLI and CQA. In fact, similar results have also been observed in [37, 44, 43] that simply treating rationale and label predictions as a single joint task may harm the model's performance on label prediction. This validates our use of the multi-task training approach, and highlights the need to treat the rationales carefully so as to unleash their actual benefits.
::: {caption="Table 2: Our proposed multi-task training framework consistently leads to better performances than treating rationale and label predictions as a single task. Single-task training can at times lead to worse performance than standard finetuning."}

:::
Section Summary: The paper introduces a method called Distilling step-by-step, which pulls out reasoning steps from large AI models to guide the training of much smaller, specialized ones. This approach cuts down on the amount of data and computing power needed, letting the compact models match or even exceed the performance of the original large models while using fewer resources overall. The authors also explore how well the method generalizes, review key design decisions, and outline limitations along with ethical considerations for future work.
We propose Distilling step-by-step to extract rationales from LLMs as informative supervision in training small task-specific models. We show that Distilling step-by-step reduces the training dataset required to curate task-specific smaller models; it also reduces the model size required to achieve, and even surpass, the original LLM's performance. Distilling step-by-step proposes a resource-efficient training-to-deployment paradigm compared to existing methods. Further studies demonstrate the generalizability and the design choices made in Distilling step-by-step. Finally, we discuss the limitations, future directions and ethics statement of our work below.
Section Summary: The approach requires users to supply roughly ten example demonstrations for each task in order to generate the step-by-step explanations that guide the model. Creating these explanations during training adds modest extra computation, although the final system can still produce answers quickly without them. In addition, the quality of the explanations is limited by the reasoning ability of today’s large language models, which may falter on complex problems.
There are a number of limitations with our approach. First, we require users to produce a few example demonstrations ($\sim 10$-shot for all tasks) in order to use the few-shot CoT ([16]) prompting mechanism. This limitation can be improved by using recent advances that suggest that rationales can be elicited without any user-annotated demonstrations ([17]). Second, training task-specific models with rationales incur slight training-time computation overhead. However, at test time, our multi-task design naturally avoids the computation overhead since it allows one to only predict labels without generating the rationales. Finally, while we observe success using LLM rationales, there is evidence that LLMs exhibit limited reasoning capability on more complex reasoning and planning tasks ([54]). Future work should characterize how rationale quality affects Distilling step-by-step.
Section Summary: The smaller models created here may inherit biased or inappropriate behaviors from the larger AI systems used to train them. The authors expect that future progress in curbing such problems in big language models will also help make the smaller ones safer and more reliable. They flag this inheritance of biases as a key ethical point to keep in mind.
It is worth noting that the behavior of the our downstream smaller models is subject to biases inherited from the larger teacher LLM. We envision that the same research progress in reducing anti-social behaviors in LLMs can also be applied to improve smaller language models.
Section Summary: The appendix describes the experimental setup used to train various sizes of T5 language models on cloud-based A100 GPUs, including the specific learning rates, batch sizes, input lengths, and training steps, along with the use of publicly available code from the Hugging Face library and results averaged across four random runs. It also provides background on the datasets employed, such as e-SNLI, ANLI, CQA, SVAMP, and ASDiv, noting their original sources, public availability, and confirmation that they contain no personally identifying or offensive material. A table presents the number of examples allocated to training, validation, and test splits for each dataset after any necessary subsampling.
We perform our experiments on cloud A100 $\times$ 16 GPU instances. We train the T5 models with the following hyperparameters, using publicly available packages from https://github.com/huggingface/transformers:
We report all the results over $4$ random runs, and include the standard error in the presented plots.
We provide more detailed descriptions on the datasets used in our experiments. We include the sources from which we obtain the datasets as well as their original sources released from the authors. We refer readers to these sources for their license or terms for use and/or distribution. To the best of our knowledge, the datasets used do not contain information that names or uniquely identifies individual people or offensive content.
For each dataset, we randomly subsample $10%$ of the original training set to serve as validation set when validation set is not originally provided. For CQA, we use the original validation set to serve as our test set since the ground-truth labels are not available for the original test set. We provide the dataset statistics in Table 3.
: Table 3: Dataset statistics used in our experiments.
| Dataset | Train | Validation | Test |
|---|---|---|---|
| e-SNLI | 549, 367 | 9, 842 | 9, 824 |
| ANLI | 16, 946 | 1, 000 | 1, 000 |
| CQA | 8, 766 | 975 | 1, 221 |
| SVAMP | 720 | 80 | 200 |
Section Summary: This section consists of a numbered bibliography with 26 academic papers, preprints, and conference proceedings centered on large language models and related machine learning methods. The cited works examine model training and scaling, techniques such as prompting and knowledge distillation, and applications including text classification and reasoning. They feature contributions from well-known researchers and cover influential systems like GPT, BERT, and PaLM.
[1] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901.
[2] Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. 2022. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311.
[3] Romal Thoppilan, Daniel De Freitas, Jamie Hall, Noam Shazeer, Apoorv Kulshreshtha, Heng-Tze Cheng, Alicia Jin, Taylor Bos, Leslie Baker, Yu Du, et al. 2022. Lamda: Language models for dialog applications. arXiv preprint arXiv:2201.08239.
[4] Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, et al. 2022. Training compute-optimal large language models. arXiv preprint arXiv:2203.15556.
[5] Shaden Smith, Mostofa Patwary, Brandon Norick, Patrick LeGresley, Samyam Rajbhandari, Jared Casper, Zhun Liu, Shrimai Prabhumoye, George Zerveas, Vijay Korthikanti, et al. 2022b. Using deepspeed and megatron to train megatron-turing nlg 530b, a large-scale generative language model. arXiv preprint arXiv:2201.11990.
[6] Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, et al. 2022. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068.
[7] Lianmin Zheng, Zhuohan Li, Hao Zhang, Yonghao Zhuang, Zhifeng Chen, Yanping Huang, Yida Wang, Yuanzhong Xu, Danyang Zhuo, Joseph E Gonzalez, et al. 2022. Alpa: Automating inter-and intra-operator parallelism for distributed deep learning. arXiv preprint arXiv:2201.12023.
[8] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.
[9] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1–67.
[10] Jeremy Howard and Sebastian Ruder. 2018. Universal language model fine-tuning for text classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 328–339, Melbourne, Australia. Association for Computational Linguistics.
[11] Raphael Tang, Yao Lu, Linqing Liu, Lili Mou, Olga Vechtomova, and Jimmy Lin. 2019. Distilling task-specific knowledge from bert into simple neural networks. arXiv preprint arXiv:1903.12136.
[12] Shuohang Wang, Yang Liu, Yichong Xu, Chenguang Zhu, and Michael Zeng. 2021. Want to reduce labeling cost? gpt-3 can help. arXiv preprint arXiv:2108.13487.
[13] Ryan Smith, Jason A Fries, Braden Hancock, and Stephen H Bach. 2022a. Language models in the loop: Incorporating prompting into weak supervision. arXiv preprint arXiv:2205.02318.
[14] Simran Arora, Avanika Narayan, Mayee F Chen, Laurel J Orr, Neel Guha, Kush Bhatia, Ines Chami, Frederic Sala, and Christopher Ré. 2022. Ask me anything: A simple strategy for prompting language models. arXiv preprint arXiv:2210.02441.
[15] Kevin J Liang, Weituo Hao, Dinghan Shen, Yufan Zhou, Weizhu Chen, Changyou Chen, and Lawrence Carin. 2020. Mixkd: Towards efficient distillation of large-scale language models. arXiv preprint arXiv:2011.00593.
[16] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Quoc Le, and Denny Zhou. 2022. Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11903.
[17] Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. 2022. Large language models are zero-shot reasoners. arXiv preprint arXiv:2205.11916.
[18] Sharan Narang, Colin Raffel, Katherine Lee, Adam Roberts, Noah Fiedel, and Karishma Malkan. 2020. Wt5?! training text-to-text models to explain their predictions. arXiv preprint arXiv:2004.14546.
[19] Cristian Buciluǎ, Rich Caruana, and Alexandru Niculescu-Mizil. 2006. Model compression. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 535–541.
[20] Geoffrey Hinton, Oriol Vinyals, Jeff Dean, et al. 2015. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2(7).
[21] Lucas Beyer, Xiaohua Zhai, Amélie Royer, Larisa Markeeva, Rohan Anil, and Alexander Kolesnikov. 2022. Knowledge distillation: A good teacher is patient and consistent. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10925–10934.
[22] Peter West, Chandra Bhagavatula, Jack Hessel, Jena D Hwang, Liwei Jiang, Ronan Le Bras, Ximing Lu, Sean Welleck, and Yejin Choi. 2021. Symbolic knowledge distillation: from general language models to commonsense models. arXiv preprint arXiv:2110.07178.
[23] Yao Fu, Hao Peng, Litu Ou, Ashish Sabharwal, and Tushar Khot. 2023. Specializing smaller language models towards multi-step reasoning. arXiv preprint arXiv:2301.12726.
[24] Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey E Hinton. 2020. Big self-supervised models are strong semi-supervised learners. Advances in neural information processing systems, 33:22243–22255.
[25] Fotis Iliopoulos, Vasilis Kontonis, Cenk Baykal, Gaurav Menghani, Khoa Trinh, and Erik Vee. 2022. Weighted distillation with unlabeled examples. In Advances in Neural Information Processing Systems.
[26] Priyanka Agrawal, Chris Alberti, Fantine Huot, Joshua Maynez, Ji Ma, Sebastian Ruder, Kuzman Ganchev, Dipanjan Das, and Mirella Lapata. 2022. Qameleon: Multilingual qa with only 5 examples. arXiv preprint arXiv:2211.08264.
[27] Suraj Srinivas and François Fleuret. 2018. Knowledge transfer with jacobian matching. In International Conference on Machine Learning, pages 4723–4731. PMLR.
[28] Smitha Milli, Ludwig Schmidt, Anca D Dragan, and Moritz Hardt. 2019. Model reconstruction from model explanations. In Proceedings of the Conference on Fairness, Accountability, and Transparency, pages 1–9.
[29] Peter Hase and Mohit Bansal. 2021. When can models learn from explanations? a formal framework for understanding the roles of explanation data. arXiv preprint arXiv:2102.02201.
[30] Andrew Slavin Ross, Michael C Hughes, and Finale Doshi-Velez. 2017. Right for the right reasons: Training differentiable models by constraining their explanations. arXiv preprint arXiv:1703.03717.
[31] Nazneen Fatema Rajani, Bryan McCann, Caiming Xiong, and Richard Socher. 2019. Explain yourself! leveraging language models for commonsense reasoning. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4932–4942, Florence, Italy. Association for Computational Linguistics.
[32] Omar Zaidan, Jason Eisner, and Christine Piatko. 2007. Using "annotator rationales" to improve machine learning for text categorization. In Human Language Technologies 2007: The Conference of the North American Chapter of the Association for Computational Linguistics; Proceedings of the Main Conference, pages 260–267, Rochester, New York. Association for Computational Linguistics.
[33] Ye Zhang, Iain Marshall, and Byron C. Wallace. 2016. Rationale-augmented convolutional neural networks for text classification. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 795–804, Austin, Texas. Association for Computational Linguistics.
[34] Oana-Maria Camburu, Tim Rocktäschel, Thomas Lukasiewicz, and Phil Blunsom. 2018. e-snli: Natural language inference with natural language explanations. Advances in Neural Information Processing Systems, 31.
[35] Braden Hancock, Antoine Bordes, Pierre-Emmanuel Mazare, and Jason Weston. 2019. Learning from dialogue after deployment: Feed yourself, chatbot! arXiv preprint arXiv:1901.05415.
[36] Danish Pruthi, Rachit Bansal, Bhuwan Dhingra, Livio Baldini Soares, Michael Collins, Zachary C Lipton, Graham Neubig, and William W Cohen. 2022. Evaluating explanations: How much do explanations from the teacher aid students? Transactions of the Association for Computational Linguistics, 10:359–375.
[37] Sarah Wiegreffe, Ana Marasović, and Noah A. Smith. 2021. Measuring association between labels and free-text rationales. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 10266–10284, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
[38] Jacob Eisenstein, Daniel Andor, Bernd Bohnet, Michael Collins, and David Mimno. 2022. Honest students from untrusted teachers: Learning an interpretable question-answering pipeline from a pretrained language model. arXiv preprint arXiv:2210.02498.
[39] Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, and Denny Zhou. 2022b. Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.11171.
[40] Eric Zelikman, Yuhuai Wu, and Noah D Goodman. 2022. Star: Bootstrapping reasoning with reasoning. arXiv preprint arXiv:2203.14465.
[41] Jiaxin Huang, Shixiang Shane Gu, Le Hou, Yuexin Wu, Xuezhi Wang, Hongkun Yu, and Jiawei Han. 2022. Large language models can self-improve. arXiv preprint arXiv:2210.11610.
[42] Peifeng Wang, Aaron Chan, Filip Ilievski, Muhao Chen, and Xiang Ren. 2022a. Pinto: Faithful language reasoning using prompt-generated rationales. arXiv preprint arXiv:2211.01562.
[43] Namgyu Ho, Laura Schmid, and Se-Young Yun. 2022. Large language models are reasoning teachers. arXiv preprint arXiv:2212.10071.
[44] Lucie Charlotte Magister, Jonathan Mallinson, Jakub Adamek, Eric Malmi, and Aliaksei Severyn. 2022. Teaching small language models to reason. arXiv preprint arXiv:2212.08410.
[45] Liunian Harold Li, Jack Hessel, Youngjae Yu, Xiang Ren, Kai-Wei Chang, and Yejin Choi. 2023. Symbolic chain-of-thought distillation: Small models can also" think" step-by-step. arXiv preprint arXiv:2306.14050.
[46] Maxwell Nye, Anders Johan Andreassen, Guy Gur-Ari, Henryk Michalewski, Jacob Austin, David Bieber, David Dohan, Aitor Lewkowycz, Maarten Bosma, David Luan, et al. 2021. Show your work: Scratchpads for intermediate computation with language models. arXiv preprint arXiv:2112.00114.
[47] Yixin Nie, Adina Williams, Emily Dinan, Mohit Bansal, Jason Weston, and Douwe Kiela. 2020. Adversarial NLI: A new benchmark for natural language understanding. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics. Association for Computational Linguistics.
[48] Alon Talmor, Jonathan Herzig, Nicholas Lourie, and Jonathan Berant. 2019. CommonsenseQA: A question answering challenge targeting commonsense knowledge. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4149–4158, Minneapolis, Minnesota. Association for Computational Linguistics.
[49] Arkil Patel, Satwik Bhattamishra, and Navin Goyal. 2021. Are NLP models really able to solve simple math word problems?In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2080–2094, Online. Association for Computational Linguistics.
[50] Jeffrey O Zhang, Alexander Sax, Amir Zamir, Leonidas Guibas, and Jitendra Malik. 2020. Side-tuning: a baseline for network adaptation via additive side networks. In European Conference on Computer Vision, pages 698–714. Springer.
[51] Brian Lester, Rami Al-Rfou, and Noah Constant. 2021. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691.
[52] Shen-yun Miao, Chao-Chun Liang, and Keh-Yih Su. 2020. A diverse corpus for evaluating and developing english math word problem solvers. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 975–984.
[53] Sid Black, Stella Biderman, Eric Hallahan, Quentin Anthony, Leo Gao, Laurence Golding, Horace He, Connor Leahy, Kyle McDonell, Jason Phang, Michael Pieler, USVSN Sai Prashanth, Shivanshu Purohit, Laria Reynolds, Jonathan Tow, Ben Wang, and Samuel Weinbach. 2022. GPT-NeoX-20B: An open-source autoregressive language model. In Proceedings of the ACL Workshop on Challenges & Perspectives in Creating Large Language Models.
[54] Karthik Valmeekam, Alberto Olmo, Sarath Sreedharan, and Subbarao Kambhampati. 2022. Large language models still can't plan (a benchmark for llms on planning and reasoning about change). arXiv preprint arXiv:2206.10498.