Skip to main content
QUICK REVIEW

[论文解读] DeepSpeed Data Efficiency: Improving Deep Learning Model Quality and Training Efficiency via Efficient Data Sampling and Routing

Conglong Li, Zhewei Yao|arXiv (Cornell University)|Dec 7, 2022
Advanced Neural Network ApplicationsComputer Science被引用 8
一句话总结

本文提出 DeepSpeed Data Efficiency,一种通过结合可扩展的课程学习以实现高效数据采样,以及一种新颖的随机逐层标记丢弃(random-LTD)技术以实现数据路由的框架。该框架在保持 GPT-3 1.3B 预训练模型 95% 基线质量的前提下,将数据、时间和成本减少至原来的 1/12.5,最低可降至 Azure 上的 3.7K 美元。

ABSTRACT

Recent advances on deep learning models come at the price of formidable training cost. The increasing model size is one of the root causes, but another less-emphasized fact is that data scale is actually increasing at a similar speed as model scale, and the training cost is proportional to both of them. Compared to the rapidly evolving model architecture, how to efficiently use the training data (especially for the expensive foundation model pretraining) is both less explored and difficult to realize due to the lack of a convenient framework that focuses on data efficiency capabilities. To this end, we present DeepSpeed Data Efficiency, a framework that makes better use of data, increases training efficiency, and improves model quality. Specifically, we propose and combine two data efficiency techniques: efficient data sampling via a general curriculum learning library, and efficient data routing via a novel random layerwise token dropping technique. For GPT-3 1.3B language model pretraining, our work achieves 12.5x less data/time/cost (\$3.7K if rent on Azure), while still maintaining 95% of model quality compared to baseline with full data and cost (\$46.3K). For GPT-3 1.3B and BERT-large pretraining, our work can also achieve the same model quality with up to 2x less data/time/cost, or achieve better model quality under same data/time/cost. DeepSpeed Data Efficiency is easy to use and tune, enabling us to easily apply it and verify its benefit on additional tasks including GPT-3 MoE model pretraining and small-scale GPT-2/ViT finetuning.

研究动机与目标

  • 解决大规模深度学习中因模型和数据规模增长而带来的训练成本上升问题。
  • 克服现有数据效率技术的局限性,如缺乏可扩展性、可定制性以及与训练流水线的兼容性。
  • 开发一个统一且可扩展的框架,提升预训练和微调过程中 NLP 与视觉模型的数据采样与路由效率。
  • 在不牺牲模型质量的前提下,显著降低数据、时间和成本,尤其针对基础模型的预训练。
  • 提供用户友好、兼容 PyTorch 的工具集,支持数据效率策略的轻松集成与调优。

提出的方法

  • 提出一种基于映射-归约的通用课程学习(CL)库,用于在大规模数据集上实现可扩展、基于指标的数据分析与索引。
  • 实现可自定义的基于课程学习的数据采样器与加载器,支持多种难度指标与训练策略。
  • 提出随机逐层标记丢弃(random-LTD),一种数据路由技术,可在每个 Transformer 层跳过部分标记的计算,从而降低 FLOPs。
  • 设计逐层标记丢弃机制以保持模型稳定性与性能,尤其适用于 GPT 等自回归生成模型。
  • 集成 MSLG(最小样本损失梯度)策略,动态根据模型损失调整标记丢弃,提升训练效率。
  • 确保与 PyTorch 兼容,并支持多种模型架构,包括 GPT-3、BERT-large、ViT 和 MoE 架构。

实验结果

研究问题

  • RQ1课程学习能否实现可扩展与泛化,以在大规模预训练中支持多样化的数据采样策略,而无需大量代码重构?
  • RQ2像 random-LTD 这样的数据路由技术,能否在预训练过程中同时实现更高的训练效率与更好的模型质量,超越现有方法(如 TokenBypass)?
  • RQ3数据效率技术在多大程度上能降低训练成本,同时在不同模型架构上维持或提升模型性能?
  • RQ4在真实预训练场景中,结合数据采样与路由技术如何影响整体训练效率与模型质量?
  • RQ5所提出的框架能否在包括 MoE 模型和小规模微调在内的多种任务中轻松扩展与调优?

主要发现

  • 在 GPT-3 1.3B 预训练中,DeepSpeed Data Efficiency 将训练成本从 46.3K 美元降至 3.7K 美元(降低 12.5 倍),同时保持 95% 的基线模型质量。
  • 在 GPT-3 1.3B 和 BERT-large 预训练中,该框架在最多减少 2 倍数据、时间与成本的同时,达到与基线相同的模型质量,或在相同资源约束下实现更优性能。
  • 在所有测试设置中,random-LTD 均优于 TokenBypass:在 GPT-2 微调与 GPT-3 350M 预训练中,相同标记保留率下,其困惑度更低。
  • 集成 MSLG 后,random-LTD 在 ViT 模型上实现 1.3 倍训练加速,同时略微提升准确率,优于 EViT(1.15 倍加速)与 Peeling the Onion(1.15 倍加速)。
  • 该框架在多种任务中均实现一致改进,包括 MoE 模型预训练与小规模 GPT-2/ViT 微调,且调优工作量极小。
  • 通用课程学习库支持可扩展、可定制的数据采样,仅需极少流水线修改,可快速支持不同难度指标的实验。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。