Fine-tuning large language models is becoming ever more impractical due to their rapidly-growing scale. This motivates the use of parameter-efficient adaptation methods such as prompt tuning (PT), which adds a small number of tunable embeddings to an otherwise frozen model, and in-context learning (ICL), in which demonstrations of the task are provided to the model in natural language without any additional training. Recently, Singhal et al. (2022) propose ``instruction prompt tuning'' (IPT), which combines PT with ICL by concatenating a natural language demonstration with learned prompt embeddings. While all of these methods have proven effective on different tasks, how they interact with each other remains unexplored. In this paper, we empirically study when and how in-context examples improve prompt tuning by measuring the effectiveness of ICL, PT, and IPT on five text generation tasks with multiple base language models. We observe that (1) IPT does \emph{not} always outperform PT, and in fact requires the in-context demonstration to be semantically similar to the test input to yield improvements; (2) PT is unstable and exhibits high variance, but combining PT and ICL (into IPT) consistently reduces variance across all five tasks; and (3) prompts learned for a specific source task via PT exhibit positive transfer when paired with in-context examples of a different target task. Our results offer actionable insights on choosing a suitable parameter-efficient adaptation method for a given task.
翻译:微调大型语言模型因其规模快速增长而变得愈发不切实际,这促使人们采用参数高效的适配方法,如提示调优(PT)和上下文学习(ICL)。提示调优在冻结的模型中添加少量可调嵌入,而上下文学习则通过自然语言向模型提供任务示例,无需额外训练。最近,Singhal等人(2022)提出了“指令提示调优”(IPT),该方法通过将自然语言示例与学习到的提示嵌入串联,结合了PT和ICL。尽管这些方法在不同任务上已被证明有效,但它们之间的相互作用仍未被探索。本文通过衡量ICL、PT和IPT在多个基础语言模型上的五个文本生成任务中的有效性,实证研究了上下文示例何时以及如何改进提示调优。我们观察到:(1)IPT并非总是优于PT,实际上,它要求上下文示例在语义上与测试输入相似才能带来改进;(2)PT不稳定且方差较高,但将PT与ICL结合(形成IPT)能一致地降低所有五个任务的方差;(3)通过PT为特定源任务学习的提示,在搭配不同目标任务的上下文示例时,展现出正向迁移。我们的结果为针对给定任务选择合适的参数高效适配方法提供了可行见解。