arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2212.06713cs.CL
收藏

Structured Prompting:将上下文学习扩展到1,000个示例

Structured Prompting: Scaling In-Context Learning to 1,000 Examples

Microsoft Research(微软研究院)

Yaru Hao, Yutao Sun, Li Dong, Zhixiong Han, Yuxian Gu, Furu Wei

摘要:

大语言模型已经展示出了有趣的上下文学习能力,在不更新参数的情况下实现了有希望的零和Few-Shot性能。然而,传统的上下文学习通常受到长度约束的限制,使得它不能有效地从大量的例子中吸收监督。为了超越几个镜头,我们引入了结构化提示,打破了长度限制,并将上下文学习扩展到数千个例子。具体来说,演示示例分别编码精心设计的位置嵌入,然后他们共同参加了测试示例使用重新缩放的注意力机制。因此,我们可以用线性复杂度而不是相对于长度的二次复杂度来缩放样本的数量。不同任务集的实验结果表明,我们的方法提高了最终任务的性能,并减少了传统的上下文学习的演示示例的数量增加的评价方差。代码已在https://aka.ms/structured-prompting上发布。

英文摘要:

Large language models have exhibited intriguing in-context learning capability, achieving promising zero- and few-shot performance without updating the parameters. However, conventional in-context learning is usually restricted by length constraints, rendering it ineffective to absorb supervision from a large number of examples. In order to go beyond few shots, we introduce structured prompting that breaks the length limit and scales in-context learning to thousands of examples. Specifically, demonstration examples are separately encoded with well-designed position embeddings, and then they are jointly attended by the test example using a rescaled attention mechanism. So we can scale the number of exemplars with linear complexity instead of quadratic complexity with respect to length. Experimental results on a diverse set of tasks show that our approach improves end-task performance and reduces evaluation variance over conventional in-context learning as the number of demonstration examples increases. Code has been released at https://aka.ms/structured-prompting.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