揭示NLP预训练与微调背后的机制,发现词元匹配集群提升模型性能。
Learning Mechanism Underlying NLP Pre-Training and Fine-Tuning
- 通过词元出现频率与准确率关联,构建量化预训练成功的顺序参数。
- 预训练在深层变压器中形成强匹配词元簇,显著提升分类任务精度。
- 该机制适用于语言与图像任务,暗示其具有通用性,适合研究模型内部原理者。
自然语言处理(NLP)通常采用大规模数据预训练复杂架构,再微调权重以实现特定任务。本文研究预训练成功机制及预训练准确率与下游分类任务微调之间的关系。结果显示:单个词元的准确率(APT)随其在数据集中出现频率上升,所有词元的平均APT作为顺序参数,随变压器层数增加而提高;预训练打破词元对称性,形成有限、小型、强匹配的词元簇,这一特征在深层中愈发明显,显著优于嵌入层表现;尽管学习目标仅针对单个词元预测,预训练仍生成高阶语言结构。这些发现反映在微调准确率随层数提升上。此外,输出标签预测置信度与输入平均APT无关,因输入语义由强匹配词元保持。值得注意的是,虽图像分类常无预训练,但其机制与NLP微调相似,暗示该机制具有普遍性。实验基于在Wikipedia上预训练的BERT-6架构,在FewRel与DBpedia分类任务上微调。
原文摘要 · Abstract (English)
Natural language processing (NLP) enables the understanding and generation of meaningful human language, typically using a pre-trained complex architecture on a large dataset to learn the language and next fine-tune its weights to implement a specific task. Twofold goals are examined; to understand the mechanism underlying successful pre-training and to determine the interplay between the pre-training accuracy and the fine-tuning of classification tasks. The following main results were obtained; the accuracy per token (APT) increased with its appearance frequency in the dataset, and its average over all tokens served as an order parameter to quantify pre-training success, which increased along the transformer blocks. Pre-training broke the symmetry among tokens and grouped them into finite, small, strong match token clusters, as inferred from the presented token confusion matrix. This feature was sharpened along the transformer blocks toward the output layer, enhancing its performance considerably compared with that of the embedding layer. Consequently, higher-order language structures were generated by pre-training, even though the learning cost function was directed solely at identifying a single token. These pre-training findings were reflected by the improved fine-tuning accuracy along the transformer blocks. Additionally, the output label prediction confidence was found to be independent of the average input APT, as the input meaning was preserved since the tokens are replaced primarily by strong match tokens. Finally, although pre-training is commonly absent in image classification tasks, its underlying mechanism is similar to that used in fine-tuning NLP classification tasks, hinting at its universality. The results were based on the BERT-6 architecture pre-trained on the Wikipedia dataset and fine-tuned on the FewRel and DBpedia classification tasks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。