CRAFT Your Dataset: Task-Specific Synthetic Dataset Generation Through Corpus Retrieval and Augmentation

Ingo Ziegler, Abdullatif Köksal, Desmond Elliott, Hinrich Schütze
9/3/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: ziegler-ingo/CRAFT (35 stars, Apache-2.0, last commit 2025-12-05).

Abstract

Building high-quality datasets for specialized tasks is a time-consuming and resource-intensive process that often requires specialized domain knowledge. We propose Corpus Retrieval and Augmentation for Fine-Tuning (CRAFT), a method for generating synthetic datasets, given a small number of user-written few-shots that demonstrate the task to be performed. Given these examples, CRAFT uses large-scale public web-crawled corpora and similarity-based document retrieval to find other relevant human-written documents. Lastly, instruction-tuned large language models (LLMs) augment the retrieved documents into custom-formatted task samples, which then can be used for fine-tuning. We demonstrate that CRAFT can efficiently generate large-scale task-specific training datasets for four diverse tasks: biology, medicine, and commonsense question-answering (QA), as well as summarization. Our experiments show that CRAFT-based models outperform or match general LLMs on QA tasks, while exceeding models trained on human-curated summarization data by 46 preference points. CRAFT outperforms other synthetic dataset generation methods such as Self- and Evol-Instruct, and remains robust even when the quality of the initial few-shots varies.

View on arXivView PDF

Code Implementations(1)

ziegler-ingo/CRAFTCommunity100%
Apache-2.0

[TACL, EMNLP 2025 Oral] Code, datasets, and checkpoints for the paper "CRAFT Your Dataset: Task-Specific Synthetic Dataset Generation Through Corpus Retrieval and Augmentation"

359PythonAug 9, 202410 months agoApache-2.0
corpus-datadata-augmentationfine-tuninginstruction-tuninglarge-language-models+7 more

Similar Papers

Cite this paper

@article{ziegler2024craft,
  title  = {CRAFT Your Dataset: Task-Specific Synthetic Dataset Generation Through Corpus Retrieval and Augmentation},
  author = {Ingo Ziegler and Abdullatif Köksal and Desmond Elliott and Hinrich Schütze},
  year   = {2024},
  eprint = {2409.02098},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.02098v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2409.02098.svg)](https://codeofpaper.com/paper/2409.02098)

Discussion