alphaFeedback

WorksComputer Science

Learning from a Bandit Learner

AI contributions
Not recorded for this paper
View details

Abstract

Classical inverse bandit methods typically aim to recover true reward parameters. In contrast, we infer a demonstrator's subjective beliefs, specifically its internal estimates of suboptimality gaps. We consider no-regret demonstrators that follow randomized policies, such as Thompson sampling, and characterize a family of algorithms for which per-step inversion is possible. This enables gap estimates to be recovered directly from the arm-selection distribution. Our analysis identifies an inherent stability-coverage trade-off: inversion becomes ill-conditioned as the demonstrator concentrates its probability mass on a single arm, while the number of informative rounds depends on the rate at which its policy converges. We establish conditions under which inversion is reliable and provide theoretical guarantees on the resulting estimation error. Experiments on simulated data support the analysis and illustrate how these conditions affect gap recovery in practice.

Introduction

Imagine going to the casino with a friend. As they decide to try their luck on the slot machines, you sit back and watch, observing them progressively allocate their coins to the machines. Suppose your friend (the learner) has recently read Bandit Algorithms (Lattimore and Szepesvári, [18]) and can perform a no-regret learning strategy, but you (the observer) do not know exactly which one. Can you infer their belief on the average rewards of the machines?

We study the problem of learning from a learner (Jacq et al., [15]) in the bandit setting, a variation of the Inverse Bandits (IB) problem (Guo et al., [12]; Guha et al. [11]) that we address under different assumptions and observation models. Guo et al. [12] study a white-box setting in which the observer knows the learner’s internal decision mechanism exactly and uses it explicitly to form estimates of the true mean rewards, that are recoverable only up to a constant due to the unidentifiability of inverse problems (Russell, [28]). In contrast, we propose a formulation that relaxes the white-box assumption. Specifically, we assume that the demonstrator belongs to a broad family of randomized, no-regret bandit algorithms, and that the observer has access to the realized action sequence, with neither knowledge of the exact policy that generated it nor of the rewards associated with the played actions. However, we assume that the observer can form an estimate of the demonstrator’s sampling probability. Under this structured grey-box assumption we target the learner’s internal beliefs about the means, which may not coincide with the true means (Halder et al., [13]). This shift is deliberate: these beliefs govern the behavior of a demonstrator that is still learning and, without additional information, are the only reward-related quantities that can be learned from its actions. Even if the beliefs on the rewards are biased, a second learner can leverage them to construct a better policy for the same task, in the spirit of “better than the demonstrator” approaches (Brown et al., [4]).

We focus on randomized algorithms, which implicitly or explicitly sample arms at each round from a distribution that depends on an internal estimate of the mean rewards and the learner’s uncertainty. The most prominent such algorithm is Thompson Sampling (TS) (Thompson, [32]; Russo et al. [29]), which pulls arms according to the probability that their mean reward is larger than all others, what Menet et al. [22] call Probability of Maximality (PoM). In TS, the sampling probability is implicit via an indirect posterior sampling mechanism, making it difficult to recover the belief parameter in closed form from the sampling distribution.

Our first contribution is a general class of randomized bandit algorithms whose sampling probabilities admit a closed-form relationship with their internal mean estimates. Building on the Linear-Time Independence-based Estimator (LITE) of Menet et al. [22], in Section 2.2 we introduce v-LITE Sampling (v-LS), which turns the LITE estimator into a sampling rule. Under suitable assumptions, we provide regret bounds for vv-LS in Appendix B.

Our second contribution is an inversion method for this class of learners. In Section 4, we show how the demonstrator’s sampling probabilities can be inverted to recover its internal gap estimates. We derive inversion-error bounds when the sampling probabilities are available only through estimates, including under batched observations. To move beyond exactly specified vv-LS demonstrators, we define a broader family of algorithms whose internal gaps and sampling policies are close to those of a reference vv-LS learner. For this family, the reconstruction error is controlled jointly by the sampling-probability estimation error and the mismatch with the reference policy. We support these theoretical results with simulations.

Preliminaries

