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.
翻译:尽管大型语言模型(LLMs)展现出有前景的小样本学习能力,但标准上下文学习(ICL)范式仍存在两个主要缺陷:易受所选演示样本影响,以及生成这些演示样本的复杂性。本文提出一个根本性问题:人类生成的演示对于ICL是否必要?为解答此问题,我们提出自我反思提示策略(SEC),这是一种无需人工构建演示的范式。SEC的核心在于:不再使用人工设计的示例作为ICL中的演示,而是让LLMs自主生成演示,再基于这些演示产生最终输出。SEC是一个灵活框架,既适用于标准ICL也适用于思维链(CoT),且操作更简便——因为示例及其推理过程的人工生成环节均可省略。在算术推理、常识推理、多任务语言理解和代码生成基准测试中的大量实验表明:无需人工构建演示的SEC显著优于零样本学习策略,且能达到与使用人工演示的ICL相当的结果。这证明对于许多任务而言,当代LLMs已具备充分能力仅依赖自身决策能力,从而消除对外部训练数据的需求。代码已开源至https://github.com/ruili33/SEC。