基于自集成与自蒸馏的BERT微调方法
Improving BERT Fine-Tuning via Self-Ensemble and Self-Distillation
-
摘要:研究背景 运动捕捉技术被广泛地应用于电影制作、游戏开发、医疗辅助诊断等领域。使用运动捕捉工具可以捕捉并储存大量的运动数据,在重用这些数据的过程中,如何快速、精准地定位到所需类别的运动捕捉数据是提高重用效率的关键。然而,在进行运动捕捉的过程中,有些捕捉到的序列没有及时地进行规范的裁剪和准确的标注。同时,使用简单的标签进行标注也无法准确地描述运动数据。此外,在运动捕捉工具的使用中,无可避免地会因为设备、场地或动作等原因,产生抖动(奇异帧)或其他失真现象。因此,如何准确、迅速地从各种运动捕捉数据中检索所需数据是一个极具挑战并亟待解决的问题。目的 为了解决在检索运动捕捉数据时遇到的未裁剪、未标注、奇异帧等问题,我们致力于设计一种基于内容的、无监督的、对奇异帧鲁棒的、可进行子序列级别检索的运动捕捉检索算法。方法 我们提出的PESTA算法是一种通过对姿态进行编码,并对得到的编码序列进行灵活匹配的子序列检索算法。我们使用无监督的对抗自编码器对数据库中的所有姿态(帧)进行聚类以灵活获取姿态字典,并基于字典对任何运动捕捉序列进行去冗余的编码。随后我们使用编码后的查询序列在编码后的数据库中进行灵活的时序对齐,以检索与之最相似的序列。此外,针对在长被检序列中连续进行多次子序列检索的使用场景,我们提出了一种灵活的提升检索效率的扩展方案。结果 我们在两个公开数据集和一个自采数据集上分别对算法的完整序列检索、子序列检索以及针对长被检序列的子序列检索进行了测试。我们算法整体的准确度以及不同运动类别的准确度均明显优于对比工作。针对较长被检索序列的场景,我们的扩展方案可以在轻微牺牲准确度的情况下显著提升检索效率。此外,我们针对算法的编码部分和时序对齐部分进行了消融实验。实验证明两部分均有较好的效果。另外,编码算法由于其灵活性,可以在准确率和效率之间进行平衡,而时序对齐算法凭借其灵活性,在针对奇异帧的抗干扰的实验中取得了优秀的效果。结论 通过实验我们验证了算法在针对未裁剪、未标注、有奇异帧的运动捕捉数据完整序列和子序列检索场景时的有效性,为更有效的数据重用提供了解决方案。同时,通过更改查询序列的数据形式,我们的算法可以实现更丰富的应用,例如将查询序列改为运动视频,通过提取视频中的人物姿态实现基于视频的运动捕捉数据检索。此外,我们算法的框架也可以被应用到其他领域。对于任意由时间序列组成的数据集,均可使用字典编码和灵活时序对齐的方法实现完整序列或子序列检索。Abstract: Fine-tuning pre-trained language models like BERT have become an effective way in natural language processing (NLP) and yield state-of-the-art results on many downstream tasks. Recent studies on adapting BERT to new tasks mainly focus on modifying the model structure, re-designing the pre-training tasks, and leveraging external data and knowledge. The fine-tuning strategy itself has yet to be fully explored. In this paper, we improve the fine-tuning of BERT with two effective mechanisms: self-ensemble and self-distillation. The self-ensemble mechanism utilizes the checkpoints from an experience pool to integrate the teacher model. In order to transfer knowledge from the teacher model to the student model efficiently, we further use knowledge distillation, which is called self-distillation because the distillation comes from the model itself through the time dimension. Experiments on the GLUE benchmark and the Text Classification benchmark show that our proposed approach can significantly improve the adaption of BERT without any external data or knowledge. We conduct exhaustive experiments to investigate the efficiency of the self-ensemble and self-distillation mechanisms, and our proposed approach achieves a new state-of-the-art result on the SNLI dataset.