Skip to main content
QUICK REVIEW

[论文解读] On Robustness of Finetuned Transformer-based NLP Models

Pavan Kalyan Reddy Neerudu, Subba Reddy Oota|arXiv (Cornell University)|May 23, 2023
Topic ModelingComputer Science被引用 3
一句话总结

本文利用 CKA 和 STIR 分析不同层间表征变化,研究微调后的 Transformer 模型(BERT、GPT-2、T5)对输入文本扰动的鲁棒性。与 BERT 和 T5 相比,GPT-2 展现出更优的鲁棒性,其中名词/动词删除以及字符级更改是最具破坏性的扰动类型。

ABSTRACT

Transformer-based pretrained models like BERT, GPT-2 and T5 have been finetuned for a large number of natural language processing (NLP) tasks, and have been shown to be very effective. However, while finetuning, what changes across layers in these models with respect to pretrained checkpoints is under-studied. Further, how robust are these models to perturbations in input text? Does the robustness vary depending on the NLP task for which the models have been finetuned? While there exists some work on studying the robustness of BERT finetuned for a few NLP tasks, there is no rigorous study that compares this robustness across encoder only, decoder only and encoder-decoder models. In this paper, we characterize changes between pretrained and finetuned language model representations across layers using two metrics: CKA and STIR. Further, we study the robustness of three language models (BERT, GPT-2 and T5) with eight different text perturbations on classification tasks from the General Language Understanding Evaluation (GLUE) benchmark, and generation tasks like summarization, free-form generation and question generation. GPT-2 representations are more robust than BERT and T5 across multiple types of input perturbation. Although models exhibit good robustness broadly, dropping nouns, verbs or changing characters are the most impactful. Overall, this study provides valuable insights into perturbation-specific weaknesses of popular Transformer-based models, which should be kept in mind when passing inputs. We make the code and models publicly available [https://github.com/PavanNeerudu/Robustness-of-Transformers-models].

研究动机与目标

  • 理解微调如何改变预训练模型与微调后模型在不同层之间的表征相似性。
  • 评估微调后的 BERT、GPT-2 和 T5 在分类与生成任务中对多样化文本扰动的鲁棒性。
  • 识别哪些类型的输入扰动最显著地降低模型性能,以及鲁棒性是否因模型架构或任务类型而异。
  • 确定是否存在某些层在不同模型中均表现出更高的脆弱性,从而揭示共享的不变性或语言敏感性。

提出的方法

  • 采用中心化核对齐(CKA)来度量预训练模型与微调后模型在各层之间的表征相似性。
  • 应用通过反向表示的相似性(STIR)来量化不同模型在扰动下的共享不变性。
  • 在八类不同的文本扰动下评估模型性能:同义词替换、词语删除、字符互换、句子重排等。
  • 通过 [CLS] token(BERT)、最后 token(GPT-2)和解码器输出(T5)的隐藏状态进行逐层分析,识别受影响最严重的层。
  • 在隐藏状态上训练逻辑回归模型以预测标签,并测量扰动下的性能下降。
  • 在 GLUE 基准任务(分类)和生成任务(摘要生成、问题生成、自由生成)之间比较鲁棒性。
(a) CoLA
(a) CoLA

实验结果

研究问题

  • RQ1微调在不同层上如何影响预训练模型与微调后模型之间的表征相似性?
  • RQ2哪些类型的文本扰动最显著地降低微调后 Transformer 模型的性能?
  • RQ3BERT、GPT-2 和 T5 的鲁棒性是否因自然语言处理任务类型(如分类与生成)或模型架构而异?
  • RQ4是否存在某些层在不同模型和任务中均表现出对扰动的一致敏感性?

主要发现

  • 微调后模型的最后几层比早期层受到的影响更大,表明深层的表征适应性更强。
  • 在多种扰动类型下,GPT-2 的鲁棒性优于 BERT 和 T5,尤其在生成任务中表现更优。
  • 删除名词或动词以及更改字符对模型性能的影响最为显著,无论模型或任务类型如何。
  • 某些层在不同模型和任务中均表现出一致的敏感性,表明对句法和语义等语言特征存在共享敏感性。
  • 涉及上下文改变的扰动(如句子重排)会影响多个层,表明上下文表征学习具有分布式特性。
  • T5 在扰动后,其解码器早期层的性能出现上升,表明解码器架构中的初始层可能对扰动不那么敏感或更具稳定性。
(b) SST-2
(b) SST-2

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。