Optimizing Large Language Models on Multi-Core CPUs: A Case Study of the BERT Model

Author:

Zhao Lanxin1,Gao Wanrong2,Fang Jianbin2ORCID

Affiliation:

1. School of International Business, Hunan University of Information Technology, Changsha 410151, China

2. School of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China

Abstract

The BERT model is regarded as the cornerstone of various pre-trained large language models that have achieved promising results in recent years. This article investigates how to optimize the BERT model in terms of fine-tuning speed and prediction accuracy, aiming to accelerate the execution of the BERT model on a multi-core processor and improve its prediction accuracy in typical downstream natural language processing tasks. Our contributions are two-fold. First, we port and parallelize the fine-tuning training of the BERT model on a multi-core shared-memory processor. We port the BERT model onto a multi-core processor platform to accelerate the fine-tuning training process of the model for downstream tasks. Second, we improve the prediction performance of typical downstream natural language processing tasks through fine-tuning the model parameters. We select five typical downstream natural language processing tasks (CoLA, SST-2, MRPC, RTE, and WNLI) and perform optimization on the multi-core platform, taking the hyperparameters of batch size, learning rate, and training epochs into account. Our experimental results show that, by increasing the number of CPUs and the number of threads, the model training time can be significantly reduced. We observe that the reduced time is primarily concentrated in the self-attention mechanism. Our further experimental results show that setting reasonable hyperparameters can improve the accuracy of the BERT model when applied to downstream tasks and that appropriately increasing the batch size under conditions of sufficient computing resources can significantly reduce training time.

Funder

Social Science Fund of Hunan Province, China

National Natural Science Foundation of China

Publisher

MDPI AG

Reference31 articles.

1. Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processing;Liu;ACM Comput. Surv.,2023

2. Distributed Representations of Sentences and Documents;Le;Proc. Mach. Learn. Res.,2014

3. Pennington, J., Socher, R., and Manning, C.D. (2014, January 25–29). Glove: Global Vectors for Word Representation. Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP) 2014, Doha, Qatar.

4. Dai, A.M., and Le, Q.V. (2015, January 7–12). Semi-supervised Sequence Learning. Proceedings of the 28th Conference and Workshop on Neural Information Processing Systems, Montreal, QC, Canada.

5. Long Short-Term Memory;Hochreiter;Neural Comput.,1997

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3