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. 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.
Introduction: The Demonstration Bottleneck
In-context learning (ICL) is a cornerstone of modern LLM usage, where providing a few examples (demonstrations) helps the model understand the task. However, a significant practical hurdle remains: where do these examples come from? Most research assumes access to a large demonstration pool, but in real-world scenarios, users often have only a single query. While zero-shot prompting exists, it typically lags behind few-shot performance. Self-ICL addresses this by asking: can a model generate its own demonstrations to improve its own performance?
The Self-ICL Framework
Self-ICL is a three-step "self-bootstrapping" process that utilizes the model's intrinsic knowledge to create its own context.
- Pseudo-Input Construction: The model is prompted to generate $k$ (e.g., 3) "new, diverse, and creative" instances of the task based on the test query.
- Pseudo-Label Construction: The model predicts labels for these generated inputs using zero-shot prompting, either through Direct Prompting or Chain-of-Thought (CoT) reasoning.
- Prediction: The model performs standard ICL, using its self-generated input-label pairs as demonstrations to answer the original test query.
Diversity is crucial here; by instructing the model to be "diverse and creative," Self-ICL avoids generating examples that are too similar to the test query, which can lead to negative "copying effects" if the labels are incorrect.
Evaluation and Datasets
The framework was evaluated on BIG-Bench Hard (BBH), a set of 23 challenging tasks where LLMs often struggle. The study spanned 5,511 instances across three major model families: InstructGPT (text-davinci-003), PaLM-2 (text-bison-001), and GPT-3.5-Turbo.
Key Results and Insights
Self-ICL consistently improves performance over zero-shot baselines. On the 23 BBH tasks, Self-ICL (Direct) outperformed standard zero-shot prompting on 18 tasks.
- Accuracy Gains: Average accuracy improved by 3.12% for direct prompting and 2.32% for CoT settings.
- Competitive with Few-Shot: Self-generated demonstrations often performed nearly as well as human-curated "3-shot" prompts.
- Intrinsic Knowledge Activation: The success of Self-ICL suggests that LLMs already possess the necessary task knowledge; self-generated demonstrations serve as a "warm-up" to activate the correct internal logic.
- Zero-Shot CoT Synergy: When combined with CoT, Self-ICL results are comparable to using real demonstrations, highlighting that the reasoning structure is often as important as the data source.
Limitations
While effective, Self-ICL has trade-offs:
- Computational Cost: It requires multiple inference passes, making it slower and more expensive than simple zero-shot queries.
- Instruction Following: The quality of demonstrations depends on the model's ability to follow the "diversity" instructions.
- Label Accuracy: Self-generated labels are not always correct, though the diversity constraint helps mitigate the impact of errors.
Conclusion
Self-ICL demonstrates that LLMs can effectively bootstrap their own performance by generating their own context. This framework bridges the gap between zero-shot and few-shot learning, providing a practical way to leverage ICL benefits in data-scarce environments.
Summary updated