Influence Guided Context Selection for Effective Retrieval-Augmented Generation

Jiale Deng, Yanyan Shen, Ziyuan Pei, Youmin Chen, Linpeng Huang
9/21/2025
cs.CLcs.AI

Official code: SJTU-DMTai/RAG-CSM (11 stars, last commit 2025-12-06).

Abstract

Retrieval-Augmented Generation (RAG) addresses large language model (LLM) hallucinations by grounding responses in external knowledge, but its effectiveness is compromised by poor-quality retrieved contexts containing irrelevant or noisy information. While existing approaches attempt to improve performance through context selection based on predefined context quality assessment metrics, they show limited gains over standard RAG. We attribute this limitation to their failure in holistically utilizing available information (query, context list, and generator) for comprehensive quality assessment. Inspired by recent advances in data selection, we reconceptualize context quality assessment as an inference-time data valuation problem and introduce the Contextual Influence Value (CI value). This novel metric quantifies context quality by measuring the performance degradation when removing each context from the list, effectively integrating query-aware relevance, list-aware uniqueness, and generator-aware alignment. Moreover, CI value eliminates complex selection hyperparameter tuning by simply retaining contexts with positive CI values. To address practical challenges of label dependency and computational overhead, we develop a parameterized surrogate model for CI value prediction during inference. The model employs a hierarchical architecture that captures both local query-context relevance and global inter-context interactions, trained through oracle CI value supervision and end-to-end generator feedback. Extensive experiments across 8 NLP tasks and multiple LLMs demonstrate that our context selection method significantly outperforms state-of-the-art baselines, effectively filtering poor-quality contexts while preserving critical information. Code is available at https://github.com/SJTU-DMTai/RAG-CSM.

View on arXivView PDF

Code Implementations(1)

SJTU-DMTai/RAG-CSMOfficial100%

Implementation of "Influence Guided Context Selection for Effective Retrieval-Augmented Generation" (NeurIPS 2025)

111Shell, PythonSep 21, 202510 months ago

Similar Papers

Cite this paper

@article{deng2025influence,
  title  = {Influence Guided Context Selection for Effective Retrieval-Augmented Generation},
  author = {Jiale Deng and Yanyan Shen and Ziyuan Pei and Youmin Chen and Linpeng Huang},
  year   = {2025},
  eprint = {2509.21359},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.21359v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2509.21359.svg)](https://codeofpaper.com/paper/2509.21359)

Discussion