Analyzing Pre-trained and Fine-tuned Language Models (2023)

Abstract: Since the introduction of transformer-based language models in 2018, the current generation of natural language processing (NLP) models continues to demonstrate impressive capabilities on a variety of academic benchmarks and real-world applications. This progress is based on a simple but general pipeline which consists of pre-training neural language models on large quantities of text, followed by an adaptation step that fine-tunes the pre-trained model to perform a specific NLP task of interest. However, despite the impressive progress on academic benchmarks and the widespread deployment of pre-trained and fine-tuned language models in industry we still lack a fundamental understanding of how and why pre-trained and fine-tuned language models work as well as the individual steps of the pipeline that produce them. We makes several contributions towards improving our understanding of pre-trained and fine-tuned language models, ranging from analyzing the linguistic knowledge of pre-trained language models and how it is affected by fine-tuning, to a rigorous analysis of the fine-tuning process itself and how the choice of adaptation technique affects the generalization of models and thereby provide new insights about previously unexplained phenomena and the capabilities of pre-trained and fine-tuned language models.

## introduction since the introduction of transformer-based pretrained neural language models in 2018 @xcite , the field of natural language processing (nlp) has witnessed a paradigm shift. instead of designing and training highly task-specific models from scratch, the current default approach for most nlp tasks consists of adapting general-purpose pre-trained language models, a process which typically requires only very few task-specific changes to the model architecture, and therefore allows us to easily apply the same pre-trained model to different tasks. over the last five years @xcite , this paradigm figure 1: our contributions positioned along the pretrain then adapt pipeline which is prevalent in modernday nlp. §3 is concerned with how fine-tuning affects the linguistic knowledge of a model, §4 focuses on a better understanding of the fine-tuning process, and §5 is concerned with the generalization of models adapted via fine-tuning and in-context learning during inference. at the core of this impressive progress lies a very simple but general pipeline which is illustrated in figure 1 together with our contributions. the first step of this pipeline, which we will refer to as the pre-train then adapt pipeline, consists of pre-training a (large) neural language model on large quantities of text using self-supervised training. due to the discrepancy between the pretraining objective (e.g., masked language modeling) and the downstream task (e.g., classification), the pre-training step is followed by an adaptation step which fine-tunes the pre-trained model to perform a specific task of interest. during fine-tuning, we either update all of the pre-trained parameters or update only a small fraction of them by leveraging parameter-efficient fine-tuning techniques. in both cases, however, fine-tuning results in a taskspecific model which can be used for a single task. an alternative task-adaptation technique which was popularized by the most recent advances in training pre-trained language models @xcite , allows us to bypass the fine-tuning step by treating the downstream task as a language modeling problem. this process, known as incontext learning, enables adapting a pre-trained model without updating any parameters and allows even non-expert users to easily leverage pre-trained language models. recent advancements in in-context learning have led to impressive progress on challenging reasoning benchmarks, surpassing the capabilities of finetuned language models by large margins @xcite , a development which has resulted in unprecedented interest from the general public in the promises and potential risks associated with the use of large language models. ## research objectives the previously described pipeline is ubiquitous in modern-day nlp and pre-trained and fine-tuned language models are now dominating research in academia as well as in industry. however, regardless of their impressive capabilities, pre-trained and fine-tuned language models are not without shortcomings. our contributions center around three major shortcomings of pre-trained and fine-tuned language models. each of the shortcomings concerns a specific component (or the interaction between two components) of the pre-train then align pipeline (see figure 1 ). ## the bigger picture adapting pre-trained language models via finetuning or in-context learning is an integral part of modern-day nlp. while from late 2018 to mid-2020, fine-tuning was the dominating strategy for task adaptation, i.e., converting a pre-trained (masked) language model into a classifier, the introduction of gpt-3 @xcite in 2020 and the demonstration of its in-context learning abilities resulted in an increasing interest in incontext learning as a new promising paradigm for task adaptation. recently however, driven by work on instruction fine-tuning @xcite and alignment to human preferences @xcite , fine-tuning foot_0 is again gaining significant interest from the nlp research community. given the ubiquity of language model adaptation in modern-day nlp and machine learning research, it is crucial to make progress towards a better understanding of the inner workings of commonly used adaptation techniques as well as their limitations. the work presented in this paper demonstrates how empirical research can help to achieve this goal and hopefully serves as an inspiration for future research that critically investigates the rapid progress made along the pre-train then adapt pipeline. ## summary our work makes several contributions towards improving our understanding of pre-trained and finetuned language models by carrying out a detailed analysis of various parts of the pre-train then adapt pipeline. our contributions range from analyzing the linguistic knowledge of pre-trained language models and how it is affected by fine-tuning, to a rigorous analysis of the fine-tuning process itself and how the choice of adaptation technique affects the generalization of models. we provide new insights about previously unexplained phenomena and the capabilities of pre-trained and fine-tuned language models and overall a better understanding of a crucial component of the modern nlp toolbox. beyond our empirical contributions, we hope that our work demonstrates the importance of taking a critical perspective on previous work and shows that despite the rapid progress in our field, there is a need for work that critically analyzes this progress.