A stochastic bandit instance (Lattimore and Szepesvári [18]) is defined as a collection of reward distributions ν=(νa:a∈[K])\nu= (\nu_a : a \in[K]), where [K]:={1,2,…,K}[K] := \{1, 2, \ldots, K\} denotes the set of available actions (bandit arms). For the remainder of this paper, we assume the reward noise to be zero-mean Gaussian, with variance α2\alpha^2, meaning each arm’s reward distribution is νa=N(θa,α2)\nu_a = \mathcal{N}(\theta_a, \alpha^2), where θa:=ER∼νa[R]\theta_a := \mathbb{E}_{R\sim\nu_a}[R] denotes its expected reward. In our Bayesian formulation, the vector of arm means θ=(θ1,…,θK)\theta= (\theta_1, \ldots, \theta_K) may have a correlated Gaussian prior; that is, its prior covariance matrix need not be diagonal. Conditional on θ\theta, the observation noise is independent across rounds.

The learner interacts with the environment over a horizon of TT rounds. At each round tt, the learner selects an action at∈[K]a_t \in[K], then the environment samples a reward rt∼νatr_t \sim\nu_{a_t} and reveals it to the learner.

Define Na(t):=∑j=1t1{aj=a}N_a(t) := \sum_{j=1}^{t} \mathbb{1}\{a_j = a\}, i.e., the number of pulls of arm aa at time tt. The optimal arm is defined as a∗:=arg⁡max⁡a∈[K]θaa^* := \arg\max_{a\in[K]} \theta_a.

A learning algorithm is said to be no-regret if its cumulative regret, E[∑t=1Tθa∗−θat]\mathbb{E}[\sum_{t=1}^{T}\theta_{a^*}-\theta_{a_t}], grows sub-linearly with the horizon TT. Classical algorithms known to achieve sub-linear regret include Upper Confidence Bound (UCB) ([2, 30]) and TS ([32, 29]).

Throughout the paper, we use the terms learner and demonstrator interchangeably to refer to the online learning algorithm that sequentially selects actions, observes their rewards, and aims to minimize regret relative to the best arm. The observer, by contrast, has access only to the resulting action trajectory {at}t=1T\{a_t\}_{t=1}^{T}, together with any information permitted by the specified observation protocol, and never observes the corresponding rewards.

TS and the Probability of Maximality

TS ([32, 1, 29]) is a Bayesian algorithm for sequential decision-making that balances exploration and exploitation through posterior sampling. While being arguably the oldest strategy for bandit play, it has remained popular, e.g., enabling analysis of coding agents ([23]) or improving robustness of LLM post-training ([24]). In TS, the learner maintains a posterior distribution ptp_t over the unknown parameters (θa)a∈[K](\theta_a)_{a\in[K]} governing the reward distribution of all arms. At each round tt, the learner samples Zt∼ptZ_t \sim p_t from the current posterior and selects the arm

at=arg⁡max⁡a∈[K]Za,t(1)a_t = \arg\max_{a\in[K]} Z_{a,t} \tag*{(1)}

observes the associated reward rt∼νatr_t \sim\nu_{a_t}, and updates the posterior via Bayes rule. In particular, under a Gaussian prior over the rewards, θ∼N(μ0,Σ0)\theta\sim\mathcal{N}(\mu_0,\Sigma_0) and assuming known noise variance α2\alpha^2, after selecting arm at=aa_t = a the update has closed form N(μt+1,Σt+1)\mathcal{N}(\mu_{t+1},\Sigma_{t+1}). Defining Ht∈RK×KH_t \in\mathbb{R}^{K\times K} as a diagonal matrix with [Ht]a,a=Na(t)[H_t]_{a,a} = N_a(t), the covariance matrix and mean vector are updated as:

Σt+1=(Σ0−1+α−2Ht)−1,(2)\Sigma_{t+1} = \left(\Sigma_0^{-1} + \alpha^{-2}H_t\right)^{-1}, \tag*{(2)}
μt+1=Σt+1(Σ0−1μ0+α−2∑s=1trseas),(3)\mu_{t+1} = \Sigma_{t+1}\left(\Sigma_0^{-1}\mu_0 + \alpha^{-2}\sum_{s=1}^{t} r_s e_{a_s}\right), \tag*{(3)}

