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

12/13/2022
by   Yaru Hao, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/05/2023

Scaling In-Context Demonstrations with Structured Attention

The recent surge of large language models (LLMs) highlights their abilit...
research
11/08/2022

Active Example Selection for In-Context Learning

With a handful of demonstration examples, large-scale language models sh...
research
05/23/2023

Label Words are Anchors: An Information Flow Perspective for Understanding In-Context Learning

In-context learning (ICL) emerges as a promising capability of large lan...
research
10/07/2022

Few-Shot Anaphora Resolution in Scientific Protocols via Mixtures of In-Context Experts

Anaphora resolution is an important task for information extraction acro...
research
04/15/2023

Constructing Effective In-Context Demonstration for Code Intelligence Tasks: An Empirical Study

Pre-trained models of code have gained widespread popularity in many cod...
research
05/20/2022

Prototypical Calibration for Few-shot Learning of Language Models

In-context learning of GPT-like models has been recognized as fragile ac...
research
02/14/2023

ScatterShot: Interactive In-context Example Curation for Text Transformation

The in-context learning capabilities of LLMs like GPT-3 allow annotators...

Please sign up or login with your details

Forgot password? Click here to reset