Visualizing and Understanding the Effectiveness of BERT
By Yaru Hao, Li Dong, Furu Wei, Ke Xu. 2019
205 citations recorded by the source corpus.
Language model pre-training, such as BERT, has achieved remarkable results in many NLP tasks. However, it is unclear why the pre-training-then-fine-tuning paradigm can improve performance and generalization capability across different tasks. In this paper, we propose to visualize loss landscapes and optimization trajectories of fine-tuning BERT on specific datasets. First, we find that pre-training reaches a good initial point across downstream tasks, which leads to wider optima and easier optimization compared with training from scratch. We also demonstrate that the fine-tuning procedure is robust to overfitting, even though BERT is highly over-parameterized for downstream tasks. Second, the visualization results indicate that fine-tuning BERT tends to generalize better because of the flat and wide optima, and the consistency between the training loss surface and the generalization error surface. Third, the lower layers of BERT are more invariant during fine-tuning, which suggests that the layers that are close to input learn more transferable representations of language.
Subfields: Artificial Intelligence, Large Language Models, Safety, Robustness & Interpretability
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Mohit Bansal
- Yonatan Belinkov
- Luke S. Zettlemoyer
- Jianfeng Gao
- Yejin Choi
- Percy Liang
- Furu Wei
- Zhe Gan
In Large Language Models
In Safety, Robustness & Interpretability
- Yonatan Belinkov
- Yejin Choi
- Ivan Titov
- Ellie Pavlick
- Swabha Swayamdipta
- Sebastian Riedel
- Weizhu Chen
- Hassan Sajjad
Citations in the corpus
- Intrinsic Dimensionality Explains the Effectiveness of Language Model Fine-Tuning (2020, background): “ogy manifests in universally useful representations, although recent line of works have attempted to cover this gap by looking at loss landscapes, and the learned linguistic properties of pre-trained models (Hao et al., 2019; Clark et al., 2019a).”
- A Primer in BERTology: What We Know About How BERT Works (2020, background): “Figure 5: Pre-trained weights help BERT find wider optima in fine-tuning on MRPC (right) than training from scratch (left) (Hao et al., 2019)”
- A Comprehensive Survey of Continual Learning: Theory, Method and Application (2023, background): “, orthogonal, sparse and uniformly-scattered) representation [167], [281], [352], [380], and converging to a wider loss basin [151], [167], [281], [295], [313], suggesting a potential link among the sensitivity of representations, parameters and task-specific errors.”
- An Empirical Investigation of the Role of Pre-training in Lifelong Learning (2021, background): “Hao et al. (2019) show that for single-task generalization, pre-training leads to wider optima for BERT models.”
- On the Stability of Fine-tuning BERT: Misconceptions, Explanations, and Strong Baselines (2020, methodology): “To get further intuition about the fine-tunung failure, we provide loss surface visualizations (Li et al., 2018; Hao et al., 2019) of failed and successful runs when fine-tuning BERT.”
- Behind the Scene: Revealing the Secrets of Pre-trained Vision-and-Language Models (2020, background): “In [11], the authors proposed that the visualization of loss landscapes and optimization trajectories in BERT finetuning stage can help people understand the effectiveness of BERT.”
- When BERT Plays the Lottery, All Tickets Are Winning (2020, background): “However, what if that is not the case, and the success of pretraining is rather due to the flatter and wider optima in the optimization surface (Hao et al., 2019)?”
- BinaryBERT: Pushing the Limit of BERT Quantization (2020, methodology): “We also follow (Li et al., 2018; Hao et al., 2019) to visualize the optimization trajectory after splitting in Figures 6(c) and 6(d).”
- How Do Decisions Emerge across Layers in Neural Models? Interpretation with Differentiable Masking (2020, background): “For example, Tenney et al. (2019) and van Aken et al. (2019) considered probing BERT layers for a range of linguistic tasks, while Hao et al. (2019) analyzed the optimization surface.”
- G-DAug: Generative Data Augmentation for Commonsense Reasoning (2020, background): “Moreover, Hao et al. (2019) show that pretraining helps BERT to achieve flat and wide optima in the finetuning stage, which partially explains its performance benefits.”
- Contrastive Code Representation Learning (2020, unknown): “, 2018) by improving generalization (Erhan et al., 2010; Hao et al., 2019).”
- Are Pre-trained Language Models Aware of Phrases? Simple but Strong Baselines for Grammar Induction (2020, background): “In detail, one group of studies (Raganato & Tiedemann (2018); Clark et al. (2019); Ethayarajh (2019); Hao et al. (2019); Voita et al. (2019), inter alia) has focused on dissecting the intermediate representations and attention distributions of the pre-trained LMs, while the another group of…”
- Speech-XLNet: Unsupervised Acoustic Model Pretraining For Self-Attention Networks (2019, background): “This inspires us to visualize the local optima as defined in [24].”
- DeFormer: Decomposing Pre-trained Transformers for Faster Question Answering (2020, background): “…previous studies have demonstrated that lower layers tend to focus on local phenomena such as syntactic aspects, while the higher layers focus on global (long distance) phenomena such as semantic aspects relevant for the target task (Tenney et al., 2019; Hao et al., 2019; Clark et al., 2019b).”
- CoDA: Contrast-enhanced and Diversity-promoting Data Augmentation for Natural Language Understanding (2020, background): “, 2020) or require special finetuning techniques (Sun et al., 2019; Hao et al., 2019).”
- DeepNet: Scaling Transformers to 1,000 Layers (2022, methodology): “Following Hao et al. [30], we further visualize the loss landscape and trajectory of the optimization of vanilla Authorized licensed use limited to the terms of the applicable license agreement with IEEE.”
- On the Effectiveness of Adapter-based Tuning for Pretrained Language Model Adaptation (2021, unknown): “Following Hao et al. (2019), we plot the loss curve by linear interpolation between θ0 and θ1 with function f(α) = L(θ0 + α · (θ1 − θ0)), where θ0 and θ1 denote the model weights before and after tuning.”
- HiT: Hierarchical Transformer with Momentum Contrast for Video-Text Retrieval (2021, background): “According to the attention allocated characteristics of different layers in Transformer architectures, the features in different layers emphasize different views for samples [16, 42, 50, 30].”
- Similarity Analysis of Contextual Word Representation Models (2020, background): “It may be in-sightful to compare the results of our analysis to the loss surfaces of the same models, especially before and after fine-tuning (Hao et al., 2019).”