Training Task Experts through Retrieval Based Distillation

Jiaxin Ge, Xueying Jia, Vijay Viswanathan, Hongyin Luo, Graham Neubig · DOI

Introduction

Large Language Models (LLMs) like GPT-4 possess remarkable capabilities but are often impractical for specialized, high-throughput production environments due to their size and cost. A common strategy is to "distill" this knowledge into smaller, more efficient "expert" models. However, effective distillation requires substantial high-quality, task-specific data.

When such data is unavailable, researchers typically turn to LLM-generated "synthetic" data. Unfortunately, pure synthetic data often suffers from repetition, a lack of diversity, and struggles with complex logic, potentially leading to "model collapse." ReBase (Retrieval Based Distillation) addresses this by moving from pure synthesis to a "Retrieve then Transform" paradigm, grounding synthetic data in real-world examples.

Comparison of data generation strategies: Manual, Traditional Synthetic, and ReBase.

Methodology: The ReBase Framework

ReBase utilizes a three-stage pipeline to generate high-quality training data:

  1. Datastore Construction: Over 75,000 datasets from Hugging Face were indexed into a searchable vector datastore. To minimize noise, columns were encoded separately to avoid interference from metadata like row IDs.
  2. Data Retrieval: Given a task instruction and few-shot examples, ReBase searches the datastore for relevant "raw" data points using a scoring system that balances task description relevance and query-answer alignment.
  3. Data Transformation: A "transformer" LLM (e.g., Claude 3 Haiku) "re-skins" the retrieved data. It adapts the content to the target domain and generates Chain-of-Thought (CoT) reasoning steps, turning raw data into high-quality training signals.
The three-step ReBase pipeline: Datastore Construction, Data Retrieval, and Data Transformation.

Experimental Evaluation

The framework was evaluated across four diverse benchmarks to test different capabilities: MNLI (sentence relationships), SQuAD (reading comprehension), MCoNaLa (multilingual code generation), and BIG-Bench Hard (complex reasoning).

Key Results

ReBase consistently outperformed traditional synthetic data generation across all metrics:

  • SQuAD: Achieved a 7.8% improvement in F1 score over traditional synthesis.
  • MNLI: Improved accuracy by 1.37%.
  • BIG-Bench Hard: Improved accuracy by 1.94%, with even higher gains (+2.37%) on algorithmic sub-tasks.

Discussion and Insights

A primary insight is that grounding LLMs with retrieved examples significantly improves data quality. Even smaller models like Claude 3 Haiku, when acting as "editors" of retrieved data rather than "storytellers," can produce training data that rivals or exceeds that generated by much larger models like GPT-4. In code generation tasks, ReBase-generated data included complex structures (e.g., dynamic programming) borrowed from existing technical datasets, which pure synthesis failed to replicate.

Furthermore, diversity is a critical factor. ReBase typically draws from 20 to 50 different dataset sources per task, introducing structural and lexical variety that prevents the model from overfitting to simple, repetitive patterns often found in purely synthetic outputs.

Limitations and Future Work

The current implementation relies on proprietary models for the transformation step, and the datastore is limited to Hugging Face. Future work will explore the efficacy of open-source "transformers" and expanding the datastore to web-scale crawls like Common Crawl or Dolma to provide even richer "seeds" for transformation.

Conclusion

ReBase provides a cost-effective and scalable path toward creating high-performing small-scale "experts" by leveraging the vast amount of existing data as a foundation for LLM-driven transformation, bypassing the quality ceilings of pure LLM synthesis.

Summary updated

BibTeX
@misc{ge2024training,
  author = {Jiaxin Ge and Xueying Jia and Vijay Viswanathan and Hongyin Luo and Graham Neubig},
  title = {{Training Task Experts through Retrieval Based Distillation}},
  year = {2024},
  eprint = {2407.05463},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.05463},
}
Figure