Fine-Tuned Transformers Show Clusters of Similar Representations Across Layers

Fine-Tuned Transformers Show Clusters of Similar Representations Across Layers
复制标题

DOI:
10.18653/v1/2021.blackboxnlp-1.42
复制
发表时间:
2021-09
期刊:
--
影响因子:
--
通讯作者:
Jason Phang;Haokun Liu;Samuel R. Bowman
Jason Phang;Haokun Liu;Samuel R. Bowman
中科院分区:
其他
文献类型:
--
作者:
Jason Phang;Haokun Liu;Samuel R. Bowman

文献摘要

被引文献

相似文献

尽管针对下游自然语言理解 (NLU) 任务成功地对 BERT 等预训练语言编码器进行了微调,但人们仍然对神经网络在微调后如何变化知之甚少。在这项工作中,我们使用中心核对齐(CKA),一种比较学习表示的方法,来测量跨层任务调整模型中表示的相似性。在 12 个 NLU 任务的实验中,我们发现微调的 RoBERTa 和 ALBERT 模型中表示的相似性具有一致的块对角结构,并且在早期层和后期层的簇内具有很强的相似性,但在它们之间则不然。后面层表示的相似性意味着后面的层对任务性能的影响很小,我们在实验中验证了经过微调的 Transformer 的前几层可以被丢弃,而不会损害性能,即使没有进一步的调整。
Despite the success of fine-tuning pretrained language encoders like BERT for downstream natural language understanding (NLU) tasks, it is still poorly understood how neural networks change after fine-tuning. In this work, we use centered kernel alignment (CKA), a method for comparing learned representations, to measure the similarity of representations in task-tuned models across layers. In experiments across twelve NLU tasks, we discover a consistent block diagonal structure in the similarity of representations within fine-tuned RoBERTa and ALBERT models, with strong similarity within clusters of earlier and later layers, but not between them. The similarity of later layer representations implies that later layers only marginally contribute to task performance, and we verify in experiments that the top few layers of fine-tuned Transformers can be discarded without hurting performance, even with no further tuning.