Are Human-generated Demonstrations Necessary for In-context Learning?

Rui Li, Guoyin Wang, Jiwei Li
2/12/2026

No official code found. Best implementation: ruili33/SEC (12 stars, last commit 2024-01-21).

Abstract

Despite the promising few-shot ability of large language models (LLMs), the standard paradigm of In-context Learning (ICL) suffers the disadvantages of susceptibility to selected demonstrations and the intricacy to generate these demonstrations. In this paper, we raise the fundamental question that whether human-generated demonstrations are necessary for ICL. To answer this question, we propose self-contemplation prompting strategy (SEC), a paradigm free from human-crafted demonstrations. The key point of SEC is that, instead of using hand-crafted examples as demonstrations in ICL, SEC asks LLMs to first create demonstrations on their own, based on which the final output is generated. SEC is a flexible framework and can be adapted to both the vanilla ICL and the chain-of-thought (CoT), but with greater ease: as the manual-generation process of both examples and rationale can be saved. Extensive experiments in arithmetic reasoning, commonsense reasoning, multi-task language understanding, and code generation benchmarks, show that SEC, which does not require hand-crafted demonstrations, significantly outperforms the zero-shot learning strategy, and achieves comparable results to ICL with hand-crafted demonstrations. This demonstrates that, for many tasks, contemporary LLMs possess a sufficient level of competence to exclusively depend on their own capacity for decision making, removing the need for external training data. Code is available at https://github.com/ruili33/SEC.

View on arXivView PDF

Code Implementations(1)

ruili33/SECCommunity57%

Source code for paper Are Human-generated Demonstrations Necessary for In-context Learning

120PythonSep 24, 20232 years ago

Similar Papers

Cite this paper

@article{li2026humangenerated,
  title  = {Are Human-generated Demonstrations Necessary for In-context Learning?},
  author = {Rui Li and Guoyin Wang and Jiwei Li},
  year   = {2026},
  eprint = {2309.14681},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2309.14681},
  journal = {ICLR 2023 2023}
}

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/2309.14681.svg)](https://codeofpaper.com/paper/2309.14681)

Discussion