Data Whisperer: Efficient Data Selection for Task-Specific LLM Fine-Tuning via Few-Shot In-Context Learning

Shaobo Wang, Xiangqi Jin, Ziming Wang, Jize Wang, Jiajun Zhang +6 more
5/18/2025
cs.CL

Official code: gszfwsb/Data-Whisperer (52 stars, last commit 2025-08-04).

Abstract

Fine-tuning large language models (LLMs) on task-specific data is essential for their effective deployment. As dataset sizes grow, efficiently selecting optimal subsets for training becomes crucial to balancing performance and computational costs. Traditional data selection methods often require fine-tuning a scoring model on the target dataset, which is time-consuming and resource-intensive, or rely on heuristics that fail to fully leverage the model's predictive capabilities. To address these challenges, we propose Data Whisperer, an efficient, training-free, attention-based method that leverages few-shot in-context learning with the model to be fine-tuned. Comprehensive evaluations were conducted on both raw and synthetic datasets across diverse tasks and models. Notably, Data Whisperer achieves superior performance compared to the full GSM8K dataset on the Llama-3-8B-Instruct model, using just 10% of the data, and outperforms existing methods with a 3.1-point improvement and a 7.4$\times$ speedup. The code is available at https://github.com/gszfwsb/Data-Whisperer.

View on arXivView PDF

Code Implementations(1)

Code for ACL 2025 Main paper "Data Whisperer: Efficient Data Selection for Task-Specific LLM Fine-Tuning via Few-Shot In-Context Learning".

525Shell, PythonMay 17, 20251 years ago
data-pruningdata-selectionefficient-trainingllamallm+3 more

Similar Papers

Cite this paper

@article{wang2025data,
  title  = {Data Whisperer: Efficient Data Selection for Task-Specific LLM Fine-Tuning via Few-Shot In-Context Learning},
  author = {Shaobo Wang and Xiangqi Jin and Ziming Wang and Jize Wang and Jiajun Zhang and Kaixin Li and Zichen Wen and Zhong Li and Conghui He and Xuming Hu and Linfeng Zhang},
  year   = {2025},
  eprint = {2505.12212},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.12212v3}
}

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

Discussion