Reproduce “RetICL: Sequential Retrieval of In-Context Examples with Reinforcement 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

Alexander Scarlatos, Andrew Lan

RetICL, developed by researchers at the University of Massachusetts Amherst, introduces a method for sequentially retrieving in-context examples for large language models, framing the selection as a Markov Decision Process trained with reinforcement learning. It achieved 66.11% accuracy on GSM8K and 76.13% on QASC, consistently outperforming competitive baselines while demonstrating robustness across varying data resource levels.

Key insights

  • Explicitly modeling sequential dependencies and the order of in-context examples through an RL framework can lead to improved LLM performance compared to methods treating examples independently.
  • The inclusion of a confidence reward, alongside a goal-based reward, provides a more nuanced training signal that helps guide the LLM towards more robust and well-reasoned solutions.
  • RetICL's latent space learns to group examples not only by topic but also by high-level features like solution length and reasoning patterns, indicating that the model implicitly captures effective problem-solving strategies.

Summary by alphaXiv.

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