A Closer Look at How Fine-tuning Changes BERT
39302Authors
nan
Abstract
AbstractGiven the prevalence of pre-trained contextualized representations in today’s NLP, there have been many efforts to understand what information they contain, and why they seem to be universally successful. The most common approach to use these representations involves fine-tuning them for an end task. Yet, how fine-tuning changes the underlying embedding space is less studied. In this work, we study the English BERT family and use two probing techniques to analyze how fine-tuning changes the space. We hypothesize that fine-tuning affects classification performance by increasing the distances between examples associated with different labels. We confirm this hypothesis with carefully designed experiments on five different NLP tasks. Via these experiments, we also discover an exception to the prevailing wisdom that “fine-tuning always improves performance”. Finally, by comparing the representations before and after fine-tuning, we discover that fine-tuning does not introduce arbitrary changes to representations; instead, it adjusts the representations to downstream tasks while largely preserving the original spatial structure of the data points.
Keywords
Full Content
A Closer Look at How Fine-tuning Changes BERT Yichu Zhou School of Computing University of Utah flyaway@cs.utah.edu Vivek Srikumar School of Computing University of Utah svivek@cs.utah.edu Abstract Given the prevalence of pre-trained contextual- ized representations in today’s NLP, there have been many efforts to understand what infor- mation they contain, and why they seem to be universally successful. The most common ap- proach to use these representations involves fine-tuning them for an end task. Yet, how fine-tuning changes the underlying embedding space is less studied. In this work, we study the English BERT family and use two probing tech- niques to analyze how fine-tuning changes the space. We hypothesize that fine-tuning affects classification performance by increasing the distances between examples associated with different labels. We confirm this hypothesis with carefully designed experiments on five dif- ferent NLP tasks. Via these experiments, we also discover an exception to the prevailing wis- dom that “fine-tuning always improves perfor- mance”. Finally, by comparing the representa- tions before and after fine-tuning, we discover that fine-tuning does not introduce arbitrary changes to representations; instead, it adjusts the representations to downstream tasks while largely preserving the original spatial structure of the data points. 1 Introduction Pre-trained transformer-based language mod- els (e.g., Devlin et al., 2019) form the basis of state-of-the-art results across NLP. The relative opacity of these models has prompted the devel- opment of many probes to investigate linguistic regularities captured in them (e.g., Kovaleva et al., 2019; Conneau et al., 2018; Jawahar et al., 2019). Broadly speaking, there are two ways to use a pre-trained representation (Peters et al., 2019): as a fixed feature extractor (where the pre-trained weights are frozen), or by fine-tuning it for a task. The probing literature has largely focused on the former (e.g., Kassner and Schütze, 2020; Perone et al., 2018; Yaghoobzadeh et al., 2019; Krasnowska-Kiera´s and Wróblewska, 2019; Wal- lace et al., 2019; Pruksachatkun et al., 2020; Agha- janyan et al., 2021). Some previous work (Mer- chant et al., 2020; Mosbach et al., 2020b; Hao et al., 2020) does provide insights about fine-tuning: fine-tuning changes higher layers more than lower ones and linguistic information is not lost during fine-tuning. However, relatively less is understood about how the representation changes during the process of fine-tuning and why fine-tuning invari- ably seems to improve task performance. In this work, we investigate the process of fine- tuning of representations using the English BERT family (Devlin et al., 2019). Specifically, we ask: 1. Does fine-tuning always improve perfor- mance? 2. How does fine-tuning alter the representation to adjust for downstream tasks? 3. How does fine-tuning change the geometric structure of different layers? We apply two probing techniques—classifier- based probing (Kim et al., 2019; Tenney et al., 2019) and DIRECTPROBE (Zhou and Srikumar, 2021)—on variants of BERT representations that are fine-tuned on five tasks: part-of-speech tag- ging, dependency head prediction, preposition su- persense role & function prediction and text clas- sification. Beyond confirming previous findings about fine-tuning, our analysis reveals several new findings, …
Content truncated to 500 words
Labeled Text
AbstractGiven the prevalence of pre-trained contextualized representations in today’s NLP, there have been many efforts to understand what information they contain, and why they seem to be universally successful. The most common approach to use these representations involves fine-tuning them for an end task. Yet, how fine-tuning changes the underlying embedding space is less studied. In this work, we study the English BERT family and use two probing techniques to analyze how fine-tuning changes the space. We hypothesize that fine-tuning affects classification performance by increasing the distances between examples associated with different labels. We confirm this hypothesis with carefully designed experiments on five different NLP tasks. Via these experiments, we also discover an exception to the prevailing wisdom that “fine-tuning always improves performance”. Finally, by comparing the representations before and after fine-tuning, we discover that fine-tuning does not introduce arbitrary changes to representations; instead, it adjusts the representations to downstream tasks while largely preserving the original spatial structure of the data points.
Publication Details
- Paper ID:
- 39302
- Year:
- 2022
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan