TL;DR
Discrete text prompts automatically optimized to extract information from one language model often fail completely when transferred to another. By introducing a "mixed-training" approach—where one language model proposes prompt candidates and a different model evaluates them—the authors successfully generate robust, "universal" prompts that generalize out-of-the-box across diverse model architectures.
What Problem Does This Paper Address?
Prompting has become the dominant paradigm for adapting large pre-trained language models (LMs) to downstream tasks without modifying their underlying weights. To avoid tedious manual engineering, researchers use optimization algorithms like AutoPrompt to automatically discover discrete text strings that effectively trigger the desired model responses.
However, these automatically induced prompts are usually highly specialized to the specific LM they were trained on. If an API provider updates their backend model, or if an application needs to query multiple different LMs simultaneously, these optimized prompts frequently break. While continuous ("soft") prompts fail to generalize entirely because different models use completely different embedding spaces, discrete text prompts should theoretically be transferable. This paper systematically investigates why they fail to generalize and how to fix it.
Methods
The authors evaluate standard prompting techniques—manual prompts, semi-manual mining (LPAQA), continuous tuning (OptiPrompt), and discrete optimization (AutoPrompt)—to establish a baseline for cross-model transferability.
To overcome the generalization gap of standard AutoPrompt, they introduce Mixed-Training AutoPrompt. Standard AutoPrompt uses a single LM to both propose token candidates (via gradient-guided search) and evaluate them on a training batch. The mixed-training variant splits these duties across two different models:
- Generator LM: Proposes a set of candidate tokens based on its internal gradients.
- Evaluator LM: Evaluates and selects the best-performing candidates on a validation batch.
This simple modification prevents the resulting prompt from overfitting to the idiosyncratic quirks of a single model's architecture.
Datasets
The study evaluates these methods using the T-ReX split of the LAMA benchmark, a popular dataset for probing factual knowledge stored in LMs. It contains factual triples (e.g., <Dante, place of birth, Florence>) spanning 41 distinct relations.
To ensure a fair evaluation across 15 different language models (including BERT, RoBERTa, GPT-2, BART, and T5 variants), the authors filter the dataset to a common vocabulary intersection of 11,511 case-sensitive tokens. They also validate their findings on the more challenging LAMA-UHN (UnHelpfulNames) subset, which filters out easy-to-guess facts based purely on surface-level entity names.
Key Insights and Ideas
- Single-Model Overfitting: Prompts optimized on a single LM exploit that specific model's tokenization quirks and statistical co-occurrences. This results in prompts that look like uninterpretable gibberish and fail on other architectures.
- The Power of Real Words: Quantitative analysis reveals that robust, generalizing prompts contain a significantly higher proportion of actual, well-formed English words rather than weird sub-word fragments or concatenations.
- Information Distribution: Model-specific prompts tend to pack all their predictive power into a single slot (often the very last token). In contrast, generalized prompts distribute information more evenly across all tokens, making them highly robust to single-token deletion.
- Order Independence: Generalizing prompts act more like a "bag-of-tokens." They are less order-dependent and maintain higher relative accuracy when shuffled compared to brittle, single-model prompts.
Key Results
- The Generalization Gap: As shown in the transfer heatmap, prompts optimized and tested on different models suffer a massive performance drop, especially when crossing model families (e.g., transferring a prompt from a Masked LM like BERT to a Left-to-Right LM like GPT-2).
- Mixed-Training Success: The combination of BERT-base (as Generator) and T5-large (as Evaluator) achieved the highest average generalization accuracy (29.48%) across all 15 target models. Remarkably, this mixed prompt even outperformed T5-large's own natively trained prompts when evaluated on sequence-to-sequence models.
- Soft Prompts Fail to Transfer: While continuous prompts (OptiPrompt) perform best when trained and tested on the exact same model (43.39% average), they completely fail to generalize across models—even when transferring between models that share the exact same embedding dimensions.
Limitations and Future Work
- Single Task Focus: The evaluation is strictly limited to slot-filling (factual knowledge retrieval) on a single dataset. The authors note that future work must explore whether these insights hold true for more complex tasks like reasoning or open-ended generation.
- Static Templates: AutoPrompt creates one fixed prompt template per relation rather than dynamically adapting the prompt to individual, unique inputs.
- Brittleness of Mixing: Simply mixing any two models does not guarantee success. The choice of which models to pair as generator and evaluator is crucial and currently requires empirical trial and error.
Summary updated