Abstract
Large language models (LLMs) with instruction fine-tuning demonstrate superior generative capabilities. However, these models are resource-intensive. To alleviate this issue, we explore distilling knowledge from instruction-tuned LLMs into much smaller ones. To this end, we carefully develop a large set of 2.58M instructions based on both existing and newly-generated instructions. In addition to being sizable, we design our instructions to cover a broad set of topics to ensure diversity. Extensive analysis of our instruction dataset confirms its diversity, and we generate responses for these instructions using gpt-3.5-turbo. Leveraging these instructions, we fine-tune a diverse herd of models, collectively referred to as LaMini-LM, which includes models from both the encoder-decoder and decoder-only families, with varying sizes. We evaluate the performance of our models using automatic metrics on 15 different natural language processing (NLP) benchmarks, as well as through human assessment. The results demonstrate that our proposed LaMini-LM models are comparable to competitive baselines, while being nearly 10 times smaller in size.
Introduction
While Large Language Models (LLMs) like GPT-4 have revolutionized natural language processing, their deployment remains challenging due to massive computational requirements and environmental costs. For many applications, "scaling up" is impractical. Previous attempts to distill LLM capabilities into smaller models, such as Alpaca or Vicuna, have often been limited by small dataset sizes, narrow topic diversity, or a focus on specific architectures.
The LaMini-LM project addresses these gaps by introducing a "diverse herd" of small-scale language models (ranging from 61M to 7B parameters). These models achieve impressive instruction-following performance through massive-scale distillation from a powerful teacher model, gpt-3.5-turbo. By training on a newly curated dataset of 2.58 million instructions—50x larger than previous efforts—the researchers demonstrate that smaller models can rival much larger baselines while remaining efficient enough for local deployment.
Methodology
The core methodology relies on sequence distillation, where a teacher model generates high-quality responses for a student model to learn from. To create a robust student "herd," the researchers curated the LaMini-Instruction Dataset, containing 2.58 million instruction-response pairs.
The instruction set was built using two primary strategies to ensure both scale and diversity:
- Example-Guided Generation: Seed tasks from existing datasets like Self-Instruct and P3 were used to prompt the teacher model to generate 20 similar but new instructions.
- Topic-Guided Generation: To ensure semantic breadth, 3.5K categories from Wikipedia were used to guide the teacher model in generating instructions across diverse domains, preventing the model from specializing in too narrow a range of topics.
The resulting dataset was used to fine-tune models across two major architectures: encoder-decoder (e.g., T5, Flan-T5) and decoder-only (e.g., GPT-2, GPT-Neo, Cerebras-GPT, LLaMA).
Key Results and Insights
The evaluation of LaMini-LM across 15 NLP benchmarks and human assessments revealed several critical insights:
- Architecture Efficiency: One of the most notable findings is that encoder-decoder models, particularly Flan-T5, often outperformed decoder-only models of similar or even larger sizes. For example, the 248M parameter LaMini-Flan-T5 model showed remarkable competitiveness against much larger decoder-only baselines.
- The Impact of Scale and Diversity: The LaMini-LLaMA-7B model achieved an average score of 65.7 across benchmarks, significantly outperforming the original LLaMA-7B (58.3) and Alpaca-7B (62.3). This suggests that the scale and diversity of instruction tuning can push a model far beyond its base capabilities.
- Data Quality: Human evaluation confirmed the high quality of the generated instructions and responses. As shown in the assessment results, a vast majority of the synthetic samples were rated as high-quality (Rate-A) by human evaluators, validating the distillation process.
The models also demonstrated improved robustness on the LaMini-Hallucination Benchmark, showing a better ability to reject "nonsense" or "trick" questions compared to models like Alpaca.
Conclusion and Limitations
LaMini-LM demonstrates that massive-scale distillation can empower small models to rival the performance of much larger counterparts. However, several hurdles remain. The current models are optimized for single-turn instructions rather than multi-turn dialogues. Additionally, like many distilled models, LaMini-LM still faces challenges with complex logical reasoning and mathematical problem-solving. Future research will focus on extending these capabilities to conversational contexts and mitigating the propagation of biases inherited from the teacher model.
Summary updated