Recent Pre-trained Language Models (PLMs) usually only provide users with the inference APIs, namely the emerging Model-as-a-Service (MaaS) setting. To adapt MaaS PLMs to downstream tasks without accessing their parameters and gradients, some existing methods focus on the output-side adaptation of PLMs, viewing the PLM as an encoder and then optimizing a task-specific decoder for decoding the output hidden states and class scores of the PLM. Despite the effectiveness of these methods, they only use a single prompt to query PLMs for decoding, leading to a heavy reliance on the quality of the adopted prompt. In this paper, we propose a simple yet effective Multi-Prompting Decoder (MPD) framework for MaaS adaptation. The core idea is to query PLMs with multiple different prompts for each sample, thereby obtaining multiple output hidden states and class scores for subsequent decoding. Such multi-prompting decoding paradigm can simultaneously mitigate reliance on the quality of a single prompt, alleviate the issue of data scarcity under the few-shot setting, and provide richer knowledge extracted from PLMs. Specifically, we propose two decoding strategies: multi-prompting decoding with optimal transport for hidden states and calibrated decoding for class scores. Extensive experiments demonstrate that our method achieves new state-of-the-art results on multiple natural language understanding datasets under the few-shot setting.
翻译:近年来,预训练语言模型(PLMs)通常仅向用户提供推理API接口,即新兴的"模型即服务"(MaaS)范式。为使MaaS PLMs能够适应下游任务而无需访问其参数与梯度,现有方法主要聚焦于PLMs的输出端适配,将PLM视作编码器,进而优化任务特定的解码器以解析PLM输出的隐藏状态与类别分数。尽管这些方法具有良好效果,但它们仅使用单一提示词查询PLM进行解码,导致模型性能高度依赖所采用提示词的质量。本文提出一种简洁而有效的多提示解码器(MPD)框架用于MaaS适配。其核心思想是:针对每个样本使用多个不同提示词查询PLM,从而获取多组输出隐藏状态与类别分数供后续解码使用。这种多提示解码范式能够同时缓解对单一提示词质量的依赖、改善少样本场景下的数据稀缺问题,并提供从PLM中提取的更丰富知识。具体而言,我们提出两种解码策略:基于最优传输的隐藏状态多提示解码,以及针对类别分数的校准解码策略。大量实验表明,在少样本设置下,我们的方法在多个自然语言理解数据集上取得了新的最先进性能。