We study Contextual Multi-Armed Bandits (CMABs) for non-episodic decision-making problems where the context includes both textual and numerical information (e.g., recommendation systems, dynamic portfolio adjustments, offer selection; all frequent problems in finance). While Large Language Models (LLMs) are increasingly applied to these settings, utilizing LLMs for reasoning at every decision step is computationally expensive, and uncertainty estimates are difficult to obtain. To address this, we introduce LLMP-UCB, a bandit algorithm that derives uncertainty estimates from LLMs via repeated inference. However, our experiments demonstrate that lightweight numerical bandits operating on text embeddings (dense or Matryoshka) match or exceed the accuracy of LLM-based solutions at a fraction of their cost. We further show that embedding dimensionality is a practical lever on the exploration-exploitation balance, enabling cost-performance tradeoffs without prompt complexity. Finally, to guide practitioners, we propose a geometric diagnostic based on the arms' embeddings to decide when to use LLM-driven reasoning versus a lightweight numerical bandit. Our results provide a principled deployment framework for cost-effective, uncertainty-aware decision systems with broad applicability across AI use cases.
Figures & tables
Figure 1: A taxonomy of the bandit architectures used in this work. a) and c) illustrate the case where we perform reward function regression for each arm. Alternatively, in b) the LLM makes the decision itself without modeling the expected reward of each arm.
Algorithm
fextract
fLLM
fnum_lin
fnum_nonlin
nonlin1
nonlin2
CGP-UCB
8.2±2.2
65.60±8.04
199.80±25.1
444.9±45.6
315.0±28.2
235.3±27.0
LinUCB
10.2±1.9
43.2±7.3
36.6 ± 9.4
351.9±45.5
181.6±26.3
23.0 ± 7.2
LLM-Bandit
11.5±1.0
36.0±6.9
190.0±16.3
302.7 ± 42.0
346.6±28.7
43.7±10.6
LLMP-Bandit
17.2±2.9
40.00±7.1
54.2 ± 11.4
378.6±36.9
150.0 ± 22.4
23.2 ± 9.6
Random
27.6±3.7
130.4±8.0
256.2±25.2
568.2±48.2
297.2±26.0
297.5±27.8
Thompson
14.9±2.4
54.6±7.8
54.0±12.4
317.1±43.1
152.8 ± 19.3
72.9±14.7
Table 1: Cumulative regret and standard deviation across 5 seeds with different reward functions.
Figure 2: Full experimental results of the different algorithms and reward functions
Figure 3: Llama3.1-8B Results for all the methods with the numerical baselines as horizontal lines.
Figure 4: Qwen2.5-7B Results for all the methods with the numerical baselines as horizontal lines.
Figure 5: LinUCB results for all dimensions when using Matryoshka representation.
Figure 6: LinUCB results for all dimensions when using traditional dense representation.
Figure 7: LinUCB final accuracies across dimensions for all the types of embeddings used.
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 8: Mesh plot of the reward functions
Figure 9: LinUCB performance with a linear reward function
Figure 10: LinUCB performance with a non-linear reward function
Figure 11: Thompson performance with a linear reward function
Figure 12: Thompson performance with a non-linear reward function
Figure 13: GPUCB performance with a linear reward function
Figure 14: GPUCB performance with a non-linear reward function
Contextual bandit algorithms suffer from high regret during cold-start, when the learner has insufficient data to distinguish good arms from bad. We propose augmenting Disjoint LinUCB with LLM pseudo-observations: after each round, a large language model predicts counterfactual rewards for the unplayed arms, and these predictions are injected into the learner as weighted pseudo-observations. The injection weight is controlled by a calibration-gated decay schedule that tracks the LLM's prediction accuracy on played arms via an exponential moving average; high calibration error suppresses the LLM's influence, while accurate predictions receive higher weight during the critical early rounds. We evaluate on two contextual bandit environments - UCI Mushroom (2-arm, asymmetric rewards) and MIND-small (5-arm news recommendation) - and find that when equipped with a task-specific prompt, LLM pseudo-observations reduce cumulative regret by 19% on MIND relative to pure LinUCB. However, generic counterfactual prompt framing increases regret on both environments, demonstrating that prompt design is the dominant factor, more important than the choice of decay schedule or calibration gating parameters. We analyze the failure modes of calibration gating on domains with small prediction errors and provide a theoretical motivation for the bias-variance trade-off governing pseudo-observation weight.
Maksim Pershin, Ivan Golovanov, Pavel Baltabaev +1
Large language models (LLMs) are increasingly deployed as decision-making agents in settings that require sophisticated environmental exploration. However, existing work has raised questions about how LLMs actually balance exploration and exploitation. Unlike classical agents, LLM agents engage with tasks through natural language, exposing them to semantic information with no formal counterpart in the task structure. We introduce the semantic bandit, an extension of the multi-armed bandit setting that explicitly considers the textual labels assigned to actions, and use it to study how semantic priors --- inductive biases arising from associations between language and expected reward learned during pre-training, shape LLM exploration behaviour. We find that semantically informative action labels reduce exploration in favour of exploitation, improving performance when aligned with the reward structure and severely degrading it when misaligned. We further find that negative rewards trigger substantially more exploration than equivalent positive rewards, consistent with an expected-scale bias induced by reward conventions common in pre-training data. Overall, we argue that the use of language to define the environment and rewards introduces unavoidable biases derived from the fact that the model is trained on word co-occurence, with implications for the reliability and robustness of LLM agents in real-world decision-making settings.
David Eric Austin, Kaheer Suleman, Jackie Chi Kit Cheung
McGill University · Mila – Quebec AI Institute · Skyfall AI +1
Inspired by the problem of identifying the best model from a collection of large language models (LLMs) with heterogeneous querying costs, we formulate and analyse a variant of the multi-armed bandit (MAB) with (i) dueling feedback, where pairwise comparisons between model responses provide robust preference signals, and (ii) heterogeneous sampling costs, reflecting the differing costs of querying different LLMs. Assuming the existence of a Condorcet winner, a condition we empirically validate across multiple real-world datasets, we propose a Track-and-Stop style algorithm for best-arm identification with prescribed confidence. We prove that the algorithm almost surely achieves the asymptotically optimal cost as the error tends to zero. Finally, we extensively evaluate our approach on both synthetic and real-world instances, demonstrating consistent improvements over classical cost-unaware algorithms and their cost-aware extensions.
Centre for Machine Intelligence and Data Science (C-MInDS) Indian Institute of Technology Bombay · Department of Electrical Engineering Indian Institute of Technology Bombay