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. 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.
翻译:摘要:大型语言模型(LLMs)展现出显著的上下文学习(ICL)能力,能够通过少量输入-输出示例适配目标任务。为提升ICL效果,研究者提出了多种方法从现有训练语料中选取代表性示例。然而,此类设置与现实应用场景存在差异——终端用户通常直接查询语言模型,而无法获取示例库。为此,我们提出Self-ICL——一种通过激发语言模型内在能力实现零样本ICL的简洁框架。对于给定测试输入,Self-ICL首先提示模型生成伪输入,随后通过零样本提示预测伪输入的伪标签,最终利用伪输入-标签对作为示例对测试输入执行ICL。在23项BIG-Bench Hard任务上的评估显示,Self-ICL在平均准确率和逐项比较中均超越零样本基线。结合零样本思维链时,Self-ICL甚至能达到与使用真实示例相当的效果。此外,我们通过系列分析验证了Self-ICL的有效性,并揭示了其在不同设置下的行为规律。