SearchInstruct: Enhancing Domain Adaptation via Retrieval-Based Instruction Dataset Creation

Iman Barati, Mostafa Amiri, Heshaam Faili
9/12/2025
cs.CL

Official code: mostafaamiri/SearchInstruct (12 stars, MIT, last commit 2024-12-11).

Abstract

Supervised Fine-Tuning (SFT) is essential for training large language models (LLMs), significantly enhancing critical capabilities such as instruction following and in-context learning. Nevertheless, creating suitable training datasets tailored for specific domains remains challenging due to unique domain constraints and data scarcity. In this paper, we propose SearchInstruct, an innovative method explicitly designed to construct high quality instruction datasets for SFT. Our approach begins with a limited set of domain specific, human generated questions, which are systematically expanded using a large language model. Subsequently, domain relevant resources are dynamically retrieved to generate accurate and contextually appropriate answers for each augmented question. Experimental evaluation demonstrates that SearchInstruct enhances both the diversity and quality of SFT datasets, leading to measurable improvements in LLM performance within specialized domains. Additionally, we show that beyond dataset generation, the proposed method can also effectively facilitate tasks such as model editing, enabling efficient updates to existing models. To facilitate reproducibility and community adoption, we provide full implementation details, the complete set of generated instruction response pairs, and the source code in a publicly accessible Git repository: [https://github.com/mostafaamiri/SearchInstruct](https://github.com/mostafaamiri/SearchInstruct)

View on arXivView PDF

Code Implementations(1)

MIT

SearchInstruct is a powerful tool for generating instruction datasets by leveraging seed instructions and generating similar variations. This repository provides a framework for creating diversified instruction datasets that can be used in various natural language processing (NLP) applications.

122Shell, PythonNov 3, 20241 years agoMIT

Similar Papers

Cite this paper

@article{barati2025searchinstruct,
  title  = {SearchInstruct: Enhancing Domain Adaptation via Retrieval-Based Instruction Dataset Creation},
  author = {Iman Barati and Mostafa Amiri and Heshaam Faili},
  year   = {2025},
  eprint = {2509.10708},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.10708v1}
}

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/2509.10708.svg)](https://codeofpaper.com/paper/2509.10708)

Discussion