Retrieval-Based In-Context Learning: A Domain Adaptation Framework
stat.ML, cs.LG
Submitted: 2026-10-05
Updated: 2026-10-12
License: http://creativecommons.org/licenses/by/4.0/
The gist: In-context retrieval (ICR) is a retrieval-based form of in-context learning (ICL) in which demonstrations are retrieved from a source database based on similarity to the query, rather than sampled
Terminology
Abstract
In-context retrieval (ICR) is a retrieval-based form of in-context learning (ICL) in which demonstrations are retrieved from a source database based on similarity to the query, rather than sampled independently. In this work, we formulate ICR as a type of domain adaptation problem, where the source distribution P of the database may differ from the target distribution Q of the test query-label pair. We investigate the performance of ICR under a flexible class of distributional shifts that substantially extends prior work, and establish theoretical guarantees that quantify the benefits and pitfalls of this learning paradigm. Our theory is verified by experiments on synthetic and language tasks.
Sources
- Empowering LLM Agents with Geospatial Awareness: Toward Grounded Reasoning for Wildfire Response
- Retrieval-Augmented Generation as Noisy In-Context Learning: A Unified Theory and Risk Bounds
- A Comprehensive Survey of Retrieval-Augmented Generation (RAG): Evolution, Current Landscape and Future Directions
- Help Me Help You: The Aggregate Value of Source and Target Data in Transfer Learning
- TabPFN: A Transformer That Solves Small Tabular Classification Problems in a Second
- PAC Learnability in the Presence of Performativity
- Out-of-Distribution Generalization of In-Context Learning: A Low-Dimensional Subspace Perspective
- TabICL: A Tabular Foundation Model for In-Context Learning on Large Data
Related papers
- Behavior of prediction performance metrics with rare events
- Optimal Estimation of Generic Dynamics by Path-Dependent Neural Jump ODEs
- A Posterior-Dynamics Framework for Imaging Inverse Problems with Pretrained Diffusion Priors
- Efficient quadratic entropy with distance sketches
- Embedding-Bias in Conditional Independence Testing
- From Log-Odds to Shapley Values: An Explanatory Geometry for the Weighted Naive Bayes Classifier