Threshold Filtering Packing for Supervised Fine-Tuning: Training Related Samples within Packs
<|reference_start|>Threshold Filtering Packing for Supervised Fine-Tuning: Training Related Samples within Packs: Packing for Supervised Fine-Tuning (SFT) in autoregressive models involves concatenating data points of varying lengths until reaching the designed maximum length to facilitate GPU processing. However, randomly concatenating data points and feeding them into an autoregressive transformer can lead to cross-contamination of sequences due to the significant difference in their subject matter. The mainstream approaches in SFT ensure that each token in the attention calculation phase only focuses on tokens within its own short sequence, without providing additional learning signals for the preceding context. To address these challenges, we introduce Threshold Filtering Packing (TFP), a method that selects samples with related context while maintaining sufficient diversity within the same pack. Our experiments show that TFP offers a simple-to-implement and scalable approach that significantly enhances SFT performance, with observed improvements of up to 7\% on GSM8K, 4\% on HumanEval, and 15\% on the adult-census-income dataset.<|reference_end|>
@article{dong2024threshold,
    title={Threshold Filtering Packing for Supervised Fine-Tuning: Training Related
  Samples within Packs},
    author={Jiancheng Dong, Lei Jiang, Wei Jin, Lu Cheng},
    journal={arXiv preprint arXiv:2408.09327},
    year={2024},
    archivePrefix={arXiv},
    eprint={2408.09327},
    primaryClass={cs.LG cs.CL}
}