用强化学习方法高效定位大模型回答的关键上下文片段
Context Attribution with Multi-Armed Bandit Optimization
- 将上下文归因建模为多臂老虎机问题,自适应选择重要片段
- 减少30%模型调用次数,且归因效果不逊于现有方法
- 适用于开源与闭源模型,提升生成结果可解释性
理解检索到的上下文哪些部分对大语言模型生成的回答有贡献,是构建可解释、可信的检索增强生成系统的关键。本文提出一种新框架,将上下文归因问题形式化为组合型多臂老虎机问题。利用线性汤普森采样(Linear Thompson Sampling)高效识别最具影响力的上下文片段,同时最小化模型调用次数。奖励函数基于词元对数概率,衡量子集对原回答的支持程度,适用于开源及黑盒API模型。不同于SHAP等基于均匀采样的扰动方法,本方法根据片段相关性的后验估计自适应优先选择信息量大的子集,显著降低计算开销。在多个问答基准上的实验表明,该方法最多可减少30%的模型查询次数,且归因质量达到或超过现有方法。代码已公开于https://github.com/pd90506/camab。
原文摘要 · Abstract (English)
Understanding which parts of the retrieved context contribute to a large language model's generated answer is essential for building interpretable and trustworthy retrieval-augmented generation. We propose a novel framework that formulates context attribution as a combinatorial multi-armed bandit problem. We utilize Linear Thompson Sampling to efficiently identify the most influential context segments while minimizing the number of model queries. Our reward function leverages token log-probabilities to measure how well a subset of segments supports the original response, making it applicable to both open-source and black-box API-based models. Unlike SHAP and other perturbation-based methods that sample subsets uniformly, our approach adaptively prioritizes informative subsets based on posterior estimates of segment relevance, reducing computational costs. Experiments on multiple QA benchmarks demonstrate that our method achieves up to 30\% reduction in model queries while matching or exceeding the attribution quality of existing approaches. Our code is publicly available at https://github.com/pd90506/camab.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。