探索LESS:有针对性的教学调整中的重要数据选择
🚀 预印本论文
LESS是一个创新的开源项目,它提供了从大量数据中选择影响力数据以诱导特定能力的方法。这个项目的核心是优化机器学习模型的训练过程,通过智能地选择一小部分关键数据,以实现更高效和精确的指令调优。
快速入门链接 🔗
安装要求 📦
首先确保已安装PyTorch。然后按照以下步骤安装LESS所需的所有依赖:
- 运行
pip3 install torch==2.1.2 torchvision torchaudio
安装基础库。 - 进入LESS项目目录并运行
pip install -r requirement.txt
安装其他依赖。 - 使用
pip install -e .
以开发模式安装less
包。
数据准备 📁
遵循open-instruct的说明准备四个指令调优数据集:Flan v2、COT、Dolly和Open Assistant。用于评估时,我们还使用了MMLU、Tydiqa和BBH三个额外的数据集。这些处理过的文件可在此处获取:huggingface/datasets/princeton-nlp/less_data。
数据选择管道 💡
数据选择分为四步:
- 预热训练:使用LoRA方法对少量数据进行初步训练。
- 构建梯度数据库:收集所有训练数据的梯度信息。
- 任务特定数据选择:计算每个训练数据点的影响得分,并选择高影响力数据。
- 选定数据训练:使用精选数据进一步微调模型。
每一步都有详尽的示例脚本指导,包括如何执行预热训练、创建梯度数据库以及进行数据选取和模型训练。
评估 📊
在evaluation文件夹内查看详细的评价指南,了解如何评估模型在选定数据上的表现。
问题与反馈 ❓
有任何问题或遇到bug,请联系Mengzhou (mengzhou@princeton.edu) 或者直接在项目仓库中打开新问题。
引用 📝
若你在工作中受益于该项目,请引用以下论文:
@article{xia2024less,
title={Less: Selecting Influential Data for Instruction Tuning},
author={Xia, Mengzhou and Malladi, Sadhika and Gururangan, Suchin and Arora, Sanjeev and Chen, Danqi},
year={2024}
}
LESS项目是一个强大的工具,不仅有助于提升模型的性能,还能有效减少训练时间和资源消耗。无论是学术研究还是工业应用,它都是一个值得尝试的优秀解决方案。立即加入,体验影响力数据选择的魅力吧!