The “Curious Case of Contexts” in Retrieval‐Augmented Generation With a Combination of Labeled and Unlabeled Data
ABSTRACT With the growing reliance on LLMs for a wide range of NLP tasks, optimizing the use of labeled and unlabeled data for effective context generation has become critical. This work explores the interplay between two prominent methodologies in few‐shot learning: in‐context learning (ICL), which utilizes labeled task‐specific data, and retrieval‐augmented generation (RAG), which leverages unlabeled external knowledge to augment generative models. Since each has its individual limitations, we propose a novel hybrid approach to obtain “the best of both worlds” by dynamically integrating both labeled and unlabeled data towards improving the downstream performance of LLMs. Our methodology, which we call LU‐RAG (labeled and unlabeled RAG), recomputes the scores of top‐ k labeled instances and top‐ m unlabeled passages to refine context selection. Our experimental results demonstrate that LU‐RAG consistently outperforms both standalone ICL and RAG across multiple benchmarks, showing significant gains in downstream performance. Furthermore, we show that LU‐RAG performs better with a semantic neighborhood as compared to a lexical one, highlighting its ability to generalize effectively.
Authors
- Madhusudan Ghosh (ORCID: https://orcid.org/0000-0002-8330-2703)
- Partha Basuchowdhuri (ORCID: https://orcid.org/0000-0001-7655-7591)
- Sudip Kumar Naskar (ORCID: https://orcid.org/0000-0003-1588-4665)
- Debasis Ganguly (ORCID: https://orcid.org/0000-0003-0050-7138)
- Payel Santra (ORCID: https://orcid.org/0009-0005-5721-248X)
Institutions
- Indian Association for the Cultivation of Science (IN)
- Jadavpur University (IN)
- University of Glasgow (GB)
Publication Details
- Journal
- Wiley Interdisciplinary Reviews Data Mining and Knowledge Discovery
- Published
- 2025-05-29
- DOI
- https://doi.org/10.1002/widm.70021
- Citations
- 1
- Primary Topic
- Topic Modeling
- Type
- article
- Field-Weighted Citation Impact
- 2.48