It has been demonstrated that prompt tuning is highly effective in efficiently eliciting knowledge from language models (LMs). However, the prompt tuning still lags behind fine-tuning, especially when the LMs are small. P-tuning v2 (Liu et al., 2021b) makes it comparable with finetuning by adding continuous prompts for every layer of the pre-trained model. However, prepending fixed soft prompts for all instances, regardless of their discrepancy, is doubtful. In particular, the inserted prompt position, length, and the representations of prompts for diversified instances through different tasks could all affect the prompt tuning performance. To fill this gap, we propose dynamic prompting (DP): the position, length, and prompt representation can all be dynamically optimized with respect to different tasks and instances. We conduct comprehensive experiments on the SuperGlue benchmark to validate our hypothesis and demonstrate substantial improvements. We also derive a unified framework for supporting our dynamic prompting strategy. In particular, we use a simple learning network and Gumble- Softmax for learning instance-dependent guidance. Experimental results show that simple instance-level position-aware soft prompts can improve the classification accuracy of up to 6 points on average on five datasets, reducing its gap with fine-tuning. Besides, we also prove its universal usefulness under full-data, few-shot, and multitask regimes. Combining them together can even further unleash the power of DP, narrowing the distance between finetuning.
翻译:研究表明,提示调优在高效挖掘语言模型知识方面极为有效。然而,当语言模型规模较小时,提示调优仍落后于微调。P-tuning v2通过为预训练模型的每一层添加连续提示,使其性能可与微调相媲美。但为所有实例预置固定软提示而忽略其差异性,这种做法存疑。具体而言,插入提示的位置、长度以及针对不同任务中多样化实例的提示表征,均可能影响提示调优性能。为填补这一空白,我们提出动态提示:提示的位置、长度和表征均可针对不同任务和实例进行动态优化。我们在SuperGlue基准上开展全面实验以验证假设,并展现出显著改进。我们还推导出一个统一框架以支持动态提示策略。特别地,我们采用简单学习网络与Gumble-Softmax函数学习实例级依赖引导。实验结果表明,简单的实例级位置感知软提示在五个数据集上平均可提升高达6个百分点的分类准确率,缩小了与微调的差距。此外,我们还证明了该方法在全数据、小样本和多任务场景下的通用有效性。综合运用这些策略更能进一步释放动态提示的潜力,进一步缩短与微调之间的差距。