CA - GAR : Context-Aware Alignment of LLM Generation for Document Retrieval (2025)

Abstract: Information retrieval has evolved from traditional sparse and dense retrieval methods to approaches driven by large language models (LLMs). Recent techniques, such as Generation-Augmented Retrieval (GAR) and Generative Document Retrieval (GDR), leverage LLMs to enhance retrieval but face key challenges: GAR’s generated content may not always align with the target document corpus, while GDR limits the generative capacity of LLMs by constraining outputs to predefined document identifiers. To address these issues, we propose Context-Aware Generation-Augmented Retrieval (CA-GAR), which enhances LLMs by integrating corpus information into their generation process. CA-GAR optimizes token selection by incorporating relevant document information and leverages a Distribution Alignment Strategy to extract corpus information using a lexicon-based approach. Experimental evaluations on seven tasks from the BEIR benchmark and four non-English languages from Mr.TyDi demonstrate that CA-GAR outperforms existing methods.

## introduction information retrieval (ir) has become a critical component of natural language processing (nlp). the field has evolved from traditional sparse retrieval methods based on lexicon, such as tf-idf and bm25 @xcite , to dense retrieval @xcite approaches powered by deep learning and pre-trained models like bert @xcite . the advent of large language models (llms) has significantly enhanced information retrieval by leveraging their advanced natural language understanding and generalization capabilities @xcite @xcite . current research in this domain primarily revolves around two paradigms: (1) generation-augmented retrieval (gar), which enhances retrieval performance by utilizing llms' generative abilities to refine queries @xcite @xcite ; and (2) generative document retrieval (gdr), which employs llms to generate document identifiers directly through constrained decoding, thereby encoding corpus-specific information into the retrieval process @xcite . however, both approaches present challenges. in gar, a common strategy involves generating auxiliary text (e.g., query rewriting @xcite @xcite or hypothetical document embeddings such as hyde @xcite ) to assist retrieval. however, the generated content may not always align well with the characteristics of the target document corpus, leading to suboptimal retrieval performance. as illustrated in figure 1 , while the language model can generate both passage 1 and passage 2 as plausible outputs, passage 2 is better suited for retrieval within the given document corpus. although gdr ensures that the generated content exists within the document corpus through constrained decoding, effectively avoiding the retrieval mismatches observed in gar, this approach inherently limits the capacity of language models. @xcite . based on the observations above, our research question is: how can we ensure that content generated by llms is well-suited for retrieval within a target document corpus while fully leveraging the generative capabilities of llms? in retrieval tasks, the number of documents in the corpus is typically vast, far exceeding the context window that llms can process. consequently, directly providing the entire document corpus as input to the model is infeasible. this presents a key challenge: how can we effectively integrate corpus information into llms to enhance their retrieval performance? to address this challenge, we introduce a novel approach called context-aware generation-augmented retrieval (ca-gar), which incorporates corpus information into the generation process of llms. specifically, at the core of our approach is the optimization of the model's autoregressive generation process by leveraging relevant document information from the corpus to influence token selection. to achieve this, we propose a distribution alignment strategy, which utilizes a lexicon-based method to extract corpus information. this strategy approximates the optimization of the model's autoregressive generation process, ensuring that the generated content is better aligned with the target document corpus. in summary, our contributions are as follows: large language models large language models (llms) have demonstrated remarkable generalization capabilities, bringing significant transformations to the field of natural language processing @xcite @xcite . in the area of information retrieval, researchers have leveraged the instruction-following and in-context learning abilities of llms @xcite @xcite to effectively address retrieval tasks by simply providing task definitions and a few retrieval examples @xcite . building on this foundation, further studies have explored the use of llms for query enhancement, including query rewriting @xcite and the expansion of relevant document information @xcite . notably, these approaches do not require additional training. moreover, researchers have proposed parameter-efficient fine-tuning techniques to adapt portions of an llm's parameters, enabling the model to function directly as an embedding model for retrieval tasks @xcite @xcite . this approach significantly reduces the computational and training resources required while preserving the llms' powerful natural language understanding capabilities. ## methodology in this section, we first introduce the task definition of gar. then, we explain how our proposed ca-gar method is designed. ## experiments in this section, we provide a detailed explanation of the implementation of ca-gar and present the experimental results on datasets. furthermore, we demonstrate the performance improvements achieved by our approach over both bm25 and dense retrieval models. ## conclusion this paper introduces ca-gar, a novel generative augmentation retrieval method that optimizes llms generation using a distribution alignment strategy. by leveraging a lexicon-based approach with bm25, ca-gar ensures better alignment between generated content and target documents. experiments on low-resource and multilingual datasets validate its effectiveness, with advanced llms further enhancing performance. a case study illustrates ca-gar's impact on content generation, highlighting its ability to maximize llms' generative potential.