This paper investigates a critical question for the future of LLM-based applications: If we find the "perfect" prompt to extract information from one model, will it work on another?
Prompts automatically optimized for one language model (LM) often fail when used on a different one. The authors demonstrate that "mixed-training"—using two different LMs during the prompt optimization process—creates robust, discrete prompts that generalize across models and behave more like natural language.
The Cross-Model Generalization Problem
The NLP world has heavily adopted a "prompting" paradigm where we interact with massive, often proprietary, models via text queries. However, prompt engineering is notoriously brittle. A prompt that elicits a correct answer from BERT might result in gibberish from RoBERTa or GPT-2.
This lack of cross-model generalization is a major hurdle. If a model provider updates their backend or if a developer wants to switch models, they shouldn't have to re-optimize their entire library of prompts. While "soft prompts" (continuous vectors) are popular, they are mathematically tied to a specific model's embedding space and cannot be transferred at all. This paper focuses on discrete prompts—actual strings of text—which are theoretically portable but, in practice, often overfit to the "quirks" of the model they were trained on.
Methods: From AutoPrompt to Mixed-Training
The researchers used the AutoPrompt algorithm as their baseline. AutoPrompt uses a gradient-guided search to find a sequence of tokens (often nonsensical to humans) that maximizes the probability of the model producing a specific target word (e.g., a "slot-filling" task like finding the birth city of a famous person).
To combat overfitting, the authors introduced a novel Mixed-Training approach:
- The Generator: One LM (e.g., BERT) proposes a set of candidate prompt tokens.
- The Evaluator: A second, different LM (e.g., T5) evaluates those candidates and selects the best ones.
By forcing the prompt to satisfy two different architectures during the induction phase, they "regularize" the prompt, preventing it from exploiting the specific sub-word tokenization artifacts or statistical biases of a single model.
Key Insights on Prompt Robustness
The researchers evaluated these prompts using the LAMA (Language Model Analysis) dataset, specifically the T-ReX split for factual slot-filling, and the more challenging LAMA-UHN subset. They uncovered several key properties of robust prompts:
- Single-Model Overfitting: Prompts induced on a single model are highly effective on that model but "brittle." They often rely on specific token positions or weird sub-word combinations that other models don't recognize.
- Generalization = Human-likeness: The most robust prompts (those from mixed-training) tended to have a higher "real-word ratio." They looked more like actual English words and less like "corpus detritus" (random numbers or typos).
- Bag-of-Tokens vs. Syntax: Brittle prompts are extremely sensitive to word order. Robust prompts are more like a "bag of tokens"; they still work relatively well even if you shuffle the words.
- Information Distribution: In single-model prompts, the "signal" is often concentrated in the very last token. Robust prompts distribute information more evenly across all tokens in the prompt, making them more resilient to deletions.
Key Results
- The Generalization Gap: A prompt optimized for a specific model often fails catastrophically on others. For instance, a prompt optimized for BERT_base achieves ~50% accuracy on BERT but drops to ~21% when tested on T5_large.
- Mixed-Training Success: The BERT_base / T5_large mix produced the best "universal" prompts. While this mixed prompt performed slightly worse on BERT than the BERT-only prompt (41% vs 50%), it performed significantly better across the entire suite of 15 different models, raising the average cross-model accuracy from ~26% to ~29.5%.
- Outperforming Manual Prompts: These automatically induced "universal" prompts consistently outperformed manually written prompts and semi-automatic methods (like LPAQA) when tested across different model families.
Limitations and Future Work
The study was limited to slot-filling (fact retrieval). It remains to be seen if these findings hold for more complex reasoning or generative tasks. Additionally, the "mixed-training" procedure is somewhat sensitive to the choice of the two models; not every combination leads to better generalization.
Future work could explore "multi-model" training (using more than two LMs) or developing auxiliary loss functions that explicitly reward "human-like" linguistic properties during prompt induction to further boost portability.
Summary updated