![](https://i-blog.csdnimg.cn/blog_migrate/1ac2c3a6a133b1a5d3c3e808c04d71db.png)
扫码参与CSDN“原力计划”
作者 | 杨扬 佳昊 金刚等
来源 | CSDN原力计划作品
*点击阅读原文,查看美团技术团队更多干货文章。
背景
![图1 NLP Pre-training and Fine-tuning新范式及相关扩展工作](https://i-blog.csdnimg.cn/blog_migrate/457e04c32257a372b20041345f9b0b76.png)
![图2 BERT及Transformer网络结构示意图](https://i-blog.csdnimg.cn/blog_migrate/5ebc4256e09a98bba1a2112f7549cab7.png)
![](https://i-blog.csdnimg.cn/blog_migrate/622c504e0b04e04870e09ba2c0b30cef.png)
![图3 BERT模型的输入表示](https://i-blog.csdnimg.cn/blog_migrate/bfe0d807d59b793eb4b4dff587482abb.png)
-
对于英文模型,使用了Wordpiece模型来产生Subword从而减小词表规模;对于中文模型,直接训练基于字的模型。 -
模型输入需要附加一个起始Token,记为[CLS],对应最终的Hidden State(即Transformer的输出)可以用来表征整个句子,用于下游的分类任务。 -
模型能够处理句间关系。为区别两个句子,用一个特殊标记符[SEP]进行分隔,另外针对不同的句子,将学习到的Segment Embeddings 加到每个Token的Embedding上。 -
对于单句输入,只有一种Segment Embedding;对于句对输入,会有两种Segment Embedding。
![图4 MT-BERT整体技术框架](https://i-blog.csdnimg.cn/blog_migrate/5c9e8d9612d63a554ac28800e74089ab.png)
![](https://i-blog.csdnimg.cn/blog_migrate/6373a6d4793f4262475b4da023d33b40.png)
![](https://i-blog.csdnimg.cn/blog_migrate/11ccd29f698a5bf22e6b6deaf3035e51.png)
![](https://i-blog.csdnimg.cn/blog_migrate/45bcc108dc6fe2159280ce9178fe5001.png)
![](https://i-blog.csdnimg.cn/blog_migrate/0bcd49ca7f68f79ad337f8619861c972.png)
![图6 MT-BERT默认Masking策略和Whole Word Masking策略对比](https://i-blog.csdnimg.cn/blog_migrate/b9ab7b86ec9ecc0d6e8b8c2c797d47d8.png)
![](https://i-blog.csdnimg.cn/blog_migrate/785625959680eb66b6d2a4e5ecbd40dd.png)
-
低精度量化。在模型训练和推理中使用低精度( FP16甚至INT8、二值网络)表示取代原有精度(FP32)表示。 -
模型裁剪和剪枝。减少模型层数和参数规模。 -
模型蒸馏。通过知识蒸馏方法[22]基于原始BERT模型蒸馏出符合上线要求的小模型。
![图7 裁剪前后MT-BERT模型在Query意图分类数据集上F1对比](https://i-blog.csdnimg.cn/blog_migrate/837d92a17ea711700e9fa7f93fb09893.png)
-
句对分类任务和单句分类任务是句子级别的任务。预训练中的NSP任务使得BERT中的“[CLS]”位置的输出包含了整个句子对( 句子)的信息,我们利用其在有标注的数据上微调模型,给出预测结果。 -
问答和序列标注任务都属于词级别的任务。预训练中的MLM任务使得每个Token位置的输出都包含了丰富的上下文语境以及Token本身的信息,我们对BERT的每个Token的输出都做一次分类,在有标注的数据上微调模型并给出预测。
![图8 BERT微调支持的任务类型](https://i-blog.csdnimg.cn/blog_migrate/2663cf4c01f6f878e770fc2fd48280c1.png)
![图9 基于MT-BERT的多任务细粒度情感分析模型架构](https://i-blog.csdnimg.cn/blog_migrate/665e58ff6555c44d281c5d69739bab21.png)
![图10 大众点评精选点评模块产品形态](https://i-blog.csdnimg.cn/blog_migrate/d4c1927b6e2434622c7f5592318c42ba.png)
![图11 MBM模型的业务效果](https://i-blog.csdnimg.cn/blog_migrate/a86016ffe40eb5315a39d355f8c36bcd.png)
![图12 外卖和酒店场景下推荐理由](https://i-blog.csdnimg.cn/blog_migrate/5322e6c658615a773d6f6faf4e302eec.png)
![图13 酒店Query的成分分析](https://i-blog.csdnimg.cn/blog_migrate/f37137d67adc999e3b9a26d90ffae362.png)
[1] Peters, Matthew E., et al. "Deep contextualized word representations." arXiv preprint arXiv:1802.05365 (2018).
[2] Howard, Jeremy, and Sebastian Ruder. "Universal language model fine-tuning for text classification." arXiv preprint arXiv:1801.06146 (2018).
[3] Vaswani, Ashish, et al. "Attention is all you need." Advances in neural information processing systems. 2017.
[4] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. 2018. Improving Language Understanding by Generative Pre-Training. Technical report, OpenAI.
[5] Devlin, Jacob, et al. "Bert: Pre-training of deep bidirectional transformers for language understanding." arXiv preprint arXiv:1810.04805 (2018).
[6] Ming Zhou. "The Bright Future of ACL/NLP." Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. (2019).
[7] Deng, Jia, et al. "Imagenet: A large-scale hierarchical image database." 2009 IEEE conference on computer vision and pattern recognition. Ieee, (2009).
[8] Girshick, Ross, et al. "Rich feature hierarchies for accurate object detection and semantic segmentation." Proceedings of the IEEE conference on computer vision and pattern recognition. 2014.
[9] Mikolov, Tomas, et al. "Distributed representations of words and phrases and their compositionality." Advances in neural information processing systems. 2013.
[10] Jeffrey Pennington, Richard Socher, and Christopher D. Manning. 2014. Glove: Global vectors for word representation. In EMNLP.
[11] Oren Melamud, Jacob Goldberger, and Ido Dagan.2016. context2vec: Learning generic context embedding with bidirectional lstm. In CoNLL.
[12] Hochreiter, Sepp, and Jürgen Schmidhuber. "Long short-term memory." Neural computation 9.8 (1997): 1735-1780.
[13] 张俊林. 从Word Embedding到BERT模型—自然语言处理中的预训练技术发展史. https://zhuanlan.zhihu.com/p/49271699
[14] Sebastion Ruder. "NLP's ImageNet moment has arrived." http://ruder.io/nlp-imagenet/. (2019)
[15] Liu, Yinhan, et al. "Roberta: A robustly optimized BERT pretraining approach." arXiv preprint arXiv:1907.11692 (2019).
[16] 郑坤. 使用TensorFlow训练WDL模型性能问题定位与调优. https://tech.meituan.com/2018/04/08/tensorflow-performance-bottleneck-analysis-on-hadoop.html
[17] Uber. "Meet Horovod: Uber’s Open Source Distributed Deep Learning Framework for TensorFlow". https://eng.uber.com/horovod/
[18] Goyal, Priya, et al. "Accurate, large minibatch sgd: Training imagenet in 1 hour." arXiv preprint arXiv:1706.02677 (2017).
[19] Baidu. https://github.com/baidu-research/baidu-allreduce
[20] Micikevicius, Paulius, et al. "Mixed precision training." arXiv preprint arXiv:1710.03740 (2017).
[21] 仲远,富峥等. 美团餐饮娱乐知识图谱——美团大脑揭秘. https://tech.meituan.com/2018/11/22/meituan-brain-nlp-01.html
[22] Hinton, Geoffrey, Oriol Vinyals, and Jeff Dean. "Distilling the knowledge in a neural network." arXiv preprint arXiv:1503.02531 (2015).
[23] Google. ALBERT: A Lite BERT for Self-supervised Learning of Language Representations. https://openreview.net/pdf?id=H1eA7AEtvS. (2019)
(*本文为CSDN原力计划评选文章,转载请联系原作者)
◆
精彩推荐
◆
开幕倒计时13天|2019 中国大数据技术大会(BDTC)即将震撼来袭!豪华主席阵容及百位技术专家齐聚,十余场精选专题技术和行业论坛,超强干货+技术剖析+行业实践立体解读。6.6 折票限时特惠(立减1400元),学生票仅 599 元!
2097352GB地图数据,AI技术酷炫渲染,《微软飞行模拟器》游戏即将上线
用Go重构C语言系统,这个抗住春晚红包的百度转发引擎承接了万亿流量
日均350000亿接入量,腾讯TubeMQ性能超过Kafka
从基本组件到结构创新,67页论文解读深度卷积神经网络架构
用于多任务CNN的随机滤波分组,性能超现有基准方法
AutoML未来可期,工程师的明天何去何从?
揭秘支撑双 11 买买买背后的硬核黑科技!
假如有人把支付宝存储服务器炸了
乔布斯的简历 120 万被拍卖,HR 看了想打人
区块链+“中国制造”:一文看懂区块链如何提升供应链金融活力与效能!
你点的每个“在看”,我都认真当成了AI