The “Curious Case of Contexts” in Retrieval‐Augmented Generation With a Combination of Labeled and Unlabeled Data

Authors:

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.

This publication has 81 references indexed in Scilit: