RetICL: Sequential Retrieval of In-Context Examples with Reinforcement Learning
Not on the map. Why?
Abstract (arXiv)
Recent developments in large pre-trained language models have enabled unprecedented performance on a variety of downstream tasks. Achieving best performance with these models often leverages in-context learning, where a model performs a (possibly new) task given one or more examples. However, recent work has shown that the choice of examples can have a large impact on task performance and that finding an optimal set of examples is non-trivial. While there are many existing methods for selecting in-context examples, they generally score examples independently, ignoring the dependency between them and the order in which they are provided to the model. In this work, we propose Retrieval for In-Context Learning (RetICL), a learnable method for modeling and optimally selecting examples sequentially for in-context learning. We frame the problem of sequential example selection as a Markov decision process and train an example retriever using reinforcement learning. We evaluate RetICL on math word problem solving and scientific question answering tasks and show that it consistently outperforms or matches heuristic and learnable baselines. We also use case studies to show that RetICL implicitly learns representations of problem solving strategies.
Key facts. Cited by 24 papers in the map (data through 14 Oct 2026). Builds on 33 of its 41 references that are in the map. First posted on arXiv 23 May 2023.
Builds on
33 of 41 references.
References · 33
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2017Proximal Policy Optimization Algorithmscited by 15,215
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2020Measuring Massive Multitask Language Understandingcited by 7,963
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
- 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,371
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
- 2017Billion-scale similarity search with GPUscited by 2,497
- 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,234
21 more
- 2019Fine-Tuning Language Models from Human Preferencescited by 2,150
- 2015High-Dimensional Continuous Control Using Generalized Advantage Estimationcited by 2,026
- 2022Language Models (Mostly) Know What They Knowcited by 1,856
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
- 2022Solving Quantitative Reasoning Problems with Language Modelscited by 1,392
- 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,256
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
- 2013Exact solutions to the nonlinear dynamics of learning in deep linear neural networkscited by 763
- 2021Learning To Retrieve Prompts for In-Context Learningcited by 648
- 2022Complexity-Based Prompting for Multi-Step Reasoningcited by 388
- 2022Dynamic Prompt Learning via Policy Gradient for Semi-structured Mathematical Reasoningcited by 350
- 2019QASC: A Dataset for Question Answering via Sentence Compositioncited by 252
- 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 243
- 2022Active Example Selection for In-Context Learningcited by 196
- 2018Understanding the impact of entropy on policy optimizationcited by 176
- 2020What Matters In On-Policy Reinforcement Learning? A Large-Scale Empirical Studycited by 162
- 2022Diverse Demonstrations Improve In-context Compositional Generalizationcited by 139
- 2020Provable Benefit of Orthogonal Initialization in Optimizing Deep Linear Networkscited by 73
- 2022Data Curation Alone Can Stabilize In-context Learningcited by 59
- 2023Boosted Prompt Ensembles for Large Language Modelscited by 36
Built on by
Citing papers per year: 2023: 3; 2024: 13; 2025: 5; 2026: 3.
24 papers.
Sort:
By area:
- 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
- 2024In-context Learning with Retrieved Demonstrations for Language Models: A Surveycited by 70
- 2025A Survey of Test-Time Compute: From Intuitive Inference to Deliberate Reasoningcited by 40
- 2023Can Multimodal Large Language Models Truly Perform Multimodal In-Context Learning?cited by 34
- 2023Fewer is More: Boosting LLM Reasoning with Reinforced Context Pruningcited by 26
- 2024DemoRank: Selecting Effective Demonstrations for Large Language Models in Ranking Taskcited by 17
- 2024Addressing Order Sensitivity of In-Context Demonstration Examples in Causal Language Modelscited by 12
- 2024CoPS: Empowering LLM Agents with Provable Cross-Task Experience Sharingcited by 12
- 2024In-Context Learning Demonstration Selection via Influence Analysiscited by 11
- 2024Math Multiple Choice Question Generation via Human-Large Language Model Collaborationcited by 9
- 2024Demonstration Selection for In-Context Learning via Reinforcement Learningcited by 8
- 2024Knowledge Tagging System on Math Questions via LLMs with Flexible Demonstration Retrievercited by 6
12 more
- 2025The Role of Diversity in In-Context Learning for Large Language Modelscited by 6
- 2025Relic: Enhancing Reward Model Generalization for Low-Resource Indic Languages with Few-Shot Examplescited by 6
- 2024Automatic Combination of Sample Selection Strategies for Few-Shot Learningcited by 5
- 2024PromptRefine: Enhancing Few-Shot Performance on Low-Resource Indic Languages with Example Selection from Related Example Bankscited by 5
- 2025Post-Incorporating Code Structural Knowledge into Pretrained Models via ICL for Code Translationcited by 3
- 2025Order Matters: Rethinking Prompt Construction in In-Context Learningcited by 3
- 2024GraphIC: A Graph-Based In-Context Example Retrieval Model for Multi-Step Reasoningcited by 2
- 2024Augmenting In-Context-Learning in LLMs via Automatic Data Labeling and Refinementcited by 1
- 2024PerkwE_COQA: Enhanced Persian Conversational Question Answering by combining contextual keyword extraction with Large Language Modelscited by 0
- 2026Meta-Sel: Efficient Demonstration Selection for In-Context Learning via Supervised Meta-Learningcited by 0
- 2026Downstream-Aware Context Selection for Online In-Context Reinforcement Learningcited by 0
- 2026Efficient Task Adaptation in Large Language Models: A Survey of Weight-Based, Prompt-Based, and Embedding-Based Adaptationscited by 0
- 2026Efficient Task Adaptation in Large Language Models: A Survey of Weight-Based, Prompt-Based, and Embedding-Based Adaptations1 Oct 2026
- 2026Downstream-Aware Context Selection for Online In-Context Reinforcement Learning27 Sep 2026
- 2026Meta-Sel: Efficient Demonstration Selection for In-Context Learning via Supervised Meta-Learning12 Feb 2026
- 2025Order Matters: Rethinking Prompt Construction in In-Context Learning12 Nov 2025
- 2025Relic: Enhancing Reward Model Generalization for Low-Resource Indic Languages with Few-Shot Examples19 Jun 2025
- 2025The Role of Diversity in In-Context Learning for Large Language Models26 May 2025
- 2025Post-Incorporating Code Structural Knowledge into Pretrained Models via ICL for Code Translation28 Mar 2025
- 2025A Survey of Test-Time Compute: From Intuitive Inference to Deliberate Reasoning5 Jan 2025
- 2024PromptRefine: Enhancing Few-Shot Performance on Low-Resource Indic Languages with Example Selection from Related Example Banks7 Dec 2024
- 2024Demonstration Selection for In-Context Learning via Reinforcement Learning5 Dec 2024
- 2024CoPS: Empowering LLM Agents with Provable Cross-Task Experience Sharing22 Oct 2024
- 2024Augmenting In-Context-Learning in LLMs via Automatic Data Labeling and Refinement14 Oct 2024
12 more
- 2024GraphIC: A Graph-Based In-Context Example Retrieval Model for Multi-Step Reasoning3 Oct 2024
- 2024DemoRank: Selecting Effective Demonstrations for Large Language Models in Ranking Task24 Jun 2024
- 2024Knowledge Tagging System on Math Questions via LLMs with Flexible Demonstration Retriever19 Jun 2024
- 2024Math Multiple Choice Question Generation via Human-Large Language Model Collaboration1 May 2024
- 2024PerkwE_COQA: Enhanced Persian Conversational Question Answering by combining contextual keyword extraction with Large Language Models8 Apr 2024
- 2024Addressing Order Sensitivity of In-Context Demonstration Examples in Causal Language Models23 Feb 2024
- 2024In-Context Learning Demonstration Selection via Influence Analysis19 Feb 2024
- 2024Automatic Combination of Sample Selection Strategies for Few-Shot Learning5 Feb 2024
- 2024In-context Learning with Retrieved Demonstrations for Language Models: A Survey21 Jan 2024
- 2023Fewer is More: Boosting LLM Reasoning with Reinforced Context Pruning14 Dec 2023
- 2023Can Multimodal Large Language Models Truly Perform Multimodal In-Context Learning?29 Nov 2023
- 2023In-Context Learning with Iterative Demonstration Selection15 Oct 2023
- 2025A Survey of Test-Time Compute: From Intuitive Inference to Deliberate Reasoningcited by 40
- 2023Fewer is More: Boosting LLM Reasoning with Reinforced Context Pruningcited by 26
- 2024CoPS: Empowering LLM Agents with Provable Cross-Task Experience Sharingcited by 12
- 2024Demonstration Selection for In-Context Learning via Reinforcement Learningcited by 8
- 2025Order Matters: Rethinking Prompt Construction in In-Context Learningcited by 3
- 2024GraphIC: A Graph-Based In-Context Example Retrieval Model for Multi-Step Reasoningcited by 2
- 2024Augmenting In-Context-Learning in LLMs via Automatic Data Labeling and Refinementcited by 1
- 2026Downstream-Aware Context Selection for Online In-Context Reinforcement Learningcited by 0
- 2026Downstream-Aware Context Selection for Online In-Context Reinforcement Learning27 Sep 2026
- 2025Order Matters: Rethinking Prompt Construction in In-Context Learning12 Nov 2025
- 2025A Survey of Test-Time Compute: From Intuitive Inference to Deliberate Reasoning5 Jan 2025
- 2024Demonstration Selection for In-Context Learning via Reinforcement Learning5 Dec 2024
- 2024CoPS: Empowering LLM Agents with Provable Cross-Task Experience Sharing22 Oct 2024
- 2024Augmenting In-Context-Learning in LLMs via Automatic Data Labeling and Refinement14 Oct 2024
- 2024GraphIC: A Graph-Based In-Context Example Retrieval Model for Multi-Step Reasoning3 Oct 2024
- 2023Fewer is More: Boosting LLM Reasoning with Reinforced Context Pruning14 Dec 2023
- 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
- 2024In-context Learning with Retrieved Demonstrations for Language Models: A Surveycited by 70
- 2024DemoRank: Selecting Effective Demonstrations for Large Language Models in Ranking Taskcited by 17
- 2024Addressing Order Sensitivity of In-Context Demonstration Examples in Causal Language Modelscited by 12
- 2024In-Context Learning Demonstration Selection via Influence Analysiscited by 11
- 2024Math Multiple Choice Question Generation via Human-Large Language Model Collaborationcited by 9
- 2024Knowledge Tagging System on Math Questions via LLMs with Flexible Demonstration Retrievercited by 6
- 2025The Role of Diversity in In-Context Learning for Large Language Modelscited by 6
- 2024Automatic Combination of Sample Selection Strategies for Few-Shot Learningcited by 5
- 2024PromptRefine: Enhancing Few-Shot Performance on Low-Resource Indic Languages with Example Selection from Related Example Bankscited by 5
- 2025Post-Incorporating Code Structural Knowledge into Pretrained Models via ICL for Code Translationcited by 3
- 2024PerkwE_COQA: Enhanced Persian Conversational Question Answering by combining contextual keyword extraction with Large Language Modelscited by 0
12 most cited of 14 All 14 (JSON)
- 2026Efficient Task Adaptation in Large Language Models: A Survey of Weight-Based, Prompt-Based, and Embedding-Based Adaptations1 Oct 2026
- 2026Meta-Sel: Efficient Demonstration Selection for In-Context Learning via Supervised Meta-Learning12 Feb 2026
- 2025The Role of Diversity in In-Context Learning for Large Language Models26 May 2025
- 2025Post-Incorporating Code Structural Knowledge into Pretrained Models via ICL for Code Translation28 Mar 2025
- 2024PromptRefine: Enhancing Few-Shot Performance on Low-Resource Indic Languages with Example Selection from Related Example Banks7 Dec 2024
- 2024DemoRank: Selecting Effective Demonstrations for Large Language Models in Ranking Task24 Jun 2024
- 2024Knowledge Tagging System on Math Questions via LLMs with Flexible Demonstration Retriever19 Jun 2024
- 2024Math Multiple Choice Question Generation via Human-Large Language Model Collaboration1 May 2024
- 2024PerkwE_COQA: Enhanced Persian Conversational Question Answering by combining contextual keyword extraction with Large Language Models8 Apr 2024
- 2024Addressing Order Sensitivity of In-Context Demonstration Examples in Causal Language Models23 Feb 2024
- 2024In-Context Learning Demonstration Selection via Influence Analysis19 Feb 2024
- 2024Automatic Combination of Sample Selection Strategies for Few-Shot Learning5 Feb 2024
12 newest of 14 All 14 (JSON)