Prompt tuning has emerged as a highly efficient way to adapt Large Language Models (LLMs) to specific tasks by optimizing a small set of learnable vectors (continuous prompts) instead of fine-tuning the entire model. However, a major limitation of this approach is that these learned prompts are typically "trapped" within the specific model they were trained on.
Researchers have developed a novel "zero-shot" method to transfer these continuous (soft) prompts between different language models without requiring any additional training or task-specific data on the target model. By mapping prompts into a shared "relative space," this method demonstrates that task-specific instructions can be generalized across models of different sizes and architectures, effectively allowing developers to "tune small and deploy large."
The Challenge of Prompt Transferability
Because different language models possess distinct embedding dimensions, vocabularies, and internal representations, a continuous prompt learned for a model like BERT cannot simply be plugged into RoBERTa. Previous attempts to bridge this architectural gap required training "neural projectors" (mapping functions) using parallel data or task supervision directly on the target model. This process is computationally expensive and defeats the primary purpose of prompt tuning: quick, portable adaptation.
The core question this research addresses is: Can we extract the "task semantics" from a prompt in one model and find its equivalent in another without starting from scratch?
The "Encode-Then-Search" Strategy
To solve this, the authors propose an innovative encode-then-search strategy that bypasses the need for direct vector translation.
- Encoding to Relative Space: Instead of relying on the absolute coordinates of a prompt vector, the method examines its relative position. The researchers select a set of "anchor tokens"—common words shared by the vocabularies of both the source and target models. The source prompt is then encoded as a vector of cosine similarities to these anchors, creating a model-agnostic representation of the task.
- Searching the Target Space: In the target model, a new prompt is randomly initialized. Using gradient descent, this target prompt is optimized so that its relative similarity to the target model's anchor tokens matches the source prompt's relative representation.
- Normalization: Because cosine similarity ignores vector magnitude, the searched target prompts are normalized to match the mean and standard deviation of the target model’s original word embeddings.
- Multi-Source Transfer: To make the transfer even more robust, the "task semantics" from multiple source models (e.g., BERT-base and RoBERTa-base) can be aggregated to find a superior prompt for the target model.
Key Insights and Universal Task Semantics
The most profound insight from this work is that "task semantics" in continuous prompts are not just random, model-specific noise. They represent structural information that remains consistent across different language models when viewed through the lens of relative positioning. Common tokens (like "the," "apple," or "run") serve as a Rosetta Stone—a shared coordinate system. Even if two models represent the word "apple" differently in their absolute vector space, the relationship between a "sentiment task prompt" and "apple" remains remarkably similar across models.
This unlocks a significant "Small-to-Large" Advantage. The method is particularly effective when transferring from smaller "base" models to "large" variants. Researchers can iterate quickly and cheaply on small models, and then zero-shot transfer those learned capabilities to massive, expensive models.
Experimental Results
The primary evaluation utilized LAMA (LAnguage Model Analysis), a factual probing dataset consisting of 41 different relations, alongside generalization tests on SST-2 (sentiment classification) and DBpedia (topic classification).
- Outperforming Baselines: The proposed relative-space method significantly outperformed "discretization" (converting prompts to the nearest real words) and "neural projectors" (which require costly training).
- Surpassing Manual Prompts: In many instances, the transferred continuous prompts performed better than the manually written text prompts provided in the LAMA dataset.
- Cross-Architecture Success: The method successfully transferred prompts from encoder-only models (BERT) to decoder-only models (GPT-2), although performance was naturally lower than within-family transfers (e.g., BERT to RoBERTa).
- Near-Native Accuracy: On the LAMA dataset, transferring a prompt from RoBERTa-base to RoBERTa-large achieved 40.91% accuracy. This nearly matches the 41.06% accuracy achieved by directly tuning the prompt on the large model itself—accomplished entirely without target-model training data.
Limitations and Future Directions
While highly effective, the approach has a few constraints. The quality of the transfer depends heavily on the source model; for instance, GPT-2 models proved to be poor sources for inducing prompts compared to BERT-style models. Additionally, the method relies on a shared vocabulary of anchor tokens. While most English LLMs share many common words, this could present a hurdle for models with vastly different tokenization schemes or when transferring across different languages.
Finally, while the method is "zero-shot" regarding task data, it still requires a brief optimization loop (the search phase) to find the target prompt, taking a few minutes of GPU time. Future work may explore bypassing language entirely, potentially using this relative-space method to transfer signals from direct human-model interactions or brain-to-text encoders directly into LLMs.
Summary updated