Theory Overview:
Training Framwork PDS:
- Solve data quality scores based on a small model (160M), small total steps (100), SGD, and small proxy data (163,840 samples).
- Fit the scores on the small proxy data with a 125M fairseq dense model (data scorer).
- Annotate scores for large data (entire CC) with the data scorer.
- Filter CC with the scores.
- Pre-train the model.
- Models Trained on Redpajama CC (Conventional Pre-Training, Baselines)
- Models Trained PDS-Selected Data
TODO
The following pipeline can also be found in scripts/pipeline.sh.
conda create -n data_selection python=3.10
conda activate data_selection
bash install.sh
export BASE_PATH=/PATH/TO/THIS/PROJECT
# or export BASE_PATH=$PWDFirst download Redpajama CC. Then run tokenization.
bash $BASE_PATH/scripts/tools/process_cc.sh $BASE_PATH1.2 Convert tokenized CC for data scorer inference if the data scorer and pre-training use different tokenizer
bash $BASE_PATH/scripts/tools/convert_tokenization.sh $BASE_PATHbash $BASE_PATH/scripts/tools/sample_proxy_data.sh $BASE_PATHbash $BASE_PATH/scripts/pretrain/160M_bsl.sh $BASE_PATHFirst download lima. Then run tokenization.
bash $BASE_PATH/scripts/tools/process_data/lima.sh $BASE_PATHbash $BASE_PATH/scripts/pmp_solver/160M.sh $BASE_PATHpython3 $BASE_PATH/tools/get_checkpoints.py # fairseq 125M. Base model of the data scorerbash $BASE_PATH/scripts/tools/prepare_data_scorer_train_data.sh $BASE_PATHbash $BASE_PATH/scripts/data_scorer/train.sh $BASE_PATHbash $BASE_PATH/scripts/data_scorer/infer.sh $BASE_PATHbash $BASE_PATH/scripts/tools/select_pretrain_data.sh $BASE_PATH# bash $BASE_PATH/scripts/pretrain/160M_bsl.sh $BASE_PATH # already pre-trained
bash $BASE_PATH/scripts/pretrain/160M_pds.sh $BASE_PATH
bash $BASE_PATH/scripts/pretrain/470M_bsl.sh $BASE_PATH
bash $BASE_PATH/scripts/pretrain/470M_pds.sh $BASE_PATH
bash $BASE_PATH/scripts/pretrain/1B_bsl.sh $BASE_PATH
bash $BASE_PATH/scripts/pretrain/1B_pds.sh $BASE_PATH
bash $BASE_PATH/scripts/pretrain/1.7B_bsl.sh $BASE_PATH
bash $BASE_PATH/scripts/pretrain/1.7B_pds.sh $BASE_PATHFirst download dclm. Then run tokenization.
bash $BASE_PATH/scripts/tools/process_data/dclm.sh $BASE_PATHfor model_size in 160M 470M 1B 1.7B
do
bash $BASE_PATH/scripts/eval_offline/lm_harness/${model_size}_bsl.sh $BASE_PATH
bash $BASE_PATH/scripts/eval_offline/lm/${model_size}_bsl.sh $BASE_PATH
bash $BASE_PATH/scripts/eval_offline/lm_harness/${model_size}_pds.sh $BASE_PATH
bash $BASE_PATH/scripts/eval_offline/lm/${model_size}_pds.sh $BASE_PATH
done@article{gu2024data, title={Data Selection via Optimal Control for Language Models}, author={Gu, Yuxian and Dong, Li and Wang, Hongning and Hao, Yaru and Dong, Qingxiu and Wei, Furu and Huang, Minlie}, journal={arXiv preprint arXiv:2410.07064}, year={2024} }

