Reproduce “Dr.ICL: Demonstration-Retrieved In-context Learning” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

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

About this paper

Man Luo, Xin Xu, Zhuyun Dai, Panupong Pasupat, Mehran Kazemi, Chitta Baral, Vaiva Imbrasaite, Vincent Y Zhao

Dr.ICL introduces a method to improve in-context learning for Large Language Models by retrieving task-relevant demonstrations for prompts. This approach consistently yields performance gains over random demonstration selection, even with simple retrieval methods, and proves beneficial for instruction-tuned models as well as when combined with Chain-of-Thought prompting.

Key insights

  • Retrieving relevant demonstrations consistently improves in-context learning (ICL) performance over random selection across various tasks and models.
  • Even simple, off-the-shelf retrieval methods like BM25 provide notable performance enhancements for ICL.
  • The benefits of retrieval-based ICL extend to instruction-finetuned models, and task-specific retrievers can further enhance performance, particularly in one-shot settings.

Summary by alphaXiv.

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