arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2205.01541cs.LGcs.CL
收藏

边缘上BERT模型的有效微调

Efficient Fine-Tuning of BERT Models on the Edge

McGill University(麦吉尔大学)

Danilo Vucetic, Mohammadreza Tayaranian, Maryam Ziaeefard, James J. Clark, Brett H. Meyer, Warren J. Gross

摘要:

资源受限的设备越来越多地成为机器学习应用的部署目标。然而,静态模型并不总是满足动态环境的要求。模型的设备上训练允许快速适应新场景。随着深度神经网络规模的增加,如BERT和其他自然语言处理模型所指出的那样,资源需求也随之增加,即内存、计算、能量和时间。此外,训练比推理更需要资源。因此,资源受限的设备上学习是双重困难的,特别是对于大型BERT类模型。通过减少微调的内存使用,预训练的BERT模型可以变得足够高效,以在资源受限的设备上进行微调。我们提出了冻结和重新配置(FAR),这是一种用于BERT类模型的内存高效训练机制,通过避免不必要的参数更新来减少微调过程中激活映射的内存使用。FAR将DistilBERT模型和CoLA数据集的微调时间减少了30%,将内存操作时间减少了47%。更广泛地说,GLUE和SQuAD数据集的指标性能平均下降约1%。

英文摘要:

Resource-constrained devices are increasingly the deployment targets of machine learning applications. Static models, however, do not always suffice for dynamic environments. On-device training of models allows for quick adaptability to new scenarios. With the increasing size of deep neural networks, as noted with the likes of BERT and other natural language processing models, comes increased resource requirements, namely memory, computation, energy, and time. Furthermore, training is far more resource intensive than inference. Resource-constrained on-device learning is thus doubly difficult, especially with large BERT-like models. By reducing the memory usage of fine-tuning, pre-trained BERT models can become efficient enough to fine-tune on resource-constrained devices. We propose Freeze And Reconfigure (FAR), a memory-efficient training regime for BERT-like models that reduces the memory usage of activation maps during fine-tuning by avoiding unnecessary parameter updates. FAR reduces fine-tuning time on the DistilBERT model and CoLA dataset by 30%, and time spent on memory operations by 47%. More broadly, reductions in metric performance on the GLUE and SQuAD datasets are around 1% on average.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