Self-ICL: Zero-Shot In-Context Learning with Self-Generated Demonstrations

Wei-Lin Chen, Cheng-Kuang Wu, Yun-Nung Chen, Hsin-Hsi Chen
5/24/2023
60 citations
cs.CL

Official code: ntunlplab/Self-ICL (6 stars, Python, last commit 2023-12-03).

Abstract

Large language models (LLMs) have exhibited striking in-context learning (ICL) ability to adapt to target tasks with a few input-output demonstrations. For better ICL, different methods are proposed to select representative demonstrations from existing training corpora.

Show full abstract

However, such settings are not aligned with real-world practices, as end-users usually query LMs without access to demonstration pools. In this work, we introduce Self-ICL -- a simple framework which bootstraps LMs' intrinsic capabilities to perform zero-shot ICL. Given a test input, Self-ICL first prompts the model to generate pseudo-inputs. Next, the model predicts pseudo-labels for the pseudo-inputs via zero-shot prompting. Finally, we perform ICL for the test input with the pseudo-input-label pairs as demonstrations. Evaluation on 23 BIG-Bench Hard tasks shows Self-ICL outperforms zero-shot baselines on both average accuracy and head-to-head comparison. Moreover, with zero-shot chain-of-thought, Self-ICL achieves results comparable to using real demonstrations. Additionally, we conduct a range of analyses to validate Self-ICL's effectiveness and provide insights for its behaviors under different settings.

View on arXivView PDF

Code Implementations(1)

ntunlplab/Self-ICLOfficial100%
62PythonOct 15, 20232 years ago

Similar Papers

Cite this paper

@article{chen2023selficl,
  title  = {Self-ICL: Zero-Shot In-Context Learning with Self-Generated Demonstrations},
  author = {Wei-Lin Chen and Cheng-Kuang Wu and Yun-Nung Chen and Hsin-Hsi Chen},
  year   = {2023},
  eprint = {2305.15035},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.15035v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.15035.svg)](https://codeofpaper.com/paper/2305.15035)

Discussion