Skip to main content
QUICK REVIEW

[Paper Review] Self-Generated In-Context Learning: Leveraging Auto-regressive Language Models as a Demonstration Generator

Hyuhng Joon Kim, Hyunsoo Cho|arXiv (Cornell University)|Jun 16, 2022
Topic ModelingComputer Science9 citations
TL;DR

This paper proposes Self-Generated In-Context Learning (SG-ICL), a method that uses autoregressive language models to generate high-quality, input-conditioned demonstrations for in-context learning without relying on external training data. SG-ICL significantly outperforms zero-shot learning and is empirically equivalent to using approximately 0.6 gold training samples per example, while demonstrating lower performance variance than randomly selected demonstrations.

ABSTRACT

Large-scale pre-trained language models (PLMs) are well-known for being capable of solving a task simply by conditioning a few input-label pairs dubbed demonstrations on a prompt without being explicitly tuned for the desired downstream task. Such a process (i.e., in-context learning), however, naturally leads to high reliance on the demonstrations which are usually selected from external datasets. In this paper, we propose self-generated in-context learning (SG-ICL), which generates demonstrations for in-context learning from PLM itself to minimize the reliance on the external demonstration. We conduct experiments on four different text classification tasks and show SG-ICL significantly outperforms zero-shot learning and is generally worth approximately 0.6 gold training samples. Moreover, our generated demonstrations show more consistent performance with low variance compared to randomly selected demonstrations from the training dataset.

Motivation & Objective

  • To reduce dependency on external training data for in-context learning by generating demonstrations internally.
  • To investigate whether autoregressive language models can generate high-correlation, task-relevant demonstrations for improved few-shot performance.
  • To evaluate the stability and effectiveness of self-generated demonstrations compared to randomly selected real demonstrations.
  • To quantify the performance equivalence of self-generated in-context samples relative to real training samples.

Proposed method

  • SG-ICL uses a two-step process: self-generation and inference, where demonstrations are generated using a prompt template conditioning on both the input and class label.
  • In the self-generation step, a pre-trained language model generates input-conditioned demonstrations for each class using a manually designed prompt template.
  • The generated demonstrations are then reused in the inference phase for in-context learning, eliminating the need for external training data.
  • The method leverages the generative capability of large language models to produce semantically correlated, task-specific examples that improve downstream performance.
  • Performance is evaluated using standard NLU benchmarks, with cosine similarity used to measure correlation between input and generated demonstrations.
  • The approach is evaluated across four text classification tasks: sentiment classification (SST-2, SST-5) and natural language inference (MNLI, RTE).

Experimental results

Research questions

  • RQ1Can in-context learning be performed without relying on external training data by generating demonstrations internally?
  • RQ2How does conditioning the generation process on the input instance affect the quality and correlation of generated demonstrations?
  • RQ3How does the performance of self-generated demonstrations compare to that of randomly selected real demonstrations from the training set?
  • RQ4How many real training samples is one self-generated in-context sample worth in terms of performance gain?

Key findings

  • SG-ICL significantly outperforms zero-shot learning across all four evaluated text classification tasks.
  • SG-ICL demonstrates low variance in performance, outperforming randomly selected real demonstrations in stability.
  • Conditioning generation on both the input and class leads to generated demonstrations with 3–4× higher cosine similarity to the input than class-only conditioning.
  • One self-generated in-context sample is empirically equivalent to approximately 0.6 gold training samples in performance gain.
  • SG-ICL with 8 self-generated samples outperforms few-shot learning with up to 5 real training samples on both SST-2 and SST-5.
  • The method achieves consistent performance improvements without accessing any training data during inference.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.