where eae_a is the standard basis vector for the arm pulled at round ss. We denote the marginal for each arm as N(μa,t,σa,t2)\mathcal{N}(\mu_{a,t},\sigma_{a,t}^2), where μa,t=[μt]a\mu_{a,t} = [\mu_t]_a and σa,t2=[Σt]a,a\sigma_{a,t}^2 = [\Sigma_t]_{a,a}. Importantly, Σt\Sigma_t depends solely on the initial prior covariance and the action history, making the sequence of marginal uncertainties σa,t\sigma_{a,t} perfectly deterministic and observable ((2)). In contrast, μt\mu_t depends on the observed rewards rsr_s ((3)), which is observable to the learner but not to the inverse learner.

The randomized mechanism of (1) was originally designed by Thompson [32] to approximate the likelihood that one arm’s mean reward is larger than those of all other arms, the so called Probability of Maximality (PoM). Indeed, it can be shown1 that the conditional distribution of the identity of the optimal arm coincides exactly with that of the action chosen by TS:

P(arg⁡max⁡b∈[K]θb=⋅∣Ft−1)=P(at=⋅∣Ft−1)\mathbb{P}\left(\arg\max_{b\in[K]}\theta_b = \mathord{\cdot}\mid\mathcal{F}_{t-1}\right) = \mathbb{P}\left(a_t = \mathord{\cdot}\mid\mathcal{F}_{t-1}\right)

where Ft−1\mathcal{F}_{t-1} denotes all observations up to round t−1t-1.

LITE sampling

Although the TS mechanism already provides samples from the PoM, direct access to it opens up new possibilities such as Entropy Search [14, 22], Bayes-optimal batch selection [7, 22], policies for zero-sum two-player games [26], and scaling up Thompson sampling via fine-tuning of LLMs [25].

Therefore, we introduce a family of algorithms whose sampling probability is directly connected to the PoM.

Definition 2.1 (vv-LITE). Let v:R→(0,1)v:\mathbb{R}\to(0,1) be a strictly increasing and continuously differentiable CDF, and let μa∈R,σa>0\mu_a\in\mathbb{R},\sigma_a>0 be given location and scale parameters for each arm a∈[K]a\in[K]. We define the vv-LITE estimator of PoM as the probability vector qq with

qa:=v(μa−κ∗σa)∀a∈[K],(4)q_a := v\left(\frac{\mu_a-\kappa^*}{\sigma_a}\right)\quad\forall a\in[K], \tag*{(4)}

where the threshold κ∗∈R\kappa^*\in\mathbb{R} is the unique constant ensuring normalization, i.e., that ∑a=1Kqa=1\sum_{a=1}^{K}q_a=1.

Given that this approximate PoM (qtq_t) can be obtained efficiently via binary search for κ∗\kappa^* [22], a natural approximation to TS is a randomized algorithm that samples arms directly according to vv-LITE.

Definition 2.2 (vv-LITE Sampling, vv-LS). At round tt, vv-LS computes qa,tq_{a,t} according to Definition 2.1, where (μa,t,σa,t)(\mu_{a,t},\sigma_{a,t}) are the posterior mean and standard deviation of the Gaussian marginals θa\theta_a. Then, vv-LS selects an action at∼Cat⁡(qt)a_t\sim\operatorname{Cat}(q_t) and updates the posterior parameters.

The vv-LS family is motivated by two prominent special cases that approximate TS:

  • VBOS: Setting v(x)=Ψ(x):=exp⁡(−(x2+4−x)2/8)v(x)=\Psi(x):=\exp\left(-(\sqrt{x^2+4}-x)^2/8\right) recovers variational Bayesian optimistic sampling (VBOS), a popular and theoretically sound no-regret approximation of TS for subgaussian rewards [26, 31, 25].

  • F-LITE: Setting v=Φv=\Phi, where Φ\Phi is the standard normal CDF, recovers the F-LITE estimator of Gaussian PoM [22]. F-LITE is a highly accurate TS approximation derived using extreme value theory, though no-regret guarantees are not established for bandit play under Φ\Phi-LS.

vv-LS applies under broad distributional assumptions; its no-regret properties are established in Appendix B. Particularly, for subgaussian θ\theta and v(x)=Ψ(x)v(x)=\Psi(x), it achieves O~(TK)\widetilde{O}(\sqrt{TK}) regret [31].

In the correlated Gaussian setting, this improves to O~(TγT)\widetilde{O}(\sqrt{T\gamma_T}) [25], where γT\gamma_T is the maximum information gain [30] and scales as O(dlog⁡T)O(d\log T) for an effective dimension dd. We write LS when referring collectively to vv-LS for all admissible choices of vv.

Problem Formulation

We consider a randomized no-regret algorithm A\mathcal{A} as a demonstrator. In each round tt, A\mathcal{A} samples at∼pta_t\sim p_t conditional on its interaction history Ft−1\mathcal{F}_{t-1}.

The observer has access to the complete action trajectory {at}t=1T\{a_t\}_{t=1}^{T}, but not to the corresponding rewards. We assume that the observation protocol permits the construction of estimates p^t\hat{p}_t of the conditional action distributions ptp_t, either from the trajectory itself or from additional action-level observations. In Section 4.2.1, we quantify how the estimation error in p^t\hat{p}_t affects inversion under suitable approximation guarantees.

Access to p^t\hat{p}_t is behavioral rather than white-box: the observer does not see the realized rewards, the demonstrator’s internal beliefs, or the exact mechanism mapping its history to ptp_t. We initially impose no relationship between the demonstrator’s internal reward estimates and its sampling probabilities. The structural assumptions that make inversion possible are introduced in Section 4.

References

  1. [1]Shipra Agrawal and Navin Goyal. Further optimal regret bounds for thompson sampling. In Carlos M. Carvalho and Pradeep Ravikumar, editors, Proceedings of the Sixteenth International Conference on Artificial Intelligence and Statistics, volume 31 of Proceedings of Machine Learning Research, pages 99–107, Scottsdale, Arizona, USA, 29 Apr–01 May 2013. PMLR.
  2. [2]Peter Auer, Nicolò Cesa-Bianchi, and Paul Fischer. Finite-time analysis of the multiarmed bandit problem. Machine Learning, 2002.DOI
  3. [3]Jie Bian and Kwang-Sung Jun. Maillard sampling: Boltzmann exploration done optimally. In International Conference on Artificial Intelligence and Statistics, pages 54–72. PMLR, 2022.arxiv.org/abs/2111.03290
  4. [4]Daniel S Brown, Wonjoon Goo, and Scott Niekum. Better-than-demonstrator imitation learning via automatically-ranked demonstrations. In Conference on robot learning, pages 330–359. PMLR, 2020.arxiv.org/abs/1907.03976
  5. [5]Nicolò Cesa-Bianchi, Claudio Gentile, Gábor Lugosi, and Gergely Neu. Boltzmann exploration done right. Advances in neural information processing systems, 30, 2017.
  6. [6]Eyal Even-Dar, Shie Mannor, and Yishay Mansour. Action elimination and stopping conditions for the multi-armed bandit and reinforcement learning problems. Journal of Machine Learning Research, 7(39):1079–1105, 2006.DOI
  7. [7]Jenna Fromer, Runzhong Wang, Mrunali Manjrekar, Austin Tripp, José Miguel Hernández-Lobato, and Connor W Coley. Batched bayesian optimization by maximizing the probability of including the optimum. Journal of Chemical Information and Modeling, 65(10):4808–4817, 2025.
  8. [8]Aurélien Garivier and Olivier Cappé. The kl-ucb algorithm for bounded stochastic bandits and beyond. In Proceedings of the 24th annual conference on learning theory, pages 359–376. JMLR Workshop and Conference Proceedings, 2011.arxiv.org/abs/1102.2490
  9. [9]Aurélien Garivier, Pierre Ménard, and Gilles Stoltz. Explore first, exploit next: The true shape of regret in bandit problems. Mathematics of Operations Research, 44(2):377–399, 2019.
  10. [10]Robert M Gray. Entropy and information theory. Springer Science & Business Media, 2011.
  11. [11]Etash Kumar Guha, Jim Thannikary James, Krishna Acharya, Vidya Muthukumar, and Ashwin Pananjady. One shot inverse reinforcement learning for stochastic linear bandits. In The 40th Conference on Uncertainty in Artificial Intelligence, 2024.
  12. [12]Wenshuo Guo, Kumar K Agrawal, Aditya Grover, Vidya K Muthukumar, and Ashwin Pananjady. Learning from an exploring demonstrator: Optimal reward estimation for bandits. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2022.arxiv.org/abs/2106.14866
  13. [13]Budhaditya Halder, Shubhayan Pan, and Koulik Khamaru. Stable thompson sampling: Valid inference via variance inflation, 2025.arxiv.org/abs/2505.23260
  14. [14]Philipp Hennig and Christian J Schuler. Entropy search for information-efficient global optimization. The Journal of Machine Learning Research, 13(1):1809–1837, 2012.arxiv.org/abs/1112.1217
  15. [15]Alexis Jacq, Matthieu Geist, Ana Paiva, and Olivier Pietquin. Learning from a learner. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 2990–2999. PMLR, 09–15 Jun 2019.
  16. [16]Donald Jones, Matthias Schonlau, and William Welch. Efficient global optimization of expensive black-box functions. Journal of Global Optimization, 13:455–492, 12 1998.DOI
  17. [18]Tor Lattimore and Csaba Szepesvári. Bandit Algorithms. Cambridge University Press, 2020.DOI
  18. [19]Antoine Maillard. Fundamental limits of high-dimensional estimation: a stroll between statistical physics, probability and random matrix theory. PhD thesis, Université Paris sciences et lettres, 2021.DOI
  19. [20]Odalric-Ambrym Maillard. APPRENTISSAGE SÉQUENTIEL : Bandits, Statistique et Renforcement. Theses, Université des Sciences et Technolo- gie de Lille - Lille I, October 2011. URL https://theses.hal.science/tel-00845410.
  20. [21]Nabin K Malakar and Kevin H Knuth. Entropy-based search algorithm for experimental design. In AIP Conference Proceedings, volume 1305, pages 157–164. American Institute of Physics, 2011.DOI
  21. [22]Nicolas Menet, Jonas Hübötter, Parnian Kassraie, and Andreas Krause. LITE: Efficiently estimating Gaussian probability of maximality. In International Conference on Artificial Intelligence and Statistics, volume 258, pages 4996–5004. Proceedings of Machine Learning Research, 2025.arxiv.org/abs/2501.13535
  22. [23]Nicolas Menet, Michael Hersche, Andreas Krause, and Abbas Rahimi. A theoretical analysis of test-driven code generation. Advances in Neural Information Processing Systems, 39, 2026a.
  23. [24]Nicolas Menet, Andreas Krause, and Abbas Rahimi. POETS: Uncertainty-aware LLM optimization via compute-efficient policy ensembles. Advances in Neural Information Processing Systems, 39, 2026b.
  24. [25]Nicolas Menet, Aleksandar Terzic, Michael Hersche, Andreas Krause, and Abbas Rahimi. Thompson sampling via fine-tuning of LLMs. In International Conference on Learning Representations, 2026c.arxiv.org/abs/2510.13328
  25. [26]Brendan O’Donoghue and Tor Lattimore. Variational Bayesian optimistic sampling. In Neural Information Processing Systems, 2021.arxiv.org/abs/2110.15688
  26. [27]Tingting Ou, Rachel Cummings, and Marco Avella Medina. Thompson sampling itself is differentially private. In International Conference on Artificial Intelligence and Statistics, pages 1576–1584. PMLR, 2024.arxiv.org/abs/2407.14879
  27. [28]Stuart Russell. Learning agents for uncertain environments. In Proceedings of the eleventh annual conference on Computational learning theory, pages 101–103, 1998.DOI
  28. [29]Daniel J Russo, Benjamin Van Roy, Abbas Kazerouni, Ian Osband, Zheng Wen, et al. A tutorial on thompson sampling. Foundations and Trends® in Machine Learning, 11(1):1–96, 2018.
  29. [30]Niranjan Srinivas, Andreas Krause, Sham M Kakade, and Matthias Seeger. Gaussian process optimization in the bandit setting: No regret and experimental design. arXiv preprint arXiv:0912.3995, 2009.DOI
  30. [31]Jean Tarbouriech, Tor Lattimore, and Brendan O’Donoghue. Probabilistic inference in reinforcement learning done right. Advances in Neural Information Processing Systems, 36:33687–33725, 2023.arxiv.org/abs/2311.13294
  31. [32]William R. Thompson. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika, 25:285–294, 1933.
  32. [33]Zi Wang and Stefanie Jegelka. Max-value entropy search for efficient Bayesian optimization. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 3627–3635. PMLR, 06–11 Aug 2017.

Paper details

vlnc:W_8enbzvq4
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Computer Science

Not recorded for this paper · View statement →

Looking for related papers…
Contents