Reproduce “Demonstrations, CoT, and Prompting: A Theoretical Analysis of ICL” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Xuhan Tong, Yuchen Zeng, Jiawei Zhang

This research provides a theoretical analysis of In-Context Learning (ICL) in large language models, connecting practical prompting strategies such as demonstration quality and Chain-of-Thought to generalization bounds under mild assumptions. It quantifies how the effectiveness of demonstrations, the nature of task decomposition, and prompt template consistency influence ICL performance and sensitivity, corroborating insights with synthetic experiments.

Key insights

  • ICL generalization is bounded by three factors: the quality of demonstrations (quantified by an effective Lipschitz constant), the intrinsic ICL capability of the pretrained model, and the distribution shift to the test prompt.
  • CoT benefits ICL when it decomposes complex tasks into subproblems that are both well-learned by the model and stably identified by demonstrations (i.e., have low Lipschitz constants for subtasks).
  • Prompt template sensitivity generally decays exponentially with an increasing number of demonstrations when instructions are consistent, but persists and may even increase when instructions are inconsistent or conflicting across demonstrations.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.