Balanced Data Sampling for Language Model Training with Clustering

Yunfan Shao, Linyang Li, Zhaoye Fei, Hang Yan, Dahua Lin +1 more
2/22/2024
cs.CLcs.AI

No official code found. Best implementation: choosewhatulike/cluster-clip (15 stars, Apache-2.0, last commit 2024-06-03).

Abstract

Data plays a fundamental role in the training of Large Language Models (LLMs). While attention has been paid to the collection and composition of datasets, determining the data sampling strategy in training remains an open question. Most LLMs are trained with a simple strategy, random sampling. However, this sampling strategy ignores the unbalanced nature of training data distribution, which can be sub-optimal. In this paper, we propose ClusterClip Sampling to balance the text distribution of training data for better model training. Specifically, ClusterClip Sampling utilizes data clustering to reflect the data distribution of the training set and balances the common samples and rare samples during training based on the cluster results. A repetition clip operation is introduced to mitigate the overfitting issue led by samples from certain clusters. Extensive experiments validate the effectiveness of ClusterClip Sampling, which outperforms random sampling and other cluster-based sampling variants under various training datasets and large language models.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Multi-GPU supported kmeans clustering for cluser-clip

150PythonMay 28, 20242 years agoApache-2.0

Similar Papers

Cite this paper

@article{shao2024balanced,
  title  = {Balanced Data Sampling for Language Model Training with Clustering},
  author = {Yunfan Shao and Linyang Li and Zhaoye Fei and Hang Yan and Dahua Lin and Xipeng Qiu},
  year   = {2024},
  eprint = {2402.14526},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.14526v2}
}

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

Discussion