Adapt in Contexts: Retrieval-Augmented Domain Adaptation via In-Context Learning
Quanyu Long, Wenya Wang, Sinno Jialin Pan
Abstract
Large language models (LLMs) have showcased their capability with few-shot inference known as in-context learning. However, in-domain demonstrations are not always readily available in real scenarios, leading to cross-domain in-context learning. Besides, LLMs are still facing challenges in long-tail knowledge in unseen and unfamiliar domains. The above limitations demonstrate the necessity of Unsupervised Domain Adaptation (UDA). In this paper, we study the UDA problem under an in-context learning setting to adapt language models from the source domain to the target domain without any target labels. The core idea is to retrieve a subset of cross-domain elements that are the most similar to the query, and elicit language model to adapt in an in-context manner by learning both target domain distribution and the discriminative task signal simultaneously with the augmented cross-domain in-context examples. We devise different prompting and training strategies, accounting for different LM architectures to learn the target distribution via language modeling. With extensive experiments on Sentiment Analysis (SA) and Named Entity Recognition (NER) tasks, we thoroughly study the effectiveness of ICL for domain transfer and demonstrate significant improvements over baseline models.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers7
- RAEmoLLM: Retrieval Augmented LLMs for Cross-Domain Misinformation Detection Using In-Context Learning Based on Emotional InformationZhiwei Liu, Kailai Yang, Qianqian Xie, Christine de Kock et al.ACL 2025 · 16 citations
- Can LLMs Reason Over Non-Text Modalities in a Training-Free Manner? A Case Study with In-Context Representation LearningTianle Zhang, Wanlong Fang, Jonathan Woo, Paridhi Latawa et al.NeurIPS 2025 · 6 citations
- GraphLoRA: Structure-Aware Contrastive Low-Rank Adaptation for Cross-Graph Transfer LearningZhe-Rui Yang, Jindong Han, Chang-Dong Wang, Hao LiuKDD 2025 · 5 citations
- Towards Robustness of Text-to-Visualization Translation Against Lexical and Phrasal VariabilityJinwei Lu, Yuanfeng Song, Haodi Zhang, Chen Jason Zhang et al.ICDE 2025 · 3 citations
- ProMALex: Progressive Modular Adapters for Multi-Jurisdictional Legal Language ModelingT. Y. S. S. Santosh, Mohamed Hesham ElganayniACL 2025 · 2 citations
Builds on14
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 citations
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni et al.NeurIPS 2020 · 19,162 citations
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
- BERTScore: Evaluating Text Generation with BERTTianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger et al.ICLR 2020 · 8,443 citations
Related papers
- Prompt-Based Distribution Alignment for Unsupervised Domain AdaptationShuanghao Bai, Min Zhang, Wanqi Zhou, Siteng Huang et al.AAAI 2024 · 103 citations
- Multilingual LLMs are Better Cross-lingual In-context Learners with AlignmentEshaan Tanwar, Subhabrata Dutta, Manish Borthakur, Tanmoy ChakrabortyACL 2023 · 21 citations
- End-to-End Knowledge Distillation for Unsupervised Domain Adaptation with Large Vision-language ModelsYangtao Wang, Xingwei Deng, Yanzhao Xie, Weilong Peng et al.AAAI 2026 · 1 citation
- Why Multimodal In-Context Learning Lags Behind? Unveiling the Inner Mechanisms and BottlenecksYu Wang, Sharon LiACL 2026
- Universal Self-Adaptive PromptingXingchen Wan, Ruoxi Sun, Hootan Nakhost, Hanjun Dai et al.EMNLP 2023 · 4 citations
