Context Attribution with Multi-Armed Bandit Optimization

Deng Pan, Keerthiram Murugesan, Nuno Moniz, Nitesh Chawla
6/24/2025
cs.AI

No confident code implementation found for this paper.

Abstract

Understanding which parts of the retrieved context contribute to a large language model's generated answer is essential for building interpretable and trustworthy generative QA systems. We propose a novel framework that formulates context attribution as a combinatorial multi-armed bandit (CMAB) problem. Each context segment is treated as a bandit arm, and we employ Combinatorial Thompson Sampling (CTS) to efficiently explore the exponentially large space of context subsets under a limited query budget. Our method defines a reward function based on normalized token likelihoods, capturing how well a subset of segments supports the original model response. Unlike traditional perturbation-based attribution methods such as SHAP, which sample subsets uniformly and incur high computational costs, our approach adaptively balances exploration and exploitation by leveraging posterior estimates of segment relevance. This leads to substantially improved query efficiency while maintaining high attribution fidelity. Extensive experiments on diverse datasets and LLMs demonstrate that our method achieves competitive attribution quality with fewer model queries.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{pan2025context,
  title  = {Context Attribution with Multi-Armed Bandit Optimization},
  author = {Deng Pan and Keerthiram Murugesan and Nuno Moniz and Nitesh Chawla},
  year   = {2025},
  eprint = {2506.19977},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.19977v1}
}

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/2506.19977.svg)](https://codeofpaper.com/paper/2506.19977)

Discussion