Despite the massive empirical success of models like BERT and GPT, we have very little theoretical understanding of why they work so well on downstream tasks. Why does a model trained simply to predict missing words become highly proficient at unrelated tasks like sentiment analysis or question answering?
The challenge lies in the "black box" nature of these models and the apparent disconnect between the pretraining objective and downstream labels. This paper seeks to bridge that gap by providing a formal mathematical link between the two, focusing on two popular, computationally efficient adaptation methods:
- Head Tuning: Training a small classifier on top of a frozen, pretrained model.
- Prompt Tuning: Prepending a learnable "prompt" vector to the input while keeping the rest of the model frozen.
A Latent Variable Framework
The authors propose an analysis framework based on Latent Variable Generative Models. They assume that text is generated by underlying hidden states (representing the "meaning" or "context"), and the downstream task is simply a function of these hidden states. Thus, pretraining isn't just about learning word patterns; it's about learning to approximate the posterior distribution of the latent variables that generated the text.
The Hidden Markov Model (HMM) and Prompt Tuning
The researchers first analyze a standard Hidden Markov Model (HMM). They prove that if the model is "non-degenerate"—meaning different hidden states produce distinct word distributions—a simple linear head can recover the downstream labels.
However, natural language is often complex and "degenerate" (e.g., having more hidden states than unique words in a local vocabulary). Here, the authors show that prompt tuning is mathematically equivalent to "conditioning" the latent variables.
By prepending a prompt, the model is essentially instructed to only look at the hidden states relevant to a specific task. This acts as a mathematical filter, allowing the model to ignore task-irrelevant noise and succeed even when the data is degenerate. This theoretical relaxation explains why prompt tuning often matches full fine-tuning with much less computation and requires weaker non-degeneracy assumptions than head tuning.
Memory-Augmented HMMs
To better mimic the long-term dependencies of natural language, the authors introduce a model with a persistent "memory" variable (representing semantics) and a changing "syntax" variable.
In this memory-augmented HMM, the authors demonstrate how attention mechanisms help the model focus on the persistent semantic memory while ignoring transient syntactic noise. An attention head is theoretically optimal for "picking out" this long-term semantic information.
Experimental Validation
To validate these theoretical claims, the paper relies on synthetically generated data from HMMs rather than standard benchmarks like GLUE. Using synthetic data allows the researchers to have "ground truth" access to the latent variables. They can precisely control the complexity of the data to test exactly where head tuning fails and prompt tuning succeeds.
When pretraining a BERT-like model on these synthetic sequences, the results strongly backed the theory:
- Prompt Tuning vs. Head Tuning: In simulated degenerate problems, prompt tuning maintained high accuracy (near 90-100%), while head tuning performance dropped significantly as complexity increased.
- Memory Recovery: For data generated with long-term dependencies, an attention-based head achieved nearly 100% downstream accuracy, confirming the model successfully learned to separate semantics from syntax.
Limitations and Future Work
While this framework provides a crucial step toward understanding PLMs, HMMs are much simpler than the actual distribution of natural language. Moving toward more complex generative models, like those involving context-free grammars, is a necessary next step. Furthermore, this analysis focuses on frozen pretrained models. Analyzing full fine-tuning—where the internal weights of the transformer change—remains a significant theoretical challenge that requires characterizing the high-dimensional weight dynamics of the model.
Summary updated