Abstract
Adapting large-scale pre-trained language models (PLMs) to downstream tasks is increasingly performed via Model-as-a-Service (MaaS) APIs, where internal weights are inaccessible. However, standard prompt-based adaptation is highly sensitive to the specific wording of templates, leading to significant performance instability, particularly in few-shot scenarios. This paper introduces the Multi-Prompting Decoder (MPD), a framework that queries a model with multiple prompts simultaneously and employs Optimal Transport (OT) to synthesize diverse representations. MPD achieves state-of-the-art performance and improved stability across nine benchmarks while maintaining a lightweight footprint of only 132K trainable parameters.
Introduction
In the era of Model-as-a-Service (MaaS), users typically interact with large PLMs (e.g., GPT-4, RoBERTa) through APIs that provide output-side information, such as hidden states or class scores, rather than direct gradient access. The prevailing method for task adaptation is prompt engineering. However, relying on a single prompt is inherently risky; slight variations in template wording can cause accuracy to fluctuate by over 8%, as shown in Figure 1. This sensitivity makes it difficult to achieve reliable performance in few-shot learning where training data is scarce.
Methodology
The Multi-Prompting Decoder (MPD) moves away from the "single prompt" paradigm by leveraging redundancy for robustness. The framework consists of three primary components: multi-prompt querying, Optimal Transport decoding, and calibrated class scoring.
1. Multi-Prompt Querying
Instead of a single template, MPD wraps the input $x$ in $P$ different templates (e.g., $T_1(x), T_2(x), ..., T_P(x)$). These are passed through a frozen PLM to generate a set of distinct hidden state representations. This approach extracts richer knowledge from the model by viewing the input through multiple semantic lenses.
2. Optimal Transport (OT) Decoding
To aggregate the multiple representations, the authors utilize Optimal Transport. OT provides a mathematical framework to find the most efficient matching between the set of text representations and the prototypes of each class. This "OT Score" serves as a sophisticated aggregation mechanism that filters noise from individual prompts.
3. Calibrated Class Scoring and Label Expansion
PLMs often exhibit biases toward words frequent in their pre-training data. MPD mitigates this by calculating bias using a "null" input and subtracting it from the results. Furthermore, the system expands label words (e.g., expanding "technology" to include "software" and "computer") to capture broader semantic nuances. As illustrated in Figure 2, the final prediction is a weighted combination of these calibrated class scores and the OT scores.
Experimental Evaluation
The researchers evaluated MPD across nine diverse natural language understanding (NLU) benchmarks, including sentiment analysis (SST2, IMDB, Yelp), topic classification (AG’s News, Yahoo, DBPedia), and natural language inference (RTE, SNLI, MNLI). Experiments focused on few-shot settings with 1, 4, and 16 training samples per class.
Key Results and Discussion
- Performance and Stability: MPD outperformed existing MaaS adaptation methods (such as DecT and PromptBoosting) in 27 out of 30 experimental settings. It provided an average accuracy boost of 1.5% to 3.4% while significantly reducing the standard deviation of results, indicating much higher stability across different prompt sets.
- Efficiency: The trainable component of MPD is remarkably small, comprising only 132K parameters (approximately 0.04% of a RoBERTa-Large model). Because it requires only one query per template, it is 50x to 400x faster to train than reinforcement learning-based prompt search methods.
- Scalability: MPD remains competitive even as the number of training samples increases, occasionally outperforming full model fine-tuning despite using a fraction of the computational resources.
Conclusion and Future Work
MPD offers a robust and efficient solution for adapting black-box PLMs to specific tasks. By treating multiple prompts as a distribution to be matched via Optimal Transport, it overcomes the fragility of single-prompt methods. While the current implementation requires access to hidden states and focuses on English datasets, future work may explore automated template generation and multi-lingual applications to further generalize the framework.
Summary updated